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

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

Issue 1432823003: Add a test to cover service worker update codepath when extension is updated (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use set_force_update_on_page_load() + git cl format Created 5 years, 1 month 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 // Unregistration can fail if: 62 // Unregistration can fail if:
63 // * No Service Worker was registered for |pattern|. 63 // * No Service Worker was registered for |pattern|.
64 // * Something unexpected goes wrong, like a renderer crash. 64 // * Something unexpected goes wrong, like a renderer crash.
65 virtual void UnregisterServiceWorker(const Scope& pattern, 65 virtual void UnregisterServiceWorker(const Scope& pattern,
66 const ResultCallback& callback) = 0; 66 const ResultCallback& callback) = 0;
67 67
68 // Methods used in response to browsing data and quota manager requests. 68 // Methods used in response to browsing data and quota manager requests.
69 virtual void GetAllOriginsInfo(const GetUsageInfoCallback& callback) = 0; 69 virtual void GetAllOriginsInfo(const GetUsageInfoCallback& callback) = 0;
70 virtual void DeleteForOrigin(const GURL& origin_url, 70 virtual void DeleteForOrigin(const GURL& origin_url,
71 const ResultCallback& callback) = 0; 71 const ResultCallback& callback) = 0;
72 virtual void SetForceUpdateOnPageLoadForOrigin(const GURL& origin) = 0;
Devlin 2015/11/11 17:10:29 Nit: This probably doesn't fall into the comment a
lazyboy 2015/11/11 22:34:03 Done.
72 73
73 // Returns true if a Service Worker registration exists that matches |url|, 74 // Returns true if a Service Worker registration exists that matches |url|,
74 // and if |other_url| falls inside the scope of the same registration. Note 75 // and if |other_url| falls inside the scope of the same registration. Note
75 // this still returns true even if there is a Service Worker registration 76 // this still returns true even if there is a Service Worker registration
76 // which has a longer match for |other_url|. 77 // which has a longer match for |other_url|.
77 // This function can be called from any thread, but the callback will always 78 // This function can be called from any thread, but the callback will always
78 // be called on the UI thread. 79 // be called on the UI thread.
79 virtual void CheckHasServiceWorker( 80 virtual void CheckHasServiceWorker(
80 const GURL& url, 81 const GURL& url,
81 const GURL& other_url, 82 const GURL& other_url,
82 const CheckHasServiceWorkerCallback& callback) = 0; 83 const CheckHasServiceWorkerCallback& callback) = 0;
83 84
84 // Stops all running workers on the given |origin|. 85 // Stops all running workers on the given |origin|.
85 virtual void StopAllServiceWorkersForOrigin(const GURL& origin) = 0; 86 virtual void StopAllServiceWorkersForOrigin(const GURL& origin) = 0;
86 87
87 // Stops all running service workers and unregisters all service worker 88 // Stops all running service workers and unregisters all service worker
88 // registrations. This method is used in LayoutTests to make sure that the 89 // registrations. This method is used in LayoutTests to make sure that the
89 // existing service worker will not affect the succeeding tests. 90 // existing service worker will not affect the succeeding tests.
90 virtual void ClearAllServiceWorkersForTest(const base::Closure& callback) = 0; 91 virtual void ClearAllServiceWorkersForTest(const base::Closure& callback) = 0;
91 92
92 protected: 93 protected:
93 ServiceWorkerContext() {} 94 ServiceWorkerContext() {}
94 virtual ~ServiceWorkerContext() {} 95 virtual ~ServiceWorkerContext() {}
95 }; 96 };
96 97
97 } // namespace content 98 } // namespace content
98 99
99 #endif // CONTENT_PUBLIC_BROWSER_SERVICE_WORKER_CONTEXT_H_ 100 #endif // CONTENT_PUBLIC_BROWSER_SERVICE_WORKER_CONTEXT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698