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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.cpp

Issue 2494823002: V8ScriptValueSerializer: Use PartitionAlloc for the buffer, and avoid copying it into a String. (Closed)
Patch Set: initialize SerializedScriptValue::m_dataBufferSize Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "bindings/core/v8/ScriptValueSerializer.h" 5 #include "bindings/core/v8/ScriptValueSerializer.h"
6 6
7 #include "bindings/core/v8/Transferables.h" 7 #include "bindings/core/v8/Transferables.h"
8 #include "bindings/core/v8/V8ArrayBuffer.h" 8 #include "bindings/core/v8/V8ArrayBuffer.h"
9 #include "bindings/core/v8/V8ArrayBufferView.h" 9 #include "bindings/core/v8/V8ArrayBufferView.h"
10 #include "bindings/core/v8/V8Blob.h" 10 #include "bindings/core/v8/V8Blob.h"
(...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after
806 } 806 }
807 807
808 return serializedValue.release(); 808 return serializedValue.release();
809 } 809 }
810 810
811 void ScriptValueSerializer::transferData( 811 void ScriptValueSerializer::transferData(
812 Transferables* transferables, 812 Transferables* transferables,
813 ExceptionState& exceptionState, 813 ExceptionState& exceptionState,
814 SerializedScriptValue* serializedValue) { 814 SerializedScriptValue* serializedValue) {
815 serializedValue->setData(m_writer.takeWireString()); 815 serializedValue->setData(m_writer.takeWireString());
816 DCHECK(serializedValue->data().impl()->hasOneRef()); 816 DCHECK(serializedValue->dataHasOneRef());
817 if (!transferables) 817 if (!transferables)
818 return; 818 return;
819 819
820 serializedValue->transferImageBitmaps(isolate(), transferables->imageBitmaps, 820 serializedValue->transferImageBitmaps(isolate(), transferables->imageBitmaps,
821 exceptionState); 821 exceptionState);
822 if (exceptionState.hadException()) 822 if (exceptionState.hadException())
823 return; 823 return;
824 serializedValue->transferArrayBuffers(isolate(), transferables->arrayBuffers, 824 serializedValue->transferArrayBuffers(isolate(), transferables->arrayBuffers,
825 exceptionState); 825 exceptionState);
826 if (exceptionState.hadException()) 826 if (exceptionState.hadException())
(...skipping 1853 matching lines...) Expand 10 before | Expand all | Expand 10 after
2680 m_openCompositeReferenceStack[m_openCompositeReferenceStack.size() - 1]; 2680 m_openCompositeReferenceStack[m_openCompositeReferenceStack.size() - 1];
2681 m_openCompositeReferenceStack.shrink(m_openCompositeReferenceStack.size() - 2681 m_openCompositeReferenceStack.shrink(m_openCompositeReferenceStack.size() -
2682 1); 2682 1);
2683 if (objectReference >= m_objectPool.size()) 2683 if (objectReference >= m_objectPool.size())
2684 return false; 2684 return false;
2685 *object = m_objectPool[objectReference]; 2685 *object = m_objectPool[objectReference];
2686 return true; 2686 return true;
2687 } 2687 }
2688 2688
2689 } // namespace blink 2689 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698