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

Unified Diff: extensions/browser/extension_function.h

Issue 2166523003: Add ref count to service workers for extension API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: send increment/decrement request from renderer/ process Created 4 years, 3 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/browser/extension_function.h
diff --git a/extensions/browser/extension_function.h b/extensions/browser/extension_function.h
index 40ac407ca5d4a40ed7205e519117c81874a8a5c8..d68d1a8cce3397fe1accbbe695f917210e5af219 100644
--- a/extensions/browser/extension_function.h
+++ b/extensions/browser/extension_function.h
@@ -528,8 +528,8 @@ class UIThreadExtensionFunction : public ExtensionFunction {
return dispatcher_.get();
}
- void set_is_from_service_worker(bool value) {
- is_from_service_worker_ = value;
+ void set_service_worker_version_id(int64_t version_id) {
+ service_worker_version_id_ = version_id;
}
// Gets the "current" web contents if any. If there is no associated web
@@ -567,15 +567,17 @@ class UIThreadExtensionFunction : public ExtensionFunction {
void Destruct() const override;
+ bool IsFromServiceWorker() const;
+
// The dispatcher that will service this extension function call.
base::WeakPtr<extensions::ExtensionFunctionDispatcher> dispatcher_;
// The RenderFrameHost we will send responses to.
content::RenderFrameHost* render_frame_host_;
- // Whether or not this ExtensionFunction was called by an extension Service
- // Worker.
- bool is_from_service_worker_;
+ // If this ExtensionFunction was called by an extension Service Worker, then
+ // this contains the worker's version id.
+ int64_t service_worker_version_id_;
std::unique_ptr<RenderFrameHostTracker> tracker_;

Powered by Google App Engine
This is Rietveld 408576698