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

Unified Diff: extensions/renderer/script_context.h

Issue 2943583002: [extension SW] Support lazy events from extension service workers. (Closed)
Patch Set: Address comments from falken@ Created 3 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 side-by-side diff with in-line comments
Download patch
Index: extensions/renderer/script_context.h
diff --git a/extensions/renderer/script_context.h b/extensions/renderer/script_context.h
index c1408949fc68efb0bd03e24d4cba01ed38361427..b456fa207cfa2dff6e831671ce8f16531c9cd7eb 100644
--- a/extensions/renderer/script_context.h
+++ b/extensions/renderer/script_context.h
@@ -149,11 +149,16 @@ class ScriptContext : public RequestSender::Source {
// - It might let us remove the about:blank resolving?
const GURL& url() const { return url_; }
+ const GURL& service_worker_scope() const;
+
// Sets the URL of this ScriptContext. Usually this will automatically be set
// on construction, unless this isn't constructed with enough information to
// determine the URL (e.g. frame was null).
// TODO(kalman): Make this a constructor parameter (as an origin).
void set_url(const GURL& url) { url_ = url; }
+ void set_service_worker_scope(const GURL& scope) {
+ service_worker_scope_ = scope;
+ }
// Returns whether the API |api| or any part of the API could be available in
// this context without taking into account the context's extension.
@@ -269,6 +274,8 @@ class ScriptContext : public RequestSender::Source {
GURL url_;
+ GURL service_worker_scope_;
+
std::unique_ptr<Runner> runner_;
base::ThreadChecker thread_checker_;

Powered by Google App Engine
This is Rietveld 408576698