Bug 1583251 - P2 - Fix some format nits or naming nits for StructuredClone::Write; r=nika,lth

Differential Revision: https://phabricator.services.mozilla.com/D48348

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Tom Tung 2019-10-15 13:49:26 +00:00
Родитель 3f6f9df494
Коммит c291baa433
3 изменённых файлов: 8 добавлений и 8 удалений

Просмотреть файл

@ -172,14 +172,14 @@ bool StructuredCloneHolderBase::Write(JSContext* aCx,
bool StructuredCloneHolderBase::Write(JSContext* aCx, bool StructuredCloneHolderBase::Write(JSContext* aCx,
JS::Handle<JS::Value> aValue, JS::Handle<JS::Value> aValue,
JS::Handle<JS::Value> aTransfer, JS::Handle<JS::Value> aTransfer,
JS::CloneDataPolicy cloneDataPolicy) { JS::CloneDataPolicy aCloneDataPolicy) {
MOZ_ASSERT(!mBuffer, "Double Write is not allowed"); MOZ_ASSERT(!mBuffer, "Double Write is not allowed");
MOZ_ASSERT(!mClearCalled, "This method cannot be called after Clear."); MOZ_ASSERT(!mClearCalled, "This method cannot be called after Clear.");
mBuffer = MakeUnique<JSAutoStructuredCloneBuffer>( mBuffer = MakeUnique<JSAutoStructuredCloneBuffer>(
mStructuredCloneScope, &StructuredCloneHolder::sCallbacks, this); mStructuredCloneScope, &StructuredCloneHolder::sCallbacks, this);
if (!mBuffer->write(aCx, aValue, aTransfer, cloneDataPolicy, if (!mBuffer->write(aCx, aValue, aTransfer, aCloneDataPolicy,
&StructuredCloneHolder::sCallbacks, this)) { &StructuredCloneHolder::sCallbacks, this)) {
mBuffer = nullptr; mBuffer = nullptr;
return false; return false;

Просмотреть файл

@ -98,7 +98,7 @@ class StructuredCloneHolderBase {
// of cloning policy. // of cloning policy.
bool Write(JSContext* aCx, JS::Handle<JS::Value> aValue, bool Write(JSContext* aCx, JS::Handle<JS::Value> aValue,
JS::Handle<JS::Value> aTransfer, JS::Handle<JS::Value> aTransfer,
JS::CloneDataPolicy cloneDataPolicy); JS::CloneDataPolicy aCloneDataPolicy);
// If Write() has been called, this method retrieves data and stores it into // If Write() has been called, this method retrieves data and stores it into
// aValue. // aValue.
@ -160,7 +160,7 @@ class StructuredCloneHolder : public StructuredCloneHolderBase {
void Write(JSContext* aCx, JS::Handle<JS::Value> aValue, void Write(JSContext* aCx, JS::Handle<JS::Value> aValue,
JS::Handle<JS::Value> aTransfer, JS::Handle<JS::Value> aTransfer,
JS::CloneDataPolicy cloneDataPolicy, ErrorResult& aRv); JS::CloneDataPolicy aCloneDataPolicy, ErrorResult& aRv);
void Read(nsISupports* aParent, JSContext* aCx, void Read(nsISupports* aParent, JSContext* aCx,
JS::MutableHandle<JS::Value> aValue, ErrorResult& aRv); JS::MutableHandle<JS::Value> aValue, ErrorResult& aRv);

Просмотреть файл

@ -208,7 +208,7 @@ class CloneDataPolicy {
bool sharedArrayBuffer_; bool sharedArrayBuffer_;
public: public:
// The default is to allow all policy-controlled aspects. // The default is to deny all policy-controlled aspects.
CloneDataPolicy() : sharedArrayBuffer_(false) {} CloneDataPolicy() : sharedArrayBuffer_(false) {}