Bug 1455071 - Remove unused alternate callback option to JSAutoStructuredCloneBuffer::clear, r=jorendorff
authorSteve Fink <sfink@mozilla.com>
Thu, 15 Mar 2018 17:11:31 -0700
changeset 467973 b932696b192aeea8fb6b146508d58cd69e37a21b
parent 467972 9f5ed3cd4d9123ced9db9f89d649e674ead35fe8
child 467974 c544503c6ae6a90444f37abe2716b1a30f68b545
push id9165
push userasasaki@mozilla.com
push dateThu, 26 Apr 2018 21:04:54 +0000
treeherdermozilla-beta@064c3804de2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorendorff
bugs1455071
milestone61.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 1455071 - Remove unused alternate callback option to JSAutoStructuredCloneBuffer::clear, r=jorendorff
js/public/StructuredClone.h
js/src/vm/StructuredClone.cpp
--- a/js/public/StructuredClone.h
+++ b/js/public/StructuredClone.h
@@ -445,17 +445,17 @@ class JS_PUBLIC_API(JSAutoStructuredClon
     JSAutoStructuredCloneBuffer(JSAutoStructuredCloneBuffer&& other);
     JSAutoStructuredCloneBuffer& operator=(JSAutoStructuredCloneBuffer&& other);
 
     ~JSAutoStructuredCloneBuffer() { clear(); }
 
     JSStructuredCloneData& data() { return data_; }
     bool empty() const { return !data_.Size(); }
 
-    void clear(const JSStructuredCloneCallbacks* optionalCallbacks=nullptr, void* closure=nullptr);
+    void clear();
 
     /** Copy some memory. It will be automatically freed by the destructor. */
     bool copy(JSContext* cx, const JSStructuredCloneData& data,
               uint32_t version=JS_STRUCTURED_CLONE_VERSION,
               const JSStructuredCloneCallbacks* callbacks=nullptr, void* closure=nullptr);
 
     /**
      * Adopt some memory. It will be automatically freed by the destructor.
--- a/js/src/vm/StructuredClone.cpp
+++ b/js/src/vm/StructuredClone.cpp
@@ -2815,26 +2815,21 @@ JSAutoStructuredCloneBuffer::operator=(J
     MOZ_ASSERT(scope_ == other.scope_);
     clear();
     data_.ownTransferables_ = other.data_.ownTransferables_;
     other.steal(&data_, &version_, &data_.callbacks_, &data_.closure_);
     return *this;
 }
 
 void
-JSAutoStructuredCloneBuffer::clear(const JSStructuredCloneCallbacks* optionalCallbacks,
-                                   void* optionalClosure)
+JSAutoStructuredCloneBuffer::clear()
 {
     if (!data_.Size())
         return;
 
-    const JSStructuredCloneCallbacks* callbacks =
-        optionalCallbacks ?  optionalCallbacks : data_.callbacks_;
-    void* closure = optionalClosure ?  optionalClosure : data_.closure_;
-
     if (data_.ownTransferables_ == OwnTransferablePolicy::OwnsTransferablesIfAny)
         DiscardTransferables(data_, callbacks, closure);
     data_.ownTransferables_ = OwnTransferablePolicy::NoTransferables;
     data_.refsHeld_.releaseAll();
     data_.Clear();
     version_ = 0;
 }