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

Side by Side Diff: chrome/renderer/extensions/module_system.h

Issue 16032015: Extensions: pass ChromeV8Context around instead of v8::Handle. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 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
OLDNEW
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"
11 #include "chrome/renderer/extensions/native_handler.h"
11 #include "chrome/renderer/extensions/object_backed_native_handler.h" 12 #include "chrome/renderer/extensions/object_backed_native_handler.h"
12 #include "v8/include/v8.h" 13 #include "v8/include/v8.h"
13 14
14 #include <map> 15 #include <map>
15 #include <set> 16 #include <set>
16 #include <string> 17 #include <string>
17 #include <vector> 18 #include <vector>
18 19
19 namespace extensions { 20 namespace extensions {
20 21
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 public: 55 public:
55 explicit NativesEnabledScope(ModuleSystem* module_system); 56 explicit NativesEnabledScope(ModuleSystem* module_system);
56 ~NativesEnabledScope(); 57 ~NativesEnabledScope();
57 58
58 private: 59 private:
59 ModuleSystem* module_system_; 60 ModuleSystem* module_system_;
60 DISALLOW_COPY_AND_ASSIGN(NativesEnabledScope); 61 DISALLOW_COPY_AND_ASSIGN(NativesEnabledScope);
61 }; 62 };
62 63
63 // |source_map| is a weak pointer. 64 // |source_map| is a weak pointer.
64 ModuleSystem(v8::Handle<v8::Context> context, SourceMap* source_map); 65 ModuleSystem(ChromeV8Context* context, SourceMap* source_map);
65 virtual ~ModuleSystem(); 66 virtual ~ModuleSystem();
66 67
67 // Require the specified module. This is the equivalent of calling 68 // Require the specified module. This is the equivalent of calling
68 // require('module_name') from the loaded JS files. 69 // require('module_name') from the loaded JS files.
69 v8::Handle<v8::Value> Require(const std::string& module_name); 70 v8::Handle<v8::Value> Require(const std::string& module_name);
70 v8::Handle<v8::Value> Require(const v8::Arguments& args); 71 v8::Handle<v8::Value> Require(const v8::Arguments& args);
71 72
72 // Calls the specified method exported by the specified module. This is 73 // Calls the specified method exported by the specified module. This is
73 // equivalent to calling require('module_name').method_name() from JS. 74 // equivalent to calling require('module_name').method_name() from JS.
74 v8::Local<v8::Value> CallModuleMethod(const std::string& module_name, 75 v8::Local<v8::Value> CallModuleMethod(const std::string& module_name,
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 scoped_ptr<ExceptionHandler> exception_handler_; 194 scoped_ptr<ExceptionHandler> exception_handler_;
194 195
195 std::set<std::string> overridden_native_handlers_; 196 std::set<std::string> overridden_native_handlers_;
196 197
197 DISALLOW_COPY_AND_ASSIGN(ModuleSystem); 198 DISALLOW_COPY_AND_ASSIGN(ModuleSystem);
198 }; 199 };
199 200
200 } // extensions 201 } // extensions
201 202
202 #endif // CHROME_RENDERER_EXTENSIONS_MODULE_SYSTEM_H_ 203 #endif // CHROME_RENDERER_EXTENSIONS_MODULE_SYSTEM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698