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 "base/strings/string_util.h" | 12 #include "base/strings/string_util.h" |
13 #include "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
| 14 #include "content/common/service_worker/service_worker_client_info.h" |
14 #include "content/public/common/referrer.h" | 15 #include "content/public/common/referrer.h" |
15 #include "content/public/common/request_context_frame_type.h" | 16 #include "content/public/common/request_context_frame_type.h" |
16 #include "content/public/common/request_context_type.h" | 17 #include "content/public/common/request_context_type.h" |
17 #include "third_party/WebKit/public/platform/WebPageVisibilityState.h" | 18 #include "third_party/WebKit/public/platform/WebPageVisibilityState.h" |
18 #include "third_party/WebKit/public/platform/WebServiceWorkerClientType.h" | 19 #include "third_party/WebKit/public/platform/WebServiceWorkerClientType.h" |
19 #include "third_party/WebKit/public/platform/WebServiceWorkerResponseType.h" | 20 #include "third_party/WebKit/public/platform/WebServiceWorkerResponseType.h" |
20 #include "third_party/WebKit/public/platform/WebServiceWorkerState.h" | 21 #include "third_party/WebKit/public/platform/WebServiceWorkerState.h" |
21 #include "url/gurl.h" | 22 #include "url/gurl.h" |
22 | 23 |
23 // This file is to have common definitions that are to be shared by | 24 // This file is to have common definitions that are to be shared by |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 typedef std::map<std::string, std::string, ServiceWorkerCaseInsensitiveCompare> | 100 typedef std::map<std::string, std::string, ServiceWorkerCaseInsensitiveCompare> |
100 ServiceWorkerHeaderMap; | 101 ServiceWorkerHeaderMap; |
101 | 102 |
102 // To dispatch fetch request from browser to child process. | 103 // To dispatch fetch request from browser to child process. |
103 struct CONTENT_EXPORT ServiceWorkerFetchRequest { | 104 struct CONTENT_EXPORT ServiceWorkerFetchRequest { |
104 ServiceWorkerFetchRequest(); | 105 ServiceWorkerFetchRequest(); |
105 ServiceWorkerFetchRequest(const GURL& url, | 106 ServiceWorkerFetchRequest(const GURL& url, |
106 const std::string& method, | 107 const std::string& method, |
107 const ServiceWorkerHeaderMap& headers, | 108 const ServiceWorkerHeaderMap& headers, |
108 const Referrer& referrer, | 109 const Referrer& referrer, |
109 bool is_reload); | 110 bool is_reload, |
| 111 const ServiceWorkerClientInfo& client); |
110 ~ServiceWorkerFetchRequest(); | 112 ~ServiceWorkerFetchRequest(); |
111 | 113 |
112 FetchRequestMode mode; | 114 FetchRequestMode mode; |
113 RequestContextType request_context_type; | 115 RequestContextType request_context_type; |
114 RequestContextFrameType frame_type; | 116 RequestContextFrameType frame_type; |
115 GURL url; | 117 GURL url; |
116 std::string method; | 118 std::string method; |
117 ServiceWorkerHeaderMap headers; | 119 ServiceWorkerHeaderMap headers; |
118 std::string blob_uuid; | 120 std::string blob_uuid; |
119 uint64 blob_size; | 121 uint64 blob_size; |
120 Referrer referrer; | 122 Referrer referrer; |
121 FetchCredentialsMode credentials_mode; | 123 FetchCredentialsMode credentials_mode; |
122 bool is_reload; | 124 bool is_reload; |
| 125 ServiceWorkerClientInfo client; |
123 }; | 126 }; |
124 | 127 |
125 // Represents a response to a fetch. | 128 // Represents a response to a fetch. |
126 struct CONTENT_EXPORT ServiceWorkerResponse { | 129 struct CONTENT_EXPORT ServiceWorkerResponse { |
127 ServiceWorkerResponse(); | 130 ServiceWorkerResponse(); |
128 ServiceWorkerResponse(const GURL& url, | 131 ServiceWorkerResponse(const GURL& url, |
129 int status_code, | 132 int status_code, |
130 const std::string& status_text, | 133 const std::string& status_text, |
131 blink::WebServiceWorkerResponseType response_type, | 134 blink::WebServiceWorkerResponseType response_type, |
132 const ServiceWorkerHeaderMap& headers, | 135 const ServiceWorkerHeaderMap& headers, |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 | 196 |
194 struct ServiceWorkerClientQueryOptions { | 197 struct ServiceWorkerClientQueryOptions { |
195 ServiceWorkerClientQueryOptions(); | 198 ServiceWorkerClientQueryOptions(); |
196 blink::WebServiceWorkerClientType client_type; | 199 blink::WebServiceWorkerClientType client_type; |
197 bool include_uncontrolled; | 200 bool include_uncontrolled; |
198 }; | 201 }; |
199 | 202 |
200 } // namespace content | 203 } // namespace content |
201 | 204 |
202 #endif // CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_TYPES_H_ | 205 #endif // CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_TYPES_H_ |
OLD | NEW |