OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROME_RENDERER_EXTENSIONS_MODULE_SYSTEM_H_ | 5 #ifndef CHROME_RENDERER_EXTENSIONS_MODULE_SYSTEM_H_ |
6 #define CHROME_RENDERER_EXTENSIONS_MODULE_SYSTEM_H_ | 6 #define CHROME_RENDERER_EXTENSIONS_MODULE_SYSTEM_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/memory/linked_ptr.h" | 9 #include "base/memory/linked_ptr.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 void SetNativeLazyField(v8::Handle<v8::Object> object, | 127 void SetNativeLazyField(v8::Handle<v8::Object> object, |
128 const std::string& field, | 128 const std::string& field, |
129 const std::string& module_name, | 129 const std::string& module_name, |
130 const std::string& module_field); | 130 const std::string& module_field); |
131 | 131 |
132 // Passes exceptions to |handler| rather than console::Fatal. | 132 // Passes exceptions to |handler| rather than console::Fatal. |
133 void SetExceptionHandlerForTest(scoped_ptr<ExceptionHandler> handler) { | 133 void SetExceptionHandlerForTest(scoped_ptr<ExceptionHandler> handler) { |
134 exception_handler_ = handler.Pass(); | 134 exception_handler_ = handler.Pass(); |
135 } | 135 } |
136 | 136 |
| 137 v8::Isolate* GetIsolate() const; |
| 138 |
137 protected: | 139 protected: |
138 friend class ChromeV8Context; | 140 friend class ChromeV8Context; |
139 virtual void Invalidate() OVERRIDE; | 141 virtual void Invalidate() OVERRIDE; |
140 | 142 |
141 private: | 143 private: |
142 typedef std::map<std::string, linked_ptr<NativeHandler> > NativeHandlerMap; | 144 typedef std::map<std::string, linked_ptr<NativeHandler> > NativeHandlerMap; |
143 | 145 |
144 // Retrieves the lazily defined field specified by |property|. | 146 // Retrieves the lazily defined field specified by |property|. |
145 static void LazyFieldGetter(v8::Local<v8::String> property, | 147 static void LazyFieldGetter(v8::Local<v8::String> property, |
146 const v8::PropertyCallbackInfo<v8::Value>& info); | 148 const v8::PropertyCallbackInfo<v8::Value>& info); |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 scoped_ptr<ExceptionHandler> exception_handler_; | 206 scoped_ptr<ExceptionHandler> exception_handler_; |
205 | 207 |
206 std::set<std::string> overridden_native_handlers_; | 208 std::set<std::string> overridden_native_handlers_; |
207 | 209 |
208 DISALLOW_COPY_AND_ASSIGN(ModuleSystem); | 210 DISALLOW_COPY_AND_ASSIGN(ModuleSystem); |
209 }; | 211 }; |
210 | 212 |
211 } // namespace extensions | 213 } // namespace extensions |
212 | 214 |
213 #endif // CHROME_RENDERER_EXTENSIONS_MODULE_SYSTEM_H_ | 215 #endif // CHROME_RENDERER_EXTENSIONS_MODULE_SYSTEM_H_ |
OLD | NEW |