Bug 1583251 - P2 - Fix some format nits or naming nits for StructuredClone::Write; r=nika,lth
authorTom Tung <ttung@mozilla.com>
Wed, 23 Oct 2019 07:20:05 +0000
changeset 498675 51bb06ee4062fe6356268096ff3f9ec3efe47618
parent 498674 b2c99cc8f60b314cfad5760fd56e45ae195ab5d6
child 498676 8900fd9c1c09a2e4e33caf82a336f718f402345f
push id98599
push userttung@mozilla.com
push dateWed, 23 Oct 2019 07:22:53 +0000
treeherderautoland@058946a415aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnika, lth
bugs1583251
milestone72.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1583251 - P2 - Fix some format nits or naming nits for StructuredClone::Write; r=nika,lth Differential Revision: https://phabricator.services.mozilla.com/D48348
dom/base/StructuredCloneHolder.cpp
dom/base/StructuredCloneHolder.h
js/public/StructuredClone.h
--- a/dom/base/StructuredCloneHolder.cpp
+++ b/dom/base/StructuredCloneHolder.cpp
@@ -167,24 +167,24 @@ void StructuredCloneHolderBase::Clear() 
 bool StructuredCloneHolderBase::Write(JSContext* aCx,
                                       JS::Handle<JS::Value> aValue) {
   return Write(aCx, aValue, JS::UndefinedHandleValue, JS::CloneDataPolicy());
 }
 
 bool StructuredCloneHolderBase::Write(JSContext* aCx,
                                       JS::Handle<JS::Value> aValue,
                                       JS::Handle<JS::Value> aTransfer,
-                                      JS::CloneDataPolicy cloneDataPolicy) {
+                                      JS::CloneDataPolicy aCloneDataPolicy) {
   MOZ_ASSERT(!mBuffer, "Double Write is not allowed");
   MOZ_ASSERT(!mClearCalled, "This method cannot be called after Clear.");
 
   mBuffer = MakeUnique<JSAutoStructuredCloneBuffer>(
       mStructuredCloneScope, &StructuredCloneHolder::sCallbacks, this);
 
-  if (!mBuffer->write(aCx, aValue, aTransfer, cloneDataPolicy,
+  if (!mBuffer->write(aCx, aValue, aTransfer, aCloneDataPolicy,
                       &StructuredCloneHolder::sCallbacks, this)) {
     mBuffer = nullptr;
     return false;
   }
 
   return true;
 }
 
--- a/dom/base/StructuredCloneHolder.h
+++ b/dom/base/StructuredCloneHolder.h
@@ -93,17 +93,17 @@ class StructuredCloneHolderBase {
   // Execute the serialization of aValue using the Structured Clone Algorithm.
   // The data can read back using Read().
   bool Write(JSContext* aCx, JS::Handle<JS::Value> aValue);
 
   // Like Write() but it supports the transferring of objects and handling
   // of cloning policy.
   bool Write(JSContext* aCx, JS::Handle<JS::Value> aValue,
              JS::Handle<JS::Value> aTransfer,
-             JS::CloneDataPolicy cloneDataPolicy);
+             JS::CloneDataPolicy aCloneDataPolicy);
 
   // If Write() has been called, this method retrieves data and stores it into
   // aValue.
   bool Read(JSContext* aCx, JS::MutableHandle<JS::Value> aValue);
 
   bool HasData() const { return !!mBuffer; }
 
   JSStructuredCloneData& BufferData() const {
@@ -155,17 +155,17 @@ class StructuredCloneHolder : public Str
   StructuredCloneHolder(StructuredCloneHolder&& aOther) = delete;
 
   // Normally you should just use Write() and Read().
 
   void Write(JSContext* aCx, JS::Handle<JS::Value> aValue, ErrorResult& aRv);
 
   void Write(JSContext* aCx, JS::Handle<JS::Value> aValue,
              JS::Handle<JS::Value> aTransfer,
-             JS::CloneDataPolicy cloneDataPolicy, ErrorResult& aRv);
+             JS::CloneDataPolicy aCloneDataPolicy, ErrorResult& aRv);
 
   void Read(nsIGlobalObject* aGlobal, JSContext* aCx,
             JS::MutableHandle<JS::Value> aValue, ErrorResult& aRv);
 
   // Call this method to know if this object is keeping some DOM object alive.
   bool HasClonedDOMObjects() const {
     return !mBlobImplArray.IsEmpty() || !mWasmModuleArray.IsEmpty() ||
            !mClonedSurfaces.IsEmpty() || !mInputStreamArray.IsEmpty();
--- a/js/public/StructuredClone.h
+++ b/js/public/StructuredClone.h
@@ -203,17 +203,17 @@ enum TransferableOwnership {
 
   SCTAG_TMO_USER_MIN
 };
 
 class CloneDataPolicy {
   bool sharedArrayBuffer_;
 
  public:
-  // The default is to allow all policy-controlled aspects.
+  // The default is to deny all policy-controlled aspects.
 
   CloneDataPolicy() : sharedArrayBuffer_(false) {}
 
   // In the JS engine, SharedArrayBuffers can only be cloned intra-process
   // because the shared memory areas are allocated in process-private memory.
   // Clients should therefore deny SharedArrayBuffers when cloning data that
   // are to be transmitted inter-process.
   //