| 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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 | 158 |
| 159 // Ensure that require_ has been evaluated from require.js. | 159 // Ensure that require_ has been evaluated from require.js. |
| 160 void EnsureRequireLoaded(); | 160 void EnsureRequireLoaded(); |
| 161 | 161 |
| 162 // Run |code| in the current context with the name |name| used for stack | 162 // Run |code| in the current context with the name |name| used for stack |
| 163 // traces. | 163 // traces. |
| 164 v8::Handle<v8::Value> RunString(v8::Handle<v8::String> code, | 164 v8::Handle<v8::Value> RunString(v8::Handle<v8::String> code, |
| 165 v8::Handle<v8::String> name); | 165 v8::Handle<v8::String> name); |
| 166 | 166 |
| 167 void RequireForJs(const v8::FunctionCallbackInfo<v8::Value>& args); | 167 void RequireForJs(const v8::FunctionCallbackInfo<v8::Value>& args); |
| 168 v8::Handle<v8::Value> RequireForJsInner(v8::Handle<v8::String> module_name); | 168 v8::Local<v8::Value> RequireForJsInner(v8::Handle<v8::String> module_name); |
| 169 | 169 |
| 170 typedef v8::Handle<v8::Value> (ModuleSystem::*RequireFunction)( | 170 typedef v8::Handle<v8::Value> (ModuleSystem::*RequireFunction)( |
| 171 const std::string&); | 171 const std::string&); |
| 172 // Base implementation of a LazyFieldGetter which uses |require_fn| to require | 172 // Base implementation of a LazyFieldGetter which uses |require_fn| to require |
| 173 // modules. | 173 // modules. |
| 174 static void LazyFieldGetterInner( | 174 static void LazyFieldGetterInner( |
| 175 v8::Local<v8::String> property, | 175 v8::Local<v8::String> property, |
| 176 const v8::PropertyCallbackInfo<v8::Value>& info, | 176 const v8::PropertyCallbackInfo<v8::Value>& info, |
| 177 RequireFunction require_function); | 177 RequireFunction require_function); |
| 178 | 178 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 207 scoped_ptr<ExceptionHandler> exception_handler_; | 207 scoped_ptr<ExceptionHandler> exception_handler_; |
| 208 | 208 |
| 209 std::set<std::string> overridden_native_handlers_; | 209 std::set<std::string> overridden_native_handlers_; |
| 210 | 210 |
| 211 DISALLOW_COPY_AND_ASSIGN(ModuleSystem); | 211 DISALLOW_COPY_AND_ASSIGN(ModuleSystem); |
| 212 }; | 212 }; |
| 213 | 213 |
| 214 } // namespace extensions | 214 } // namespace extensions |
| 215 | 215 |
| 216 #endif // CHROME_RENDERER_EXTENSIONS_MODULE_SYSTEM_H_ | 216 #endif // CHROME_RENDERER_EXTENSIONS_MODULE_SYSTEM_H_ |
| OLD | NEW |