OLD | NEW |
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 "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/callback_forward.h" | 9 #include "base/callback_forward.h" |
10 #include "url/gurl.h" | 10 #include "url/gurl.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 // fulfilled or false when the JS promise is rejected. | 42 // fulfilled or false when the JS promise is rejected. |
43 // | 43 // |
44 // Unregistration can fail if: | 44 // Unregistration can fail if: |
45 // * No Service Worker was registered for |pattern|. | 45 // * No Service Worker was registered for |pattern|. |
46 // * Something unexpected goes wrong, like a renderer crash. | 46 // * Something unexpected goes wrong, like a renderer crash. |
47 virtual void UnregisterServiceWorker(const Scope& pattern, | 47 virtual void UnregisterServiceWorker(const Scope& pattern, |
48 const ResultCallback& callback) = 0; | 48 const ResultCallback& callback) = 0; |
49 | 49 |
50 // TODO(jyasskin): Provide a way to SendMessage to a Scope. | 50 // TODO(jyasskin): Provide a way to SendMessage to a Scope. |
51 | 51 |
| 52 // Synchronously releases all of the RenderProcessHosts that have Service |
| 53 // Workers running inside them, and prevents any new Service Worker instances |
| 54 // from starting up. |
| 55 virtual void Terminate() = 0; |
| 56 |
52 protected: | 57 protected: |
53 ServiceWorkerContext() {} | 58 ServiceWorkerContext() {} |
54 virtual ~ServiceWorkerContext() {} | 59 virtual ~ServiceWorkerContext() {} |
55 }; | 60 }; |
56 | 61 |
57 } // namespace content | 62 } // namespace content |
58 | 63 |
59 #endif // CONTENT_PUBLIC_BROWSER_SERVICE_WORKER_CONTEXT_H_ | 64 #endif // CONTENT_PUBLIC_BROWSER_SERVICE_WORKER_CONTEXT_H_ |
OLD | NEW |