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_SCRIPT_CONTEXT_H_ | 5 #ifndef EXTENSIONS_RENDERER_SCRIPT_CONTEXT_H_ |
6 #define EXTENSIONS_RENDERER_SCRIPT_CONTEXT_H_ | 6 #define EXTENSIONS_RENDERER_SCRIPT_CONTEXT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 } | 82 } |
83 | 83 |
84 blink::WebLocalFrame* web_frame() const { return web_frame_; } | 84 blink::WebLocalFrame* web_frame() const { return web_frame_; } |
85 | 85 |
86 Feature::Context context_type() const { return context_type_; } | 86 Feature::Context context_type() const { return context_type_; } |
87 | 87 |
88 Feature::Context effective_context_type() const { | 88 Feature::Context effective_context_type() const { |
89 return effective_context_type_; | 89 return effective_context_type_; |
90 } | 90 } |
91 | 91 |
92 void set_module_system(scoped_ptr<ModuleSystem> module_system) { | 92 void set_module_system(std::unique_ptr<ModuleSystem> module_system) { |
93 module_system_ = std::move(module_system); | 93 module_system_ = std::move(module_system); |
94 } | 94 } |
95 | 95 |
96 ModuleSystem* module_system() { return module_system_.get(); } | 96 ModuleSystem* module_system() { return module_system_.get(); } |
97 | 97 |
98 SafeBuiltins* safe_builtins() { return &safe_builtins_; } | 98 SafeBuiltins* safe_builtins() { return &safe_builtins_; } |
99 | 99 |
100 const SafeBuiltins* safe_builtins() const { return &safe_builtins_; } | 100 const SafeBuiltins* safe_builtins() const { return &safe_builtins_; } |
101 | 101 |
102 // Returns the ID of the extension associated with this context, or empty | 102 // Returns the ID of the extension associated with this context, or empty |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 | 224 |
225 // The effective extension associated with this context, or NULL if there is | 225 // The effective extension associated with this context, or NULL if there is |
226 // none. This is different from the above extension if this context is in an | 226 // none. This is different from the above extension if this context is in an |
227 // about:blank iframe for example. | 227 // about:blank iframe for example. |
228 scoped_refptr<const Extension> effective_extension_; | 228 scoped_refptr<const Extension> effective_extension_; |
229 | 229 |
230 // The type of context. | 230 // The type of context. |
231 Feature::Context effective_context_type_; | 231 Feature::Context effective_context_type_; |
232 | 232 |
233 // Owns and structures the JS that is injected to set up extension bindings. | 233 // Owns and structures the JS that is injected to set up extension bindings. |
234 scoped_ptr<ModuleSystem> module_system_; | 234 std::unique_ptr<ModuleSystem> module_system_; |
235 | 235 |
236 // Contains safe copies of builtin objects like Function.prototype. | 236 // Contains safe copies of builtin objects like Function.prototype. |
237 SafeBuiltins safe_builtins_; | 237 SafeBuiltins safe_builtins_; |
238 | 238 |
239 // The set of capabilities granted to this context by extensions. | 239 // The set of capabilities granted to this context by extensions. |
240 APIPermissionSet content_capabilities_; | 240 APIPermissionSet content_capabilities_; |
241 | 241 |
242 // A list of base::Closure instances as an observer interface for | 242 // A list of base::Closure instances as an observer interface for |
243 // invalidation. | 243 // invalidation. |
244 std::vector<base::Closure> invalidate_observers_; | 244 std::vector<base::Closure> invalidate_observers_; |
245 | 245 |
246 v8::Isolate* isolate_; | 246 v8::Isolate* isolate_; |
247 | 247 |
248 GURL url_; | 248 GURL url_; |
249 | 249 |
250 scoped_ptr<Runner> runner_; | 250 std::unique_ptr<Runner> runner_; |
251 | 251 |
252 base::ThreadChecker thread_checker_; | 252 base::ThreadChecker thread_checker_; |
253 | 253 |
254 DISALLOW_COPY_AND_ASSIGN(ScriptContext); | 254 DISALLOW_COPY_AND_ASSIGN(ScriptContext); |
255 }; | 255 }; |
256 | 256 |
257 } // namespace extensions | 257 } // namespace extensions |
258 | 258 |
259 #endif // EXTENSIONS_RENDERER_SCRIPT_CONTEXT_H_ | 259 #endif // EXTENSIONS_RENDERER_SCRIPT_CONTEXT_H_ |
OLD | NEW |