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

Side by Side Diff: content/public/browser/service_worker_context.h

Issue 2778173002: Revert of "Speculatively launch Service Workers on mouse/touch events." (Closed)
Patch Set: rebase Created 3 years, 8 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 unified diff | Download patch
« no previous file with comments | « content/child/runtime_features.cc ('k') | content/public/common/content_features.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 CONTENT_PUBLIC_BROWSER_SERVICE_WORKER_CONTEXT_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_SERVICE_WORKER_CONTEXT_H_
6 #define CONTENT_PUBLIC_BROWSER_SERVICE_WORKER_CONTEXT_H_ 6 #define CONTENT_PUBLIC_BROWSER_SERVICE_WORKER_CONTEXT_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 10
11 #include "base/callback_forward.h" 11 #include "base/callback_forward.h"
12 #include "content/public/browser/service_worker_usage_info.h" 12 #include "content/public/browser/service_worker_usage_info.h"
13 #include "url/gurl.h" 13 #include "url/gurl.h"
14 14
15 namespace blink {
16 enum class WebNavigationHintType;
17 }
18
19 namespace content { 15 namespace content {
20 16
21 enum class ServiceWorkerCapability { 17 enum class ServiceWorkerCapability {
22 NO_SERVICE_WORKER, 18 NO_SERVICE_WORKER,
23 SERVICE_WORKER_NO_FETCH_HANDLER, 19 SERVICE_WORKER_NO_FETCH_HANDLER,
24 SERVICE_WORKER_WITH_FETCH_HANDLER, 20 SERVICE_WORKER_WITH_FETCH_HANDLER,
25 }; 21 };
26 22
27 // Represents the per-StoragePartition ServiceWorker data. 23 // Represents the per-StoragePartition ServiceWorker data.
28 class ServiceWorkerContext { 24 class ServiceWorkerContext {
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 virtual void StopAllServiceWorkersForOrigin(const GURL& origin) = 0; 132 virtual void StopAllServiceWorkersForOrigin(const GURL& origin) = 0;
137 133
138 // Stops all running service workers and unregisters all service worker 134 // Stops all running service workers and unregisters all service worker
139 // registrations. This method is used in LayoutTests to make sure that the 135 // registrations. This method is used in LayoutTests to make sure that the
140 // existing service worker will not affect the succeeding tests. 136 // existing service worker will not affect the succeeding tests.
141 // 137 //
142 // This function can be called from any thread, but the callback will always 138 // This function can be called from any thread, but the callback will always
143 // be called on the UI thread. 139 // be called on the UI thread.
144 virtual void ClearAllServiceWorkersForTest(const base::Closure& callback) = 0; 140 virtual void ClearAllServiceWorkersForTest(const base::Closure& callback) = 0;
145 141
146 // Starts a Service Worker for |document_url| for a navigation hint in the
147 // specified render process |render_process_id|. Must be called from the UI
148 // thread. The |callback| will always be called on the UI thread.
149 // This method can fail if:
150 // * No Service Worker was registered for |document_url|.
151 // * The specified render process is not suitable for loading |document_url|.
152 virtual void StartServiceWorkerForNavigationHint(
153 const GURL& document_url,
154 blink::WebNavigationHintType type,
155 int render_process_id,
156 const ResultCallback& callback) = 0;
157
158 protected: 142 protected:
159 ServiceWorkerContext() {} 143 ServiceWorkerContext() {}
160 virtual ~ServiceWorkerContext() {} 144 virtual ~ServiceWorkerContext() {}
161 }; 145 };
162 146
163 } // namespace content 147 } // namespace content
164 148
165 #endif // CONTENT_PUBLIC_BROWSER_SERVICE_WORKER_CONTEXT_H_ 149 #endif // CONTENT_PUBLIC_BROWSER_SERVICE_WORKER_CONTEXT_H_
OLDNEW
« no previous file with comments | « content/child/runtime_features.cc ('k') | content/public/common/content_features.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698