Chromium Code Reviews| 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 <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 53 // * |script_url| fails to parse or its top-level execution fails. | 53 // * |script_url| fails to parse or its top-level execution fails. |
| 54 // TODO: The error message for this needs to be available to developers. | 54 // TODO: The error message for this needs to be available to developers. |
| 55 // * Something unexpected goes wrong, like a renderer crash or a full disk. | 55 // * Something unexpected goes wrong, like a renderer crash or a full disk. |
| 56 // | 56 // |
| 57 // This function can be called from any thread, but the callback will always | 57 // This function can be called from any thread, but the callback will always |
| 58 // be called on the UI thread. | 58 // be called on the UI thread. |
| 59 virtual void RegisterServiceWorker(const Scope& pattern, | 59 virtual void RegisterServiceWorker(const Scope& pattern, |
| 60 const GURL& script_url, | 60 const GURL& script_url, |
| 61 const ResultCallback& callback) = 0; | 61 const ResultCallback& callback) = 0; |
| 62 | 62 |
| 63 virtual bool IncrementPendingActivity(int64_t service_worker_version_id) = 0; | |
| 64 virtual bool DecrementPendingActivity(int64_t service_worker_version_id) = 0; | |
|
falken
2016/09/29 14:52:25
Could you add brief comments including that these
lazyboy
2016/09/29 18:07:20
Done.
| |
| 65 | |
| 63 // Equivalent to calling navigator.serviceWorker.unregister(pattern) from a | 66 // Equivalent to calling navigator.serviceWorker.unregister(pattern) from a |
| 64 // renderer, except that |pattern| is an absolute URL instead of relative to | 67 // renderer, except that |pattern| is an absolute URL instead of relative to |
| 65 // some current origin. |callback| is passed true when the JS promise is | 68 // some current origin. |callback| is passed true when the JS promise is |
| 66 // fulfilled or false when the JS promise is rejected. | 69 // fulfilled or false when the JS promise is rejected. |
| 67 // | 70 // |
| 68 // Unregistration can fail if: | 71 // Unregistration can fail if: |
| 69 // * No Service Worker was registered for |pattern|. | 72 // * No Service Worker was registered for |pattern|. |
| 70 // * Something unexpected goes wrong, like a renderer crash. | 73 // * Something unexpected goes wrong, like a renderer crash. |
| 71 // | 74 // |
| 72 // This function can be called from any thread, but the callback will always | 75 // This function can be called from any thread, but the callback will always |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 122 const ResultCallback& callback) = 0; | 125 const ResultCallback& callback) = 0; |
| 123 | 126 |
| 124 protected: | 127 protected: |
| 125 ServiceWorkerContext() {} | 128 ServiceWorkerContext() {} |
| 126 virtual ~ServiceWorkerContext() {} | 129 virtual ~ServiceWorkerContext() {} |
| 127 }; | 130 }; |
| 128 | 131 |
| 129 } // namespace content | 132 } // namespace content |
| 130 | 133 |
| 131 #endif // CONTENT_PUBLIC_BROWSER_SERVICE_WORKER_CONTEXT_H_ | 134 #endif // CONTENT_PUBLIC_BROWSER_SERVICE_WORKER_CONTEXT_H_ |
| OLD | NEW |