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

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

Issue 2575523002: Prerender: Confirm ServiceWorkers are invoked for NoState Prefetch (Closed)
Patch Set: comments/big hammer Created 3 years, 11 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
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
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 // specified |origin| via |callback|. 118 // specified |origin| via |callback|.
119 virtual void CountExternalRequestsForTest( 119 virtual void CountExternalRequestsForTest(
120 const GURL& origin, 120 const GURL& origin,
121 const CountExternalRequestsCallback& callback) = 0; 121 const CountExternalRequestsCallback& callback) = 0;
122 122
123 // Stops all running workers on the given |origin|. 123 // Stops all running workers on the given |origin|.
124 // 124 //
125 // This function can be called from any thread. 125 // This function can be called from any thread.
126 virtual void StopAllServiceWorkersForOrigin(const GURL& origin) = 0; 126 virtual void StopAllServiceWorkersForOrigin(const GURL& origin) = 0;
127 127
128 // Kills all running workers on the given |origin| using
129 // RenderProcessHost.Shutdown with exit code RESULT_CODE_KILLED. The shutdowns
130 // are synchronous; this will wait for shutdowns to finish.
131 virtual void KillAllServiceWorkersForOrigin(const GURL& origin) = 0;
132
128 // Stops all running service workers and unregisters all service worker 133 // Stops all running service workers and unregisters all service worker
129 // registrations. This method is used in LayoutTests to make sure that the 134 // registrations. This method is used in LayoutTests to make sure that the
130 // existing service worker will not affect the succeeding tests. 135 // existing service worker will not affect the succeeding tests.
131 // 136 //
132 // This function can be called from any thread, but the callback will always 137 // This function can be called from any thread, but the callback will always
133 // be called on the UI thread. 138 // be called on the UI thread.
134 virtual void ClearAllServiceWorkersForTest(const base::Closure& callback) = 0; 139 virtual void ClearAllServiceWorkersForTest(const base::Closure& callback) = 0;
135 140
136 // Starts a Service Worker for |document_url| for a navigation hint in the 141 // Starts a Service Worker for |document_url| for a navigation hint in the
137 // specified render process |render_process_id|. Must be called from the UI 142 // specified render process |render_process_id|. Must be called from the UI
138 // thread. The |callback| will always be called on the UI thread. 143 // thread. The |callback| will always be called on the UI thread.
139 // This method can fail if: 144 // This method can fail if:
140 // * No Service Worker was registered for |document_url|. 145 // * No Service Worker was registered for |document_url|.
141 // * The specified render process is not suitable for loading |document_url|. 146 // * The specified render process is not suitable for loading |document_url|.
142 virtual void StartServiceWorkerForNavigationHint( 147 virtual void StartServiceWorkerForNavigationHint(
143 const GURL& document_url, 148 const GURL& document_url,
144 blink::WebNavigationHintType type, 149 blink::WebNavigationHintType type,
145 int render_process_id, 150 int render_process_id,
146 const ResultCallback& callback) = 0; 151 const ResultCallback& callback) = 0;
147 152
148 protected: 153 protected:
149 ServiceWorkerContext() {} 154 ServiceWorkerContext() {}
150 virtual ~ServiceWorkerContext() {} 155 virtual ~ServiceWorkerContext() {}
151 }; 156 };
152 157
153 } // namespace content 158 } // namespace content
154 159
155 #endif // CONTENT_PUBLIC_BROWSER_SERVICE_WORKER_CONTEXT_H_ 160 #endif // CONTENT_PUBLIC_BROWSER_SERVICE_WORKER_CONTEXT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698