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

Side by Side Diff: Source/bindings/v8/V8PerIsolateData.h

Issue 345893002: Implement an infrastructure of Blink-in-JS Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 11 matching lines...) Expand all
22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23 * THE POSSIBILITY OF SUCH DAMAGE. 23 * THE POSSIBILITY OF SUCH DAMAGE.
24 */ 24 */
25 25
26 #ifndef V8PerIsolateData_h 26 #ifndef V8PerIsolateData_h
27 #define V8PerIsolateData_h 27 #define V8PerIsolateData_h
28 28
29 #include "bindings/v8/ScopedPersistent.h" 29 #include "bindings/v8/ScopedPersistent.h"
30 #include "bindings/v8/ScriptState.h" 30 #include "bindings/v8/ScriptState.h"
31 #include "bindings/v8/V8HiddenValue.h" 31 #include "bindings/v8/V8HiddenValue.h"
32 #include "bindings/v8/V8PersistentValueMap.h"
32 #include "bindings/v8/WrapperTypeInfo.h" 33 #include "bindings/v8/WrapperTypeInfo.h"
33 #include "gin/public/gin_embedders.h" 34 #include "gin/public/gin_embedders.h"
34 #include "gin/public/isolate_holder.h" 35 #include "gin/public/isolate_holder.h"
35 #include <v8.h> 36 #include <v8.h>
36 #include "wtf/Forward.h" 37 #include "wtf/Forward.h"
37 #include "wtf/HashMap.h" 38 #include "wtf/HashMap.h"
38 #include "wtf/OwnPtr.h" 39 #include "wtf/OwnPtr.h"
39 #include "wtf/Vector.h" 40 #include "wtf/Vector.h"
41 #include "wtf/text/WTFString.h"
40 42
41 namespace WebCore { 43 namespace WebCore {
42 44
43 class DOMDataStore; 45 class DOMDataStore;
44 class GCEventData; 46 class GCEventData;
45 class StringCache; 47 class StringCache;
46 struct WrapperTypeInfo; 48 struct WrapperTypeInfo;
47 49
48 class ExternalStringVisitor; 50 class ExternalStringVisitor;
49 51
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 void setDOMTemplate(void* domTemplateKey, v8::Handle<v8::FunctionTemplate>); 92 void setDOMTemplate(void* domTemplateKey, v8::Handle<v8::FunctionTemplate>);
91 93
92 bool hasInstance(const WrapperTypeInfo*, v8::Handle<v8::Value>); 94 bool hasInstance(const WrapperTypeInfo*, v8::Handle<v8::Value>);
93 v8::Handle<v8::Object> findInstanceInPrototypeChain(const WrapperTypeInfo*, v8::Handle<v8::Value>); 95 v8::Handle<v8::Object> findInstanceInPrototypeChain(const WrapperTypeInfo*, v8::Handle<v8::Value>);
94 96
95 v8::Local<v8::Context> ensureScriptRegexpContext(); 97 v8::Local<v8::Context> ensureScriptRegexpContext();
96 98
97 const char* previousSamplingState() const { return m_previousSamplingState; } 99 const char* previousSamplingState() const { return m_previousSamplingState; }
98 void setPreviousSamplingState(const char* name) { m_previousSamplingState = name; } 100 void setPreviousSamplingState(const char* name) { m_previousSamplingState = name; }
99 101
102 v8::Handle<v8::Value> compiledBlinkInJS(String);
103 void setCompiledBlinkInJS(String, v8::Handle<v8::Value>);
104
100 private: 105 private:
101 explicit V8PerIsolateData(v8::Isolate*); 106 explicit V8PerIsolateData(v8::Isolate*);
102 ~V8PerIsolateData(); 107 ~V8PerIsolateData();
103 108
104 typedef HashMap<const void*, v8::Eternal<v8::FunctionTemplate> > DOMTemplate Map; 109 typedef HashMap<const void*, v8::Eternal<v8::FunctionTemplate> > DOMTemplate Map;
105 DOMTemplateMap& currentDOMTemplateMap(); 110 DOMTemplateMap& currentDOMTemplateMap();
106 bool hasInstance(const WrapperTypeInfo*, v8::Handle<v8::Value>, DOMTemplateM ap&); 111 bool hasInstance(const WrapperTypeInfo*, v8::Handle<v8::Value>, DOMTemplateM ap&);
107 v8::Handle<v8::Object> findInstanceInPrototypeChain(const WrapperTypeInfo*, v8::Handle<v8::Value>, DOMTemplateMap&); 112 v8::Handle<v8::Object> findInstanceInPrototypeChain(const WrapperTypeInfo*, v8::Handle<v8::Value>, DOMTemplateMap&);
108 113
109 v8::Isolate* m_isolate; 114 v8::Isolate* m_isolate;
110 OwnPtr<gin::IsolateHolder> m_isolateHolder; 115 OwnPtr<gin::IsolateHolder> m_isolateHolder;
111 DOMTemplateMap m_domTemplateMapForMainWorld; 116 DOMTemplateMap m_domTemplateMapForMainWorld;
112 DOMTemplateMap m_domTemplateMapForNonMainWorld; 117 DOMTemplateMap m_domTemplateMapForNonMainWorld;
113 ScopedPersistent<v8::FunctionTemplate> m_toStringTemplate; 118 ScopedPersistent<v8::FunctionTemplate> m_toStringTemplate;
114 OwnPtr<StringCache> m_stringCache; 119 OwnPtr<StringCache> m_stringCache;
115 OwnPtr<V8HiddenValue> m_hiddenValue; 120 OwnPtr<V8HiddenValue> m_hiddenValue;
116 ScopedPersistent<v8::Value> m_liveRoot; 121 ScopedPersistent<v8::Value> m_liveRoot;
117 RefPtr<ScriptState> m_scriptRegexpScriptState; 122 RefPtr<ScriptState> m_scriptRegexpScriptState;
118 123
119 const char* m_previousSamplingState; 124 const char* m_previousSamplingState;
125 V8PersistentValueMap<String, v8::Value, false> m_compiledBlinkInJS;
120 126
121 bool m_constructorMode; 127 bool m_constructorMode;
122 friend class ConstructorMode; 128 friend class ConstructorMode;
123 129
124 int m_recursionLevel; 130 int m_recursionLevel;
125 131
126 #ifndef NDEBUG 132 #ifndef NDEBUG
127 int m_internalScriptRecursionLevel; 133 int m_internalScriptRecursionLevel;
128 #endif 134 #endif
129 OwnPtr<GCEventData> m_gcEventData; 135 OwnPtr<GCEventData> m_gcEventData;
130 bool m_performingMicrotaskCheckpoint; 136 bool m_performingMicrotaskCheckpoint;
131 }; 137 };
132 138
133 } // namespace WebCore 139 } // namespace WebCore
134 140
135 #endif // V8PerIsolateData_h 141 #endif // V8PerIsolateData_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698