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

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

Issue 1111163003: Replace v8::Handle<> with v8::Local<> in bindings/core/v8/* (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 7 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"
11 #include "wtf/Noncopyable.h" 11 #include "wtf/Noncopyable.h"
12 12
13 namespace blink { 13 namespace blink {
14 14
15 class CORE_EXPORT SerializedScriptValueFactory { 15 class CORE_EXPORT SerializedScriptValueFactory {
16 WTF_MAKE_NONCOPYABLE(SerializedScriptValueFactory); 16 WTF_MAKE_NONCOPYABLE(SerializedScriptValueFactory);
17 public: 17 public:
18 SerializedScriptValueFactory() { } 18 SerializedScriptValueFactory() { }
19 19
20 // If a serialization error occurs (e.g., cyclic input value) this 20 // If a serialization error occurs (e.g., cyclic input value) this
21 // function returns an empty representation, schedules a V8 exception to 21 // function returns an empty representation, schedules a V8 exception to
22 // be thrown using v8::ThrowException(), and sets |didThrow|. In this case 22 // be thrown using v8::ThrowException(), and sets |didThrow|. In this case
23 // the caller must not invoke any V8 operations until control returns to 23 // the caller must not invoke any V8 operations until control returns to
24 // V8. When serialization is successful, |didThrow| is false. 24 // V8. When serialization is successful, |didThrow| is false.
25 virtual PassRefPtr<SerializedScriptValue> create(v8::Handle<v8::Value>, Mess agePortArray*, ArrayBufferArray*, WebBlobInfoArray*, ExceptionState&, v8::Isolat e*); 25 virtual PassRefPtr<SerializedScriptValue> create(v8::Local<v8::Value>, Messa gePortArray*, ArrayBufferArray*, WebBlobInfoArray*, ExceptionState&, v8::Isolate *);
26 PassRefPtr<SerializedScriptValue> create(v8::Handle<v8::Value>, MessagePortA rray*, ArrayBufferArray*, ExceptionState&, v8::Isolate*); 26 PassRefPtr<SerializedScriptValue> create(v8::Local<v8::Value>, MessagePortAr ray*, ArrayBufferArray*, ExceptionState&, v8::Isolate*);
27 PassRefPtr<SerializedScriptValue> createFromWire(const String&); 27 PassRefPtr<SerializedScriptValue> createFromWire(const String&);
28 PassRefPtr<SerializedScriptValue> createFromWireBytes(const char* data, size _t length); 28 PassRefPtr<SerializedScriptValue> createFromWireBytes(const char* data, size _t length);
29 PassRefPtr<SerializedScriptValue> create(const String&); 29 PassRefPtr<SerializedScriptValue> create(const String&);
30 virtual PassRefPtr<SerializedScriptValue> create(const String&, v8::Isolate* ); 30 virtual PassRefPtr<SerializedScriptValue> create(const String&, v8::Isolate* );
31 PassRefPtr<SerializedScriptValue> create(); 31 PassRefPtr<SerializedScriptValue> create();
32 PassRefPtr<SerializedScriptValue> create(const ScriptValue&, WebBlobInfoArra y*, ExceptionState&, v8::Isolate*); 32 PassRefPtr<SerializedScriptValue> create(const ScriptValue&, WebBlobInfoArra y*, ExceptionState&, v8::Isolate*);
33 33
34 // Never throws exceptions. 34 // Never throws exceptions.
35 PassRefPtr<SerializedScriptValue> createAndSwallowExceptions(v8::Isolate*, v 8::Handle<v8::Value>); 35 PassRefPtr<SerializedScriptValue> createAndSwallowExceptions(v8::Isolate*, v 8::Local<v8::Value>);
36 36
37 v8::Handle<v8::Value> deserialize(SerializedScriptValue*, v8::Isolate*, Mess agePortArray*, const WebBlobInfoArray*); 37 v8::Local<v8::Value> deserialize(SerializedScriptValue*, v8::Isolate*, Messa gePortArray*, const WebBlobInfoArray*);
38 38
39 static SerializedScriptValueFactory& instance() 39 static SerializedScriptValueFactory& instance()
40 { 40 {
41 if (!m_instance) { 41 if (!m_instance) {
42 ASSERT_NOT_REACHED(); 42 ASSERT_NOT_REACHED();
43 m_instance = new SerializedScriptValueFactory(); 43 m_instance = new SerializedScriptValueFactory();
44 } 44 }
45 return *m_instance; 45 return *m_instance;
46 } 46 }
47 47
48 // SerializedScriptValueFactory::initialize() should be invoked when Blink i s initialized, 48 // SerializedScriptValueFactory::initialize() should be invoked when Blink i s initialized,
49 // i.e. initializeWithoutV8() in WebKit.cpp. 49 // i.e. initializeWithoutV8() in WebKit.cpp.
50 static void initialize(SerializedScriptValueFactory* newFactory) 50 static void initialize(SerializedScriptValueFactory* newFactory)
51 { 51 {
52 ASSERT(!m_instance); 52 ASSERT(!m_instance);
53 m_instance = newFactory; 53 m_instance = newFactory;
54 } 54 }
55 55
56 protected: 56 protected:
57 ScriptValueSerializer::Status doSerialize(v8::Handle<v8::Value>, SerializedS criptValueWriter&, MessagePortArray*, ArrayBufferArray*, WebBlobInfoArray*, Seri alizedScriptValue*, v8::TryCatch&, String& errorMessage, v8::Isolate*); 57 ScriptValueSerializer::Status doSerialize(v8::Local<v8::Value>, SerializedSc riptValueWriter&, MessagePortArray*, ArrayBufferArray*, WebBlobInfoArray*, Seria lizedScriptValue*, v8::TryCatch&, String& errorMessage, v8::Isolate*);
58 virtual ScriptValueSerializer::Status doSerialize(v8::Handle<v8::Value>, Ser ializedScriptValueWriter&, MessagePortArray*, ArrayBufferArray*, WebBlobInfoArra y*, BlobDataHandleMap&, v8::TryCatch&, String& errorMessage, v8::Isolate*); 58 virtual ScriptValueSerializer::Status doSerialize(v8::Local<v8::Value>, Seri alizedScriptValueWriter&, MessagePortArray*, ArrayBufferArray*, WebBlobInfoArray *, BlobDataHandleMap&, v8::TryCatch&, String& errorMessage, v8::Isolate*);
59 void transferData(SerializedScriptValue*, SerializedScriptValueWriter&, Arra yBufferArray*, ExceptionState&, v8::Isolate*); 59 void transferData(SerializedScriptValue*, SerializedScriptValueWriter&, Arra yBufferArray*, ExceptionState&, v8::Isolate*);
60 60
61 virtual v8::Handle<v8::Value> deserialize(String& data, BlobDataHandleMap& b lobDataHandles, ArrayBufferContentsArray*, v8::Isolate*, MessagePortArray* messa gePorts, const WebBlobInfoArray*); 61 virtual v8::Local<v8::Value> deserialize(String& data, BlobDataHandleMap& bl obDataHandles, ArrayBufferContentsArray*, v8::Isolate*, MessagePortArray* messag ePorts, const WebBlobInfoArray*);
62 62
63 private: 63 private:
64 static SerializedScriptValueFactory* m_instance; 64 static SerializedScriptValueFactory* m_instance;
65 }; 65 };
66 66
67 } // namespace blink 67 } // namespace blink
68 68
69 #endif // SerializedScriptValueFactory_h 69 #endif // SerializedScriptValueFactory_h
OLDNEW
« no previous file with comments | « Source/bindings/core/v8/SerializedScriptValue.cpp ('k') | Source/bindings/core/v8/SerializedScriptValueFactory.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698