[email protected] | f55c90ee6 | 2014-04-12 00:50:03 | [diff] [blame] | 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 |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef EXTENSIONS_RENDERER_SCRIPT_CONTEXT_H_ |
| 6 | #define EXTENSIONS_RENDERER_SCRIPT_CONTEXT_H_ |
| 7 | |
asargent | 79b64c3 | 2016-08-04 17:17:14 | [diff] [blame] | 8 | #include <memory> |
[email protected] | f55c90ee6 | 2014-04-12 00:50:03 | [diff] [blame] | 9 | #include <string> |
dcheng | e59eca160 | 2015-12-18 17:48:00 | [diff] [blame] | 10 | #include <utility> |
kalman | b0c1c50 | 2015-04-15 00:25:06 | [diff] [blame] | 11 | #include <vector> |
[email protected] | f55c90ee6 | 2014-04-12 00:50:03 | [diff] [blame] | 12 | |
kalman | b0c1c50 | 2015-04-15 00:25:06 | [diff] [blame] | 13 | #include "base/callback.h" |
[email protected] | f55c90ee6 | 2014-04-12 00:50:03 | [diff] [blame] | 14 | #include "base/compiler_specific.h" |
avi | 2d124c0 | 2015-12-23 06:36:42 | [diff] [blame] | 15 | #include "base/macros.h" |
kalman | 0475530 | 2015-09-14 18:52:11 | [diff] [blame] | 16 | #include "base/threading/thread_checker.h" |
Devlin Cronin | fe480ed | 2017-09-15 20:51:11 | [diff] [blame^] | 17 | #include "base/unguessable_token.h" |
[email protected] | f55c90ee6 | 2014-04-12 00:50:03 | [diff] [blame] | 18 | #include "extensions/common/features/feature.h" |
rockot | e261b16 | 2014-12-12 01:59:47 | [diff] [blame] | 19 | #include "extensions/common/permissions/api_permission_set.h" |
[email protected] | f55c90ee6 | 2014-04-12 00:50:03 | [diff] [blame] | 20 | #include "extensions/renderer/module_system.h" |
| 21 | #include "extensions/renderer/request_sender.h" |
kalman | 33076cb | 2015-08-11 19:12:07 | [diff] [blame] | 22 | #include "extensions/renderer/safe_builtins.h" |
rdevlin.cronin | 0d94256f | 2016-12-09 15:34:23 | [diff] [blame] | 23 | #include "extensions/renderer/script_injection_callback.h" |
[email protected] | d9f51dad | 2014-07-09 05:39:38 | [diff] [blame] | 24 | #include "gin/runner.h" |
Sadrul Habib Chowdhury | 0d7ef9f | 2014-12-03 20:07:30 | [diff] [blame] | 25 | #include "url/gurl.h" |
[email protected] | f55c90ee6 | 2014-04-12 00:50:03 | [diff] [blame] | 26 | #include "v8/include/v8.h" |
| 27 | |
| 28 | namespace blink { |
kalman | f91cb89 | 2015-04-15 19:20:48 | [diff] [blame] | 29 | class WebLocalFrame; |
[email protected] | f55c90ee6 | 2014-04-12 00:50:03 | [diff] [blame] | 30 | } |
| 31 | |
| 32 | namespace content { |
[email protected] | 2101c4c | 2014-08-22 00:16:16 | [diff] [blame] | 33 | class RenderFrame; |
[email protected] | f55c90ee6 | 2014-04-12 00:50:03 | [diff] [blame] | 34 | } |
| 35 | |
| 36 | namespace extensions { |
tbarzic | feb4b05 | 2016-11-29 18:23:09 | [diff] [blame] | 37 | enum class CheckAliasStatus; |
[email protected] | f55c90ee6 | 2014-04-12 00:50:03 | [diff] [blame] | 38 | class Extension; |
| 39 | |
kalman | 0475530 | 2015-09-14 18:52:11 | [diff] [blame] | 40 | // Extensions wrapper for a v8::Context. |
| 41 | // |
| 42 | // v8::Contexts can be constructed on any thread, and must only be accessed or |
| 43 | // destroyed that thread. |
| 44 | // |
| 45 | // Note that ScriptContexts bound to worker threads will not have the full |
| 46 | // functionality as those bound to the main RenderThread. |
sammc | de54a47e | 2015-01-13 23:16:34 | [diff] [blame] | 47 | class ScriptContext : public RequestSender::Source { |
[email protected] | f55c90ee6 | 2014-04-12 00:50:03 | [diff] [blame] | 48 | public: |
annekao | 53348222 | 2015-08-21 23:23:53 | [diff] [blame] | 49 | using RunScriptExceptionHandler = base::Callback<void(const v8::TryCatch&)>; |
| 50 | |
tfarina | f85316f | 2015-04-29 17:03:40 | [diff] [blame] | 51 | ScriptContext(const v8::Local<v8::Context>& context, |
kalman | f91cb89 | 2015-04-15 19:20:48 | [diff] [blame] | 52 | blink::WebLocalFrame* frame, |
[email protected] | f55c90ee6 | 2014-04-12 00:50:03 | [diff] [blame] | 53 | const Extension* extension, |
mek | 7e1d745 | 2014-09-08 23:55:57 | [diff] [blame] | 54 | Feature::Context context_type, |
| 55 | const Extension* effective_extension, |
| 56 | Feature::Context effective_context_type); |
dcheng | 9168b2f | 2014-10-21 12:38:24 | [diff] [blame] | 57 | ~ScriptContext() override; |
[email protected] | f55c90ee6 | 2014-04-12 00:50:03 | [diff] [blame] | 58 | |
kalman | c81508d | 2015-04-23 17:14:02 | [diff] [blame] | 59 | // Returns whether |url| from any Extension in |extension_set| is sandboxed, |
| 60 | // as declared in each Extension's manifest. |
| 61 | // TODO(kalman): Delete this when crbug.com/466373 is fixed. |
| 62 | // See comment in HasAccessOrThrowError. |
annekao | 6572d5c | 2015-08-19 16:13:36 | [diff] [blame] | 63 | static bool IsSandboxedPage(const GURL& url); |
kalman | f91cb89 | 2015-04-15 19:20:48 | [diff] [blame] | 64 | |
Daniel Cheng | 971cd452 | 2017-05-31 21:58:22 | [diff] [blame] | 65 | // Clears the WebLocalFrame for this contexts and invalidates the associated |
[email protected] | f55c90ee6 | 2014-04-12 00:50:03 | [diff] [blame] | 66 | // ModuleSystem. |
| 67 | void Invalidate(); |
| 68 | |
kalman | b0c1c50 | 2015-04-15 00:25:06 | [diff] [blame] | 69 | // Registers |observer| to be run when this context is invalidated. Closures |
| 70 | // are run immediately when Invalidate() is called, not in a message loop. |
| 71 | void AddInvalidationObserver(const base::Closure& observer); |
| 72 | |
[email protected] | f55c90ee6 | 2014-04-12 00:50:03 | [diff] [blame] | 73 | // Returns true if this context is still valid, false if it isn't. |
| 74 | // A context becomes invalid via Invalidate(). |
kalman | b0c1c50 | 2015-04-15 00:25:06 | [diff] [blame] | 75 | bool is_valid() const { return is_valid_; } |
[email protected] | f55c90ee6 | 2014-04-12 00:50:03 | [diff] [blame] | 76 | |
tfarina | f85316f | 2015-04-29 17:03:40 | [diff] [blame] | 77 | v8::Local<v8::Context> v8_context() const { |
kalman | 078a219 | 2015-03-09 18:19:39 | [diff] [blame] | 78 | return v8::Local<v8::Context>::New(isolate_, v8_context_); |
[email protected] | f55c90ee6 | 2014-04-12 00:50:03 | [diff] [blame] | 79 | } |
| 80 | |
| 81 | const Extension* extension() const { return extension_.get(); } |
| 82 | |
mek | 7e1d745 | 2014-09-08 23:55:57 | [diff] [blame] | 83 | const Extension* effective_extension() const { |
| 84 | return effective_extension_.get(); |
| 85 | } |
| 86 | |
kalman | f91cb89 | 2015-04-15 19:20:48 | [diff] [blame] | 87 | blink::WebLocalFrame* web_frame() const { return web_frame_; } |
[email protected] | f55c90ee6 | 2014-04-12 00:50:03 | [diff] [blame] | 88 | |
| 89 | Feature::Context context_type() const { return context_type_; } |
| 90 | |
mek | 7e1d745 | 2014-09-08 23:55:57 | [diff] [blame] | 91 | Feature::Context effective_context_type() const { |
| 92 | return effective_context_type_; |
| 93 | } |
| 94 | |
Devlin Cronin | fe480ed | 2017-09-15 20:51:11 | [diff] [blame^] | 95 | const base::UnguessableToken& context_id() const { return context_id_; } |
| 96 | |
dcheng | f6f8066 | 2016-04-20 20:26:04 | [diff] [blame] | 97 | void set_module_system(std::unique_ptr<ModuleSystem> module_system) { |
dcheng | e59eca160 | 2015-12-18 17:48:00 | [diff] [blame] | 98 | module_system_ = std::move(module_system); |
[email protected] | f55c90ee6 | 2014-04-12 00:50:03 | [diff] [blame] | 99 | } |
| 100 | |
| 101 | ModuleSystem* module_system() { return module_system_.get(); } |
| 102 | |
kalman | 33076cb | 2015-08-11 19:12:07 | [diff] [blame] | 103 | SafeBuiltins* safe_builtins() { return &safe_builtins_; } |
[email protected] | f55c90ee6 | 2014-04-12 00:50:03 | [diff] [blame] | 104 | |
kalman | 33076cb | 2015-08-11 19:12:07 | [diff] [blame] | 105 | const SafeBuiltins* safe_builtins() const { return &safe_builtins_; } |
[email protected] | f55c90ee6 | 2014-04-12 00:50:03 | [diff] [blame] | 106 | |
| 107 | // Returns the ID of the extension associated with this context, or empty |
| 108 | // string if there is no such extension. |
[email protected] | 800f987 | 2014-06-12 04:12:51 | [diff] [blame] | 109 | const std::string& GetExtensionID() const; |
[email protected] | f55c90ee6 | 2014-04-12 00:50:03 | [diff] [blame] | 110 | |
[email protected] | 2101c4c | 2014-08-22 00:16:16 | [diff] [blame] | 111 | // Returns the RenderFrame associated with this context. Can return NULL if |
| 112 | // the context is in the process of being destroyed. |
| 113 | content::RenderFrame* GetRenderFrame() const; |
| 114 | |
rdevlin.cronin | a9bc8cc | 2016-10-06 15:51:17 | [diff] [blame] | 115 | // Safely calls the v8::Function, respecting the page load deferrer and |
| 116 | // possibly executing asynchronously. |
rdevlin.cronin | 12a457eb | 2016-10-25 20:39:58 | [diff] [blame] | 117 | // Doesn't catch exceptions; callers must do that if they want. |
rdevlin.cronin | 0d94256f | 2016-12-09 15:34:23 | [diff] [blame] | 118 | // USE THESE METHODS RATHER THAN v8::Function::Call WHEREVER POSSIBLE. |
rdevlin.cronin | a9bc8cc | 2016-10-06 15:51:17 | [diff] [blame] | 119 | void SafeCallFunction(const v8::Local<v8::Function>& function, |
| 120 | int argc, |
| 121 | v8::Local<v8::Value> argv[]); |
rdevlin.cronin | 0d94256f | 2016-12-09 15:34:23 | [diff] [blame] | 122 | void SafeCallFunction( |
| 123 | const v8::Local<v8::Function>& function, |
| 124 | int argc, |
| 125 | v8::Local<v8::Value> argv[], |
| 126 | const ScriptInjectionCallback::CompleteCallback& callback); |
rdevlin.cronin | a9bc8cc | 2016-10-06 15:51:17 | [diff] [blame] | 127 | |
[email protected] | f55c90ee6 | 2014-04-12 00:50:03 | [diff] [blame] | 128 | // Returns the availability of the API |api_name|. |
| 129 | Feature::Availability GetAvailability(const std::string& api_name); |
tbarzic | feb4b05 | 2016-11-29 18:23:09 | [diff] [blame] | 130 | // Returns the availability of the API |api_name|. |
| 131 | // |check_alias| Whether API that has an alias that is available should be |
| 132 | // considered available (even if the API itself is not available). |
| 133 | Feature::Availability GetAvailability(const std::string& api_name, |
| 134 | CheckAliasStatus check_alias); |
[email protected] | f55c90ee6 | 2014-04-12 00:50:03 | [diff] [blame] | 135 | |
| 136 | // Returns a string description of the type of context this is. |
kalman | 8bcbc759 | 2015-06-03 23:12:27 | [diff] [blame] | 137 | std::string GetContextTypeDescription() const; |
[email protected] | f55c90ee6 | 2014-04-12 00:50:03 | [diff] [blame] | 138 | |
mek | 7e1d745 | 2014-09-08 23:55:57 | [diff] [blame] | 139 | // Returns a string description of the effective type of context this is. |
kalman | 8bcbc759 | 2015-06-03 23:12:27 | [diff] [blame] | 140 | std::string GetEffectiveContextTypeDescription() const; |
mek | 7e1d745 | 2014-09-08 23:55:57 | [diff] [blame] | 141 | |
[email protected] | f55c90ee6 | 2014-04-12 00:50:03 | [diff] [blame] | 142 | v8::Isolate* isolate() const { return isolate_; } |
| 143 | |
| 144 | // Get the URL of this context's web frame. |
kalman | f91cb89 | 2015-04-15 19:20:48 | [diff] [blame] | 145 | // |
| 146 | // TODO(kalman): Remove this and replace with a GetOrigin() call which reads |
Dana Jansens | 7133125 | 2016-03-09 20:57:22 | [diff] [blame] | 147 | // of WebDocument::getSecurityOrigin(): |
kalman | f91cb89 | 2015-04-15 19:20:48 | [diff] [blame] | 148 | // - The URL can change (e.g. pushState) but the origin cannot. Luckily it |
| 149 | // appears as though callers don't make security decisions based on the |
kalman | 0475530 | 2015-09-14 18:52:11 | [diff] [blame] | 150 | // result of url() so it's not a problem... yet. |
kalman | f91cb89 | 2015-04-15 19:20:48 | [diff] [blame] | 151 | // - Origin is the correct check to be making. |
| 152 | // - It might let us remove the about:blank resolving? |
kalman | 0475530 | 2015-09-14 18:52:11 | [diff] [blame] | 153 | const GURL& url() const { return url_; } |
| 154 | |
lazyboy | 63b994a | 2017-06-30 21:20:23 | [diff] [blame] | 155 | const GURL& service_worker_scope() const; |
| 156 | |
kalman | 0475530 | 2015-09-14 18:52:11 | [diff] [blame] | 157 | // Sets the URL of this ScriptContext. Usually this will automatically be set |
| 158 | // on construction, unless this isn't constructed with enough information to |
| 159 | // determine the URL (e.g. frame was null). |
| 160 | // TODO(kalman): Make this a constructor parameter (as an origin). |
| 161 | void set_url(const GURL& url) { url_ = url; } |
lazyboy | 63b994a | 2017-06-30 21:20:23 | [diff] [blame] | 162 | void set_service_worker_scope(const GURL& scope) { |
| 163 | service_worker_scope_ = scope; |
| 164 | } |
[email protected] | f55c90ee6 | 2014-04-12 00:50:03 | [diff] [blame] | 165 | |
tbarzic | feb4b05 | 2016-11-29 18:23:09 | [diff] [blame] | 166 | // Returns whether the API |api| or any part of the API could be available in |
| 167 | // this context without taking into account the context's extension. |
| 168 | // |check_alias| Whether the API should be considered available if it has an |
| 169 | // alias that is available. |
| 170 | bool IsAnyFeatureAvailableToContext(const extensions::Feature& api, |
| 171 | CheckAliasStatus check_alias); |
[email protected] | f55c90ee6 | 2014-04-12 00:50:03 | [diff] [blame] | 172 | |
| 173 | // Utility to get the URL we will match against for a frame. If the frame has |
| 174 | // committed, this is the commited URL. Otherwise it is the provisional URL. |
[email protected] | c1abb323 | 2014-07-30 18:28:39 | [diff] [blame] | 175 | // The returned URL may be invalid. |
Takeshi Yoshino | 41b671a | 2017-08-01 12:17:51 | [diff] [blame] | 176 | static GURL GetDocumentLoaderURLForFrame(const blink::WebLocalFrame* frame); |
[email protected] | f55c90ee6 | 2014-04-12 00:50:03 | [diff] [blame] | 177 | |
Takeshi Yoshino | 41b671a | 2017-08-01 12:17:51 | [diff] [blame] | 178 | // Similar to GetDocumentLoaderURLForFrame, but only returns the data source |
| 179 | // URL if the frame's document url is empty and the frame has a security |
| 180 | // origin that allows access to the data source url. |
asargent | 79b64c3 | 2016-08-04 17:17:14 | [diff] [blame] | 181 | // TODO(asargent/devlin) - there may be places that should switch to using |
Takeshi Yoshino | 41b671a | 2017-08-01 12:17:51 | [diff] [blame] | 182 | // this instead of GetDocumentLoaderURLForFrame. |
Daniel Cheng | 971cd452 | 2017-05-31 21:58:22 | [diff] [blame] | 183 | static GURL GetAccessCheckedFrameURL(const blink::WebLocalFrame* frame); |
asargent | 79b64c3 | 2016-08-04 17:17:14 | [diff] [blame] | 184 | |
[email protected] | ae26b28 | 2014-05-15 16:40:16 | [diff] [blame] | 185 | // Returns the first non-about:-URL in the document hierarchy above and |
| 186 | // including |frame|. The document hierarchy is only traversed if |
| 187 | // |document_url| is an about:-URL and if |match_about_blank| is true. |
lukasza | bedb4b2 | 2017-06-23 00:00:13 | [diff] [blame] | 188 | static GURL GetEffectiveDocumentURL(blink::WebLocalFrame* frame, |
[email protected] | ae26b28 | 2014-05-15 16:40:16 | [diff] [blame] | 189 | const GURL& document_url, |
| 190 | bool match_about_blank); |
| 191 | |
[email protected] | f55c90ee6 | 2014-04-12 00:50:03 | [diff] [blame] | 192 | // RequestSender::Source implementation. |
dcheng | 9168b2f | 2014-10-21 12:38:24 | [diff] [blame] | 193 | ScriptContext* GetContext() override; |
| 194 | void OnResponseReceived(const std::string& name, |
| 195 | int request_id, |
| 196 | bool success, |
| 197 | const base::ListValue& response, |
| 198 | const std::string& error) override; |
[email protected] | f55c90ee6 | 2014-04-12 00:50:03 | [diff] [blame] | 199 | |
rockot | e261b16 | 2014-12-12 01:59:47 | [diff] [blame] | 200 | // Grants a set of content capabilities to this context. |
kalman | 0475530 | 2015-09-14 18:52:11 | [diff] [blame] | 201 | void set_content_capabilities(const APIPermissionSet& capabilities) { |
| 202 | content_capabilities_ = capabilities; |
| 203 | } |
rockot | e261b16 | 2014-12-12 01:59:47 | [diff] [blame] | 204 | |
| 205 | // Indicates if this context has an effective API permission either by being |
| 206 | // a context for an extension which has that permission, or by being a web |
| 207 | // context which has been granted the corresponding capability by an |
| 208 | // extension. |
| 209 | bool HasAPIPermission(APIPermission::ID permission) const; |
| 210 | |
kalman | c81508d | 2015-04-23 17:14:02 | [diff] [blame] | 211 | // Throws an Error in this context's JavaScript context, if this context does |
| 212 | // not have access to |name|. Returns true if this context has access (i.e. |
| 213 | // no exception thrown), false if it does not (i.e. an exception was thrown). |
| 214 | bool HasAccessOrThrowError(const std::string& name); |
| 215 | |
kalman | 8bcbc759 | 2015-06-03 23:12:27 | [diff] [blame] | 216 | // Returns a string representation of this ScriptContext, for debugging. |
| 217 | std::string GetDebugString() const; |
| 218 | |
dmazzoni | d6848287c | 2015-07-27 23:41:31 | [diff] [blame] | 219 | // Gets the current stack trace as a multi-line string to be logged. |
| 220 | std::string GetStackTraceAsString() const; |
| 221 | |
annekao | 53348222 | 2015-08-21 23:23:53 | [diff] [blame] | 222 | // Runs |code|, labelling the script that gets created as |name| (the name is |
| 223 | // used in the devtools and stack traces). |exception_handler| will be called |
| 224 | // re-entrantly if an exception is thrown during the script's execution. |
| 225 | v8::Local<v8::Value> RunScript( |
| 226 | v8::Local<v8::String> name, |
| 227 | v8::Local<v8::String> code, |
| 228 | const RunScriptExceptionHandler& exception_handler); |
| 229 | |
mlamouri | 60a2857d | 2015-04-14 15:22:36 | [diff] [blame] | 230 | private: |
rdevlin.cronin | cf5482bd | 2017-06-14 13:18:18 | [diff] [blame] | 231 | // DEPRECATED. |
| 232 | v8::Local<v8::Value> CallFunction(const v8::Local<v8::Function>& function, |
| 233 | int argc, |
| 234 | v8::Local<v8::Value> argv[]) const; |
| 235 | |
mlamouri | 60a2857d | 2015-04-14 15:22:36 | [diff] [blame] | 236 | class Runner; |
| 237 | |
kalman | b0c1c50 | 2015-04-15 00:25:06 | [diff] [blame] | 238 | // Whether this context is valid. |
| 239 | bool is_valid_; |
| 240 | |
| 241 | // The v8 context the bindings are accessible to. |
| 242 | v8::Global<v8::Context> v8_context_; |
| 243 | |
kalman | f91cb89 | 2015-04-15 19:20:48 | [diff] [blame] | 244 | // The WebLocalFrame associated with this context. This can be NULL because |
| 245 | // this object can outlive is destroyed asynchronously. |
| 246 | blink::WebLocalFrame* web_frame_; |
[email protected] | f55c90ee6 | 2014-04-12 00:50:03 | [diff] [blame] | 247 | |
| 248 | // The extension associated with this context, or NULL if there is none. This |
| 249 | // might be a hosted app in the case that this context is hosting a web URL. |
| 250 | scoped_refptr<const Extension> extension_; |
| 251 | |
| 252 | // The type of context. |
| 253 | Feature::Context context_type_; |
| 254 | |
mek | 7e1d745 | 2014-09-08 23:55:57 | [diff] [blame] | 255 | // The effective extension associated with this context, or NULL if there is |
| 256 | // none. This is different from the above extension if this context is in an |
| 257 | // about:blank iframe for example. |
| 258 | scoped_refptr<const Extension> effective_extension_; |
| 259 | |
| 260 | // The type of context. |
| 261 | Feature::Context effective_context_type_; |
| 262 | |
Devlin Cronin | fe480ed | 2017-09-15 20:51:11 | [diff] [blame^] | 263 | // A globally-unique ID for the script context. |
| 264 | base::UnguessableToken context_id_; |
| 265 | |
[email protected] | f55c90ee6 | 2014-04-12 00:50:03 | [diff] [blame] | 266 | // Owns and structures the JS that is injected to set up extension bindings. |
dcheng | f6f8066 | 2016-04-20 20:26:04 | [diff] [blame] | 267 | std::unique_ptr<ModuleSystem> module_system_; |
[email protected] | f55c90ee6 | 2014-04-12 00:50:03 | [diff] [blame] | 268 | |
| 269 | // Contains safe copies of builtin objects like Function.prototype. |
kalman | 33076cb | 2015-08-11 19:12:07 | [diff] [blame] | 270 | SafeBuiltins safe_builtins_; |
[email protected] | f55c90ee6 | 2014-04-12 00:50:03 | [diff] [blame] | 271 | |
rockot | e261b16 | 2014-12-12 01:59:47 | [diff] [blame] | 272 | // The set of capabilities granted to this context by extensions. |
| 273 | APIPermissionSet content_capabilities_; |
| 274 | |
kalman | b0c1c50 | 2015-04-15 00:25:06 | [diff] [blame] | 275 | // A list of base::Closure instances as an observer interface for |
| 276 | // invalidation. |
| 277 | std::vector<base::Closure> invalidate_observers_; |
| 278 | |
[email protected] | f55c90ee6 | 2014-04-12 00:50:03 | [diff] [blame] | 279 | v8::Isolate* isolate_; |
| 280 | |
Sadrul Habib Chowdhury | 0d7ef9f | 2014-12-03 20:07:30 | [diff] [blame] | 281 | GURL url_; |
| 282 | |
lazyboy | 63b994a | 2017-06-30 21:20:23 | [diff] [blame] | 283 | GURL service_worker_scope_; |
| 284 | |
dcheng | f6f8066 | 2016-04-20 20:26:04 | [diff] [blame] | 285 | std::unique_ptr<Runner> runner_; |
sammc | de54a47e | 2015-01-13 23:16:34 | [diff] [blame] | 286 | |
kalman | 0475530 | 2015-09-14 18:52:11 | [diff] [blame] | 287 | base::ThreadChecker thread_checker_; |
| 288 | |
[email protected] | f55c90ee6 | 2014-04-12 00:50:03 | [diff] [blame] | 289 | DISALLOW_COPY_AND_ASSIGN(ScriptContext); |
| 290 | }; |
| 291 | |
| 292 | } // namespace extensions |
| 293 | |
| 294 | #endif // EXTENSIONS_RENDERER_SCRIPT_CONTEXT_H_ |