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_COMMON_SERVICE_WORKER_SERVICE_WORKER_TYPES_H_ | 5 #ifndef CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_TYPES_H_ |
6 #define CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_TYPES_H_ | 6 #define CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_TYPES_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
13 #include "third_party/WebKit/public/platform/WebServiceWorkerState.h" | 13 #include "third_party/WebKit/public/platform/WebServiceWorkerState.h" |
14 #include "url/gurl.h" | 14 #include "url/gurl.h" |
15 | 15 |
16 // This file is to have common definitions that are to be shared by | 16 // This file is to have common definitions that are to be shared by |
17 // browser and child process. | 17 // browser and child process. |
18 | 18 |
19 namespace content { | 19 namespace content { |
20 | 20 |
21 // Indicates invalid request ID (i.e. the sender does not expect it gets | 21 // Indicates invalid request ID (i.e. the sender does not expect it gets |
22 // response for the message) for messaging between browser process | 22 // response for the message) for messaging between browser process |
23 // and embedded worker. | 23 // and embedded worker. |
24 static const int kInvalidServiceWorkerRequestId = -1; | 24 static const int kInvalidServiceWorkerRequestId = -1; |
25 | 25 |
26 // Constants for invalid identifiers. | 26 // Constants for invalid identifiers. |
27 static const int kInvalidServiceWorkerHandleId = -1; | 27 static const int kInvalidServiceWorkerHandleId = -1; |
| 28 static const int kInvalidServiceWorkerRegistrationHandleId = -1; |
28 static const int kInvalidServiceWorkerProviderId = -1; | 29 static const int kInvalidServiceWorkerProviderId = -1; |
29 static const int64 kInvalidServiceWorkerRegistrationId = -1; | 30 static const int64 kInvalidServiceWorkerRegistrationId = -1; |
30 static const int64 kInvalidServiceWorkerVersionId = -1; | 31 static const int64 kInvalidServiceWorkerVersionId = -1; |
31 static const int64 kInvalidServiceWorkerResourceId = -1; | 32 static const int64 kInvalidServiceWorkerResourceId = -1; |
32 static const int64 kInvalidServiceWorkerResponseId = -1; | 33 static const int64 kInvalidServiceWorkerResponseId = -1; |
33 | 34 |
34 // Indicates how the service worker handled a fetch event. | 35 // Indicates how the service worker handled a fetch event. |
35 enum ServiceWorkerFetchEventResult { | 36 enum ServiceWorkerFetchEventResult { |
36 // Browser should fallback to native fetch. | 37 // Browser should fallback to native fetch. |
37 SERVICE_WORKER_FETCH_EVENT_RESULT_FALLBACK, | 38 SERVICE_WORKER_FETCH_EVENT_RESULT_FALLBACK, |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 bool active_changed() const { return !!(changed_ & ACTIVE_VERSION); } | 112 bool active_changed() const { return !!(changed_ & ACTIVE_VERSION); } |
112 bool controller_changed() const { return !!(changed_ & CONTROLLING_VERSION); } | 113 bool controller_changed() const { return !!(changed_ & CONTROLLING_VERSION); } |
113 | 114 |
114 private: | 115 private: |
115 int changed_; | 116 int changed_; |
116 }; | 117 }; |
117 | 118 |
118 } // namespace content | 119 } // namespace content |
119 | 120 |
120 #endif // CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_TYPES_H_ | 121 #endif // CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_TYPES_H_ |
OLD | NEW |