| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 public: | 53 public: |
| 54 explicit NativesEnabledScope(ModuleSystem* module_system); | 54 explicit NativesEnabledScope(ModuleSystem* module_system); |
| 55 ~NativesEnabledScope(); | 55 ~NativesEnabledScope(); |
| 56 | 56 |
| 57 private: | 57 private: |
| 58 ModuleSystem* module_system_; | 58 ModuleSystem* module_system_; |
| 59 DISALLOW_COPY_AND_ASSIGN(NativesEnabledScope); | 59 DISALLOW_COPY_AND_ASSIGN(NativesEnabledScope); |
| 60 }; | 60 }; |
| 61 | 61 |
| 62 // |source_map| is a weak pointer. | 62 // |source_map| is a weak pointer. |
| 63 explicit ModuleSystem(v8::Handle<v8::Context> context, SourceMap* source_map); | 63 ModuleSystem(v8::Handle<v8::Context> context, SourceMap* source_map); |
| 64 virtual ~ModuleSystem(); | 64 virtual ~ModuleSystem(); |
| 65 | 65 |
| 66 // Returns true if the current context has a ModuleSystem installed in it. | 66 // Returns true if the current context has a ModuleSystem installed in it. |
| 67 static bool IsPresentInCurrentContext(); | 67 static bool IsPresentInCurrentContext(); |
| 68 | 68 |
| 69 // Dumps the debug info from |try_catch| to LOG(ERROR). | 69 // Dumps the debug info from |try_catch| to LOG(ERROR). |
| 70 static void DumpException(const v8::TryCatch& try_catch); | 70 static void DumpException(const v8::TryCatch& try_catch); |
| 71 | 71 |
| 72 // Require the specified module. This is the equivalent of calling | 72 // Require the specified module. This is the equivalent of calling |
| 73 // require('module_name') from the loaded JS files. | 73 // require('module_name') from the loaded JS files. |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 scoped_ptr<ExceptionHandler> exception_handler_; | 157 scoped_ptr<ExceptionHandler> exception_handler_; |
| 158 | 158 |
| 159 std::set<std::string> overridden_native_handlers_; | 159 std::set<std::string> overridden_native_handlers_; |
| 160 | 160 |
| 161 DISALLOW_COPY_AND_ASSIGN(ModuleSystem); | 161 DISALLOW_COPY_AND_ASSIGN(ModuleSystem); |
| 162 }; | 162 }; |
| 163 | 163 |
| 164 } // extensions | 164 } // extensions |
| 165 | 165 |
| 166 #endif // CHROME_RENDERER_EXTENSIONS_MODULE_SYSTEM_H_ | 166 #endif // CHROME_RENDERER_EXTENSIONS_MODULE_SYSTEM_H_ |
| OLD | NEW |