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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/SerializedScriptValueFactory.h

Issue 1862033002: Make OffscreenCanvas Transferable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: no need to register, taking the same approach as extractTransferables Created 4 years, 8 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 #ifndef SerializedScriptValueFactory_h 5 #ifndef SerializedScriptValueFactory_h
6 #define SerializedScriptValueFactory_h 6 #define SerializedScriptValueFactory_h
7 7
8 #include "bindings/core/v8/ScriptValueSerializer.h" 8 #include "bindings/core/v8/ScriptValueSerializer.h"
9 #include "bindings/core/v8/SerializedScriptValue.h" 9 #include "bindings/core/v8/SerializedScriptValue.h"
10 #include "core/CoreExport.h" 10 #include "core/CoreExport.h"
(...skipping 14 matching lines...) Expand all
25 // the caller must not invoke any V8 operations until control returns to 25 // the caller must not invoke any V8 operations until control returns to
26 // V8. When serialization is successful, |didThrow| is false. 26 // V8. When serialization is successful, |didThrow| is false.
27 virtual PassRefPtr<SerializedScriptValue> create(v8::Isolate*, v8::Local<v8: :Value>, Transferables*, WebBlobInfoArray*, ExceptionState&); 27 virtual PassRefPtr<SerializedScriptValue> create(v8::Isolate*, v8::Local<v8: :Value>, Transferables*, WebBlobInfoArray*, ExceptionState&);
28 PassRefPtr<SerializedScriptValue> create(v8::Isolate*, v8::Local<v8::Value>, Transferables*, ExceptionState&); 28 PassRefPtr<SerializedScriptValue> create(v8::Isolate*, v8::Local<v8::Value>, Transferables*, ExceptionState&);
29 PassRefPtr<SerializedScriptValue> createFromWire(const String&); 29 PassRefPtr<SerializedScriptValue> createFromWire(const String&);
30 PassRefPtr<SerializedScriptValue> createFromWireBytes(const char* data, size _t length); 30 PassRefPtr<SerializedScriptValue> createFromWireBytes(const char* data, size _t length);
31 PassRefPtr<SerializedScriptValue> create(const String&); 31 PassRefPtr<SerializedScriptValue> create(const String&);
32 virtual PassRefPtr<SerializedScriptValue> create(v8::Isolate*, const String& ); 32 virtual PassRefPtr<SerializedScriptValue> create(v8::Isolate*, const String& );
33 PassRefPtr<SerializedScriptValue> create(); 33 PassRefPtr<SerializedScriptValue> create();
34 PassRefPtr<SerializedScriptValue> create(v8::Isolate*, const ScriptValue&, W ebBlobInfoArray*, ExceptionState&); 34 PassRefPtr<SerializedScriptValue> create(v8::Isolate*, const ScriptValue&, W ebBlobInfoArray*, ExceptionState&);
35 virtual bool extractTransferables(v8::Isolate*, Transferables&, ExceptionSta te&, v8::Local<v8::Value>&, unsigned);
36 virtual Transferables* createTransferables() { return new Transferables; }
35 37
36 // Never throws exceptions. 38 // Never throws exceptions.
37 PassRefPtr<SerializedScriptValue> createAndSwallowExceptions(v8::Isolate*, v 8::Local<v8::Value>); 39 PassRefPtr<SerializedScriptValue> createAndSwallowExceptions(v8::Isolate*, v 8::Local<v8::Value>);
38 40
39 v8::Local<v8::Value> deserialize(SerializedScriptValue*, v8::Isolate*, Messa gePortArray*, const WebBlobInfoArray*); 41 v8::Local<v8::Value> deserialize(SerializedScriptValue*, v8::Isolate*, Messa gePortArray*, const WebBlobInfoArray*);
40 42
41 static SerializedScriptValueFactory& instance() 43 static SerializedScriptValueFactory& instance()
42 { 44 {
43 if (!m_instance) { 45 if (!m_instance) {
44 ASSERT_NOT_REACHED(); 46 ASSERT_NOT_REACHED();
45 m_instance = new SerializedScriptValueFactory(); 47 m_instance = new SerializedScriptValueFactory();
46 } 48 }
47 return *m_instance; 49 return *m_instance;
48 } 50 }
49 51
50 // SerializedScriptValueFactory::initialize() should be invoked when Blink i s initialized, 52 // SerializedScriptValueFactory::initialize() should be invoked when Blink i s initialized,
51 // i.e. initialize() in WebKit.cpp. 53 // i.e. initialize() in WebKit.cpp.
52 static void initialize(SerializedScriptValueFactory* newFactory) 54 static void initialize(SerializedScriptValueFactory* newFactory)
53 { 55 {
54 ASSERT(!m_instance); 56 ASSERT(!m_instance);
55 m_instance = newFactory; 57 m_instance = newFactory;
56 } 58 }
57 59
58 protected: 60 protected:
59 ScriptValueSerializer::Status doSerialize(v8::Local<v8::Value>, SerializedSc riptValueWriter&, Transferables*, WebBlobInfoArray*, SerializedScriptValue*, v8: :TryCatch&, String& errorMessage, v8::Isolate*); 61 ScriptValueSerializer::Status doSerialize(v8::Local<v8::Value>, SerializedSc riptValueWriter&, Transferables*, WebBlobInfoArray*, SerializedScriptValue*, v8: :TryCatch&, String& errorMessage, v8::Isolate*);
60 virtual ScriptValueSerializer::Status doSerialize(v8::Local<v8::Value>, Seri alizedScriptValueWriter&, Transferables*, WebBlobInfoArray*, BlobDataHandleMap&, v8::TryCatch&, String& errorMessage, v8::Isolate*); 62 virtual ScriptValueSerializer::Status doSerialize(v8::Local<v8::Value>, Seri alizedScriptValueWriter&, Transferables*, WebBlobInfoArray*, BlobDataHandleMap&, v8::TryCatch&, String& errorMessage, v8::Isolate*);
61 void transferData(SerializedScriptValue*, SerializedScriptValueWriter&, Tran sferables*, ExceptionState&, v8::Isolate*); 63 virtual void transferData(v8::Isolate*, Transferables*, ExceptionState&, Ser ializedScriptValue*, SerializedScriptValueWriter&);
62 64
63 virtual v8::Local<v8::Value> deserialize(String& data, BlobDataHandleMap& bl obDataHandles, ArrayBufferContentsArray*, ImageBitmapContentsArray*, v8::Isolate *, MessagePortArray* messagePorts, const WebBlobInfoArray*); 65 virtual v8::Local<v8::Value> deserialize(String& data, BlobDataHandleMap& bl obDataHandles, ArrayBufferContentsArray*, ImageBitmapContentsArray*, v8::Isolate *, MessagePortArray* messagePorts, const WebBlobInfoArray*);
64 66
65 private: 67 private:
66 static SerializedScriptValueFactory* m_instance; 68 static SerializedScriptValueFactory* m_instance;
67 }; 69 };
68 70
69 } // namespace blink 71 } // namespace blink
70 72
71 #endif // SerializedScriptValueFactory_h 73 #endif // SerializedScriptValueFactory_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698