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

Unified Diff: content/browser/service_worker/service_worker_context_wrapper.h

Issue 2211783003: Track input latency while starting a ServiceWorker for a navigation hint. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add comment Created 4 years, 4 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: content/browser/service_worker/service_worker_context_wrapper.h
diff --git a/content/browser/service_worker/service_worker_context_wrapper.h b/content/browser/service_worker/service_worker_context_wrapper.h
index 020fa67f21974447e43e043c6466dba21b66e5b0..12c8b7220cd833464c774c76357a7bb6408573c5 100644
--- a/content/browser/service_worker/service_worker_context_wrapper.h
+++ b/content/browser/service_worker/service_worker_context_wrapper.h
@@ -188,6 +188,9 @@ class CONTENT_EXPORT ServiceWorkerContextWrapper
// Must be called from the IO thread.
bool OriginHasForeignFetchRegistrations(const GURL& origin);
+ // Must be called from the UI thread.
+ bool IsRunningNavigationHintTask(int render_process_id) const;
+
private:
friend class BackgroundSyncManagerTest;
friend class base::RefCountedThreadSafe<ServiceWorkerContextWrapper>;
@@ -249,6 +252,9 @@ class CONTENT_EXPORT ServiceWorkerContextWrapper
int render_process_id,
const ResultCallback& callback,
ServiceWorkerStatusCode code);
+ void DidFinishNavigationHintTaskOnUI(int render_process_id,
+ const ResultCallback& callback,
+ bool result);
// The core context is only for use on the IO thread.
// Can be null before/during init, during/after shutdown, and after
@@ -270,6 +276,9 @@ class CONTENT_EXPORT ServiceWorkerContextWrapper
// The ResourceContext associated with this context.
ResourceContext* resource_context_;
+ // Must be touched on the UI thread.
+ std::map<int, int> navigation_hint_task_count_per_process_;
+
DISALLOW_COPY_AND_ASSIGN(ServiceWorkerContextWrapper);
};

Powered by Google App Engine
This is Rietveld 408576698