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

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

Issue 2686503005: Remove SerializedScriptValue::serialize and ScriptValueSerializer::serializeWTFString. (Closed)
Patch Set: Merge branch 'master' into delete-ssv Created 3 years, 10 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 unified diff | Download patch
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 783 matching lines...) Expand 10 before | Expand all | Expand 10 after
794 if (exceptionState.hadException()) 794 if (exceptionState.hadException())
795 return; 795 return;
796 serializedValue->transferArrayBuffers(isolate(), transferables->arrayBuffers, 796 serializedValue->transferArrayBuffers(isolate(), transferables->arrayBuffers,
797 exceptionState); 797 exceptionState);
798 if (exceptionState.hadException()) 798 if (exceptionState.hadException())
799 return; 799 return;
800 serializedValue->transferOffscreenCanvas( 800 serializedValue->transferOffscreenCanvas(
801 isolate(), transferables->offscreenCanvases, exceptionState); 801 isolate(), transferables->offscreenCanvases, exceptionState);
802 } 802 }
803 803
804 // static
805 String ScriptValueSerializer::serializeWTFString(const String& data) {
806 SerializedScriptValueWriter valueWriter;
807 valueWriter.writeWebCoreString(data);
808 return valueWriter.takeWireString();
809 }
810
811 ScriptValueSerializer::StateBase* ScriptValueSerializer::doSerialize( 804 ScriptValueSerializer::StateBase* ScriptValueSerializer::doSerialize(
812 v8::Local<v8::Value> value, 805 v8::Local<v8::Value> value,
813 StateBase* next) { 806 StateBase* next) {
814 m_writer.writeReferenceCount(m_nextObjectReference); 807 m_writer.writeReferenceCount(m_nextObjectReference);
815 808
816 if (value.IsEmpty()) 809 if (value.IsEmpty())
817 return handleError(Status::InputError, 810 return handleError(Status::InputError,
818 "The empty property cannot be cloned.", next); 811 "The empty property cannot be cloned.", next);
819 812
820 uint32_t objectReference; 813 uint32_t objectReference;
(...skipping 1808 matching lines...) Expand 10 before | Expand all | Expand 10 after
2629 m_openCompositeReferenceStack[m_openCompositeReferenceStack.size() - 1]; 2622 m_openCompositeReferenceStack[m_openCompositeReferenceStack.size() - 1];
2630 m_openCompositeReferenceStack.shrink(m_openCompositeReferenceStack.size() - 2623 m_openCompositeReferenceStack.shrink(m_openCompositeReferenceStack.size() -
2631 1); 2624 1);
2632 if (objectReference >= m_objectPool.size()) 2625 if (objectReference >= m_objectPool.size())
2633 return false; 2626 return false;
2634 *object = m_objectPool[objectReference]; 2627 *object = m_objectPool[objectReference];
2635 return true; 2628 return true;
2636 } 2629 }
2637 2630
2638 } // namespace blink 2631 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698