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

Side by Side Diff: gin/modules/module_runner_delegate.h

Issue 90203002: [Mojo] Remove static "bootstrap" state in mojo_js (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: CHECK, CHECK, CHECK Created 7 years 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
« no previous file with comments | « gin/modules/module_registry.cc ('k') | gin/modules/module_runner_delegate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 GIN_MODULES_MODULE_RUNNER_DELEGATE_H_ 5 #ifndef GIN_MODULES_MODULE_RUNNER_DELEGATE_H_
6 #define GIN_MODULES_MODULE_RUNNER_DELEGATE_H_ 6 #define GIN_MODULES_MODULE_RUNNER_DELEGATE_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 14 matching lines...) Expand all
25 const std::vector<base::FilePath>& search_paths); 25 const std::vector<base::FilePath>& search_paths);
26 virtual ~ModuleRunnerDelegate(); 26 virtual ~ModuleRunnerDelegate();
27 27
28 // Lets you register a built-in module. Built-in modules are instantiated by 28 // Lets you register a built-in module. Built-in modules are instantiated by
29 // creating a new instance of a v8::ObjectTemplate rather than by executing 29 // creating a new instance of a v8::ObjectTemplate rather than by executing
30 // code. This function takes a ModuleTemplateGetter rather than a 30 // code. This function takes a ModuleTemplateGetter rather than a
31 // v8::ObjectTemplate directly so that embedders can create object templates 31 // v8::ObjectTemplate directly so that embedders can create object templates
32 // lazily. 32 // lazily.
33 void AddBuiltinModule(const std::string& id, ModuleTemplateGetter templ); 33 void AddBuiltinModule(const std::string& id, ModuleTemplateGetter templ);
34 34
35 protected:
36 void AttemptToLoadMoreModules(Runner* runner);
37
35 private: 38 private:
36 typedef std::map<std::string, ModuleTemplateGetter> BuiltinModuleMap; 39 typedef std::map<std::string, ModuleTemplateGetter> BuiltinModuleMap;
37 40
38 // From RunnerDelegate: 41 // From RunnerDelegate:
39 virtual v8::Handle<v8::ObjectTemplate> GetGlobalTemplate( 42 virtual v8::Handle<v8::ObjectTemplate> GetGlobalTemplate(
40 Runner* runner) OVERRIDE; 43 Runner* runner) OVERRIDE;
41 virtual void DidCreateContext(Runner* runner) OVERRIDE; 44 virtual void DidCreateContext(Runner* runner) OVERRIDE;
42 virtual void DidRunScript(Runner* runner) OVERRIDE; 45 virtual void DidRunScript(Runner* runner) OVERRIDE;
43 46
44 BuiltinModuleMap builtin_modules_; 47 BuiltinModuleMap builtin_modules_;
45 FileModuleProvider module_provider_; 48 FileModuleProvider module_provider_;
46 49
47 DISALLOW_COPY_AND_ASSIGN(ModuleRunnerDelegate); 50 DISALLOW_COPY_AND_ASSIGN(ModuleRunnerDelegate);
48 }; 51 };
49 52
50 } // namespace gin 53 } // namespace gin
51 54
52 #endif // GIN_MODULES_MODULE_RUNNER_DELEGATE_H_ 55 #endif // GIN_MODULES_MODULE_RUNNER_DELEGATE_H_
OLDNEW
« no previous file with comments | « gin/modules/module_registry.cc ('k') | gin/modules/module_runner_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698