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

Side by Side Diff: Source/bindings/v8/V8PerContextData.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
« no previous file with comments | « Source/bindings/v8/V8EventListener.cpp ('k') | Source/bindings/v8/V8PerContextData.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 87
88 V8NPObjectMap* v8NPObjectMap() { return &m_v8NPObjectMap; } 88 V8NPObjectMap* v8NPObjectMap() { return &m_v8NPObjectMap; }
89 89
90 void addCustomElementBinding(CustomElementDefinition*, PassOwnPtr<CustomElem entBinding>); 90 void addCustomElementBinding(CustomElementDefinition*, PassOwnPtr<CustomElem entBinding>);
91 void clearCustomElementBinding(CustomElementDefinition*); 91 void clearCustomElementBinding(CustomElementDefinition*);
92 CustomElementBinding* customElementBinding(CustomElementDefinition*); 92 CustomElementBinding* customElementBinding(CustomElementDefinition*);
93 93
94 V8DOMActivityLogger* activityLogger() const { return m_activityLogger; } 94 V8DOMActivityLogger* activityLogger() const { return m_activityLogger; }
95 void setActivityLogger(V8DOMActivityLogger* activityLogger) { m_activityLogg er = activityLogger; } 95 void setActivityLogger(V8DOMActivityLogger* activityLogger) { m_activityLogg er = activityLogger; }
96 96
97 v8::Handle<v8::Value> compiledPrivateScript(String);
98 void setCompiledPrivateScript(String, v8::Handle<v8::Value>);
99
97 private: 100 private:
98 V8PerContextData(v8::Handle<v8::Context>); 101 V8PerContextData(v8::Handle<v8::Context>);
99 102
100 v8::Local<v8::Object> createWrapperFromCacheSlowCase(const WrapperTypeInfo*) ; 103 v8::Local<v8::Object> createWrapperFromCacheSlowCase(const WrapperTypeInfo*) ;
101 v8::Local<v8::Function> constructorForTypeSlowCase(const WrapperTypeInfo*); 104 v8::Local<v8::Function> constructorForTypeSlowCase(const WrapperTypeInfo*);
102 105
106 v8::Isolate* m_isolate;
107
103 // For each possible type of wrapper, we keep a boilerplate object. 108 // For each possible type of wrapper, we keep a boilerplate object.
104 // The boilerplate is used to create additional wrappers of the same type. 109 // The boilerplate is used to create additional wrappers of the same type.
105 typedef V8PersistentValueMap<const WrapperTypeInfo*, v8::Object, false> Wrap perBoilerplateMap; 110 typedef V8PersistentValueMap<const WrapperTypeInfo*, v8::Object, false> Wrap perBoilerplateMap;
106 WrapperBoilerplateMap m_wrapperBoilerplates; 111 WrapperBoilerplateMap m_wrapperBoilerplates;
107 112
108 typedef V8PersistentValueMap<const WrapperTypeInfo*, v8::Function, false> Co nstructorMap; 113 typedef V8PersistentValueMap<const WrapperTypeInfo*, v8::Function, false> Co nstructorMap;
109 ConstructorMap m_constructorMap; 114 ConstructorMap m_constructorMap;
110 115
111 V8NPObjectMap m_v8NPObjectMap; 116 V8NPObjectMap m_v8NPObjectMap;
112 117
113 v8::Isolate* m_isolate;
114 OwnPtr<gin::ContextHolder> m_contextHolder; 118 OwnPtr<gin::ContextHolder> m_contextHolder;
115 119
116 ScopedPersistent<v8::Context> m_context; 120 ScopedPersistent<v8::Context> m_context;
117 ScopedPersistent<v8::Value> m_errorPrototype; 121 ScopedPersistent<v8::Value> m_errorPrototype;
118 122
119 typedef WTF::HashMap<CustomElementDefinition*, OwnPtr<CustomElementBinding> > CustomElementBindingMap; 123 typedef WTF::HashMap<CustomElementDefinition*, OwnPtr<CustomElementBinding> > CustomElementBindingMap;
120 OwnPtr<CustomElementBindingMap> m_customElementBindings; 124 OwnPtr<CustomElementBindingMap> m_customElementBindings;
121 125
122 // This is owned by a static hash map in V8DOMActivityLogger. 126 // This is owned by a static hash map in V8DOMActivityLogger.
123 V8DOMActivityLogger* m_activityLogger; 127 V8DOMActivityLogger* m_activityLogger;
128
129 V8PersistentValueMap<String, v8::Value, false> m_compiledPrivateScript;
124 }; 130 };
125 131
126 class V8PerContextDebugData { 132 class V8PerContextDebugData {
127 public: 133 public:
128 static bool setContextDebugData(v8::Handle<v8::Context>, const char* worldNa me, int debugId); 134 static bool setContextDebugData(v8::Handle<v8::Context>, const char* worldNa me, int debugId);
129 static int contextDebugId(v8::Handle<v8::Context>); 135 static int contextDebugId(v8::Handle<v8::Context>);
130 }; 136 };
131 137
132 } // namespace WebCore 138 } // namespace WebCore
133 139
134 #endif // V8PerContextData_h 140 #endif // V8PerContextData_h
OLDNEW
« no previous file with comments | « Source/bindings/v8/V8EventListener.cpp ('k') | Source/bindings/v8/V8PerContextData.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698