Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(177)

Unified Diff: third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.h

Issue 2741793003: Accurate transfer of SerializedScriptValue allocation costs. (Closed)
Patch Set: sanity check diff adjustments Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.h
diff --git a/third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.h b/third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.h
index e74e3dfd8b5f3a190600d1d26a335f5663dd7ab5..9c4e3a9e67fdeb130c6f9c1233a32f6c7be38a00 100644
--- a/third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.h
+++ b/third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.h
@@ -136,13 +136,13 @@ class CORE_EXPORT SerializedScriptValue
// The memory registration is revoked automatically in destructor.
void registerMemoryAllocatedWithCurrentScriptContext();
- // Upon passing a serialized value from one context to another (via a
- // postMessage()), the allocation amounts it has registered with the
- // 'origining' context must be discharged, as the 'target' context will assume
- // ownership of value. This method takes care of the first part of the
- // external allocation bookkeeping, the above registration method the other
- // half.
- void unregisterMemoryAllocatedByCurrentScriptContext();
+ // The dual, unregistering / subtracting the external memory allocation costs
+ // of this SerializedScriptValue with the current context. This includes
+ // discounting the cost of the transferables.
+ //
+ // The value is updated and marked as having no allocations registered,
+ // hence subsequent calls will be no-ops.
+ void unregisterMemoryAllocatedWithCurrentScriptContext();
const uint8_t* data() const { return m_dataBuffer.get(); }
size_t dataLengthInBytes() const { return m_dataBufferSize; }
@@ -188,8 +188,9 @@ class CORE_EXPORT SerializedScriptValue
std::unique_ptr<ArrayBufferContentsArray> m_arrayBufferContentsArray;
std::unique_ptr<ImageBitmapContentsArray> m_imageBitmapContentsArray;
BlobDataHandleMap m_blobDataHandles;
- size_t m_externallyAllocatedMemory;
- bool m_adjustTransferableExternalAllocationOnContextTransfer;
+
+ bool m_hasRegisteredExternalAllocation;
+ bool m_transferablesNeedExternalAllocationRegistration;
};
template <>
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698