OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_CLIENT_INFO_H_ | 5 #ifndef CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_CLIENT_INFO_H_ |
6 #define CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_CLIENT_INFO_H_ | 6 #define CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_CLIENT_INFO_H_ |
7 | 7 |
8 #include "content/public/common/request_context_frame_type.h" | 8 #include "content/public/common/request_context_frame_type.h" |
9 #include "third_party/WebKit/public/platform/WebPageVisibilityState.h" | 9 #include "third_party/WebKit/public/platform/WebPageVisibilityState.h" |
| 10 #include "third_party/WebKit/public/platform/WebServiceWorkerClientType.h" |
10 #include "url/gurl.h" | 11 #include "url/gurl.h" |
11 | 12 |
12 namespace content { | 13 namespace content { |
13 | 14 |
14 // This class holds the information related to a service worker window client. | 15 // This class holds the information related to a service worker window client. |
15 // It is the content/ equivalent of Blink's WebServiceWorkerClientInfo. | 16 // It is the content/ equivalent of Blink's WebServiceWorkerClientInfo. |
16 // An instance can be created empty or can be filed with the expected | 17 // An instance can be created empty or can be filed with the expected |
17 // properties. Except for the client_id, it is preferred to use the constructor | 18 // properties. Except for the client_id, it is preferred to use the constructor |
18 // to fill the properties. | 19 // to fill the properties. |
19 struct ServiceWorkerClientInfo { | 20 struct ServiceWorkerClientInfo { |
20 ServiceWorkerClientInfo(); | 21 ServiceWorkerClientInfo(); |
21 ServiceWorkerClientInfo(blink::WebPageVisibilityState page_visibility_state, | 22 ServiceWorkerClientInfo(blink::WebPageVisibilityState page_visibility_state, |
22 bool is_focused, | 23 bool is_focused, |
23 const GURL& url, | 24 const GURL& url, |
24 RequestContextFrameType frame_type); | 25 RequestContextFrameType frame_type, |
| 26 blink::WebServiceWorkerClientType client_type); |
25 | 27 |
26 // Returns whether the instance is empty. | 28 // Returns whether the instance is empty. |
27 bool IsEmpty() const; | 29 bool IsEmpty() const; |
28 | 30 |
29 // Returns whether the instance is valid. A valid instance is not empty and | 31 // Returns whether the instance is valid. A valid instance is not empty and |
30 // has a valid client_id. | 32 // has a valid client_id. |
31 bool IsValid() const; | 33 bool IsValid() const; |
32 | 34 |
33 int client_id; | 35 int client_id; |
34 blink::WebPageVisibilityState page_visibility_state; | 36 blink::WebPageVisibilityState page_visibility_state; |
35 bool is_focused; | 37 bool is_focused; |
36 GURL url; | 38 GURL url; |
37 RequestContextFrameType frame_type; | 39 RequestContextFrameType frame_type; |
| 40 blink::WebServiceWorkerClientType client_type; |
38 }; | 41 }; |
39 | 42 |
40 } // namespace content | 43 } // namespace content |
41 | 44 |
42 #endif // CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_CLIENT_INFO_H_ | 45 #endif // CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_CLIENT_INFO_H_ |
OLD | NEW |