| OLD | NEW |
| 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 EXTENSIONS_RENDERER_MODULE_SYSTEM_H_ | 5 #ifndef EXTENSIONS_RENDERER_MODULE_SYSTEM_H_ |
| 6 #define EXTENSIONS_RENDERER_MODULE_SYSTEM_H_ | 6 #define EXTENSIONS_RENDERER_MODULE_SYSTEM_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 const std::string& field, | 135 const std::string& field, |
| 136 const std::string& module_name, | 136 const std::string& module_name, |
| 137 const std::string& module_field); | 137 const std::string& module_field); |
| 138 | 138 |
| 139 // Passes exceptions to |handler| rather than console::Fatal. | 139 // Passes exceptions to |handler| rather than console::Fatal. |
| 140 void SetExceptionHandlerForTest(scoped_ptr<ExceptionHandler> handler) { | 140 void SetExceptionHandlerForTest(scoped_ptr<ExceptionHandler> handler) { |
| 141 exception_handler_ = handler.Pass(); | 141 exception_handler_ = handler.Pass(); |
| 142 } | 142 } |
| 143 | 143 |
| 144 protected: | 144 protected: |
| 145 friend class ModuleSystemTest; |
| 145 friend class ScriptContext; | 146 friend class ScriptContext; |
| 146 void Invalidate() override; | 147 void Invalidate() override; |
| 147 | 148 |
| 148 private: | 149 private: |
| 149 typedef std::map<std::string, linked_ptr<NativeHandler> > NativeHandlerMap; | 150 typedef std::map<std::string, linked_ptr<NativeHandler> > NativeHandlerMap; |
| 150 | 151 |
| 151 // Retrieves the lazily defined field specified by |property|. | 152 // Retrieves the lazily defined field specified by |property|. |
| 152 static void LazyFieldGetter(v8::Local<v8::String> property, | 153 static void LazyFieldGetter(v8::Local<v8::String> property, |
| 153 const v8::PropertyCallbackInfo<v8::Value>& info); | 154 const v8::PropertyCallbackInfo<v8::Value>& info); |
| 154 // Retrieves the lazily defined field specified by |property| on a native | 155 // Retrieves the lazily defined field specified by |property| on a native |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 std::set<std::string> overridden_native_handlers_; | 226 std::set<std::string> overridden_native_handlers_; |
| 226 | 227 |
| 227 base::WeakPtrFactory<ModuleSystem> weak_factory_; | 228 base::WeakPtrFactory<ModuleSystem> weak_factory_; |
| 228 | 229 |
| 229 DISALLOW_COPY_AND_ASSIGN(ModuleSystem); | 230 DISALLOW_COPY_AND_ASSIGN(ModuleSystem); |
| 230 }; | 231 }; |
| 231 | 232 |
| 232 } // namespace extensions | 233 } // namespace extensions |
| 233 | 234 |
| 234 #endif // EXTENSIONS_RENDERER_MODULE_SYSTEM_H_ | 235 #endif // EXTENSIONS_RENDERER_MODULE_SYSTEM_H_ |
| OLD | NEW |