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

Unified Diff: Source/bindings/v8/SerializedScriptValue.cpp

Issue 56973002: Fix memory leak on serializing neutered ArrayBuffer. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 1 month 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/SerializedScriptValue.cpp
diff --git a/Source/bindings/v8/SerializedScriptValue.cpp b/Source/bindings/v8/SerializedScriptValue.cpp
index 984d5e7388c81401ba571f73baad30d1c1c07b9e..5532cb991d7cc2ae927316a46dfae5037d1e9f51 100644
--- a/Source/bindings/v8/SerializedScriptValue.cpp
+++ b/Source/bindings/v8/SerializedScriptValue.cpp
@@ -1139,9 +1139,11 @@ private:
v8::Handle<v8::Value> underlyingBuffer = toV8(arrayBufferView->buffer(), v8::Handle<v8::Object>(), m_writer.getIsolate());
if (underlyingBuffer.IsEmpty())
return handleError(DataCloneError, next);
- StateBase* stateOut = doSerialize(underlyingBuffer, 0);
- if (stateOut)
+ if (StateBase* stateOut = doSerialize(underlyingBuffer, 0)) {
Dmitry Lomov (no reviews) 2013/11/04 10:15:35 style nit: I am a simple programmer and variable d
sof 2013/11/04 10:21:14 alright. One of the likeable syntactic features of
+ while (stateOut)
+ stateOut = pop(stateOut);
Dmitry Lomov (no reviews) 2013/11/04 10:15:35 Hmm I do not like this popping out loop (It repeat
sof 2013/11/04 10:21:14 Hmm, and we won't run into the depth check at the
return handleError(DataCloneError, next);
+ }
m_writer.writeArrayBufferView(*arrayBufferView);
// This should be safe: we serialize something that we know to be a wrapper (see
// the toV8 call above), so the call to doSerialize above should neither cause
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698