Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: content/common/service_worker/service_worker_types.h

Issue 2771823002: Implement updateViaCache flag and no-cache by default for main service worker scripts
Patch Set: fix IPC Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
11 #include <memory> 11 #include <memory>
12 #include <string> 12 #include <string>
13 13
14 #include "base/strings/string_util.h" 14 #include "base/strings/string_util.h"
15 #include "base/time/time.h" 15 #include "base/time/time.h"
16 #include "content/common/content_export.h" 16 #include "content/common/content_export.h"
17 #include "content/common/service_worker/service_worker_client_info.h" 17 #include "content/common/service_worker/service_worker_client_info.h"
18 #include "content/public/common/referrer.h" 18 #include "content/public/common/referrer.h"
19 #include "content/public/common/request_context_frame_type.h" 19 #include "content/public/common/request_context_frame_type.h"
20 #include "content/public/common/request_context_type.h" 20 #include "content/public/common/request_context_type.h"
21 #include "content/public/common/service_worker_modes.h" 21 #include "content/public/common/service_worker_modes.h"
22 #include "third_party/WebKit/public/platform/WebPageVisibilityState.h" 22 #include "third_party/WebKit/public/platform/WebPageVisibilityState.h"
23 #include "third_party/WebKit/public/platform/modules/fetch/fetch_api_request.moj om.h" 23 #include "third_party/WebKit/public/platform/modules/fetch/fetch_api_request.moj om.h"
24 #include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWor kerClientType.h" 24 #include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWor kerClientType.h"
25 #include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWor kerResponseError.h" 25 #include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWor kerResponseError.h"
26 #include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWor kerState.h" 26 #include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWor kerState.h"
27 #include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWor kerUpdateViaCache.h"
27 #include "url/gurl.h" 28 #include "url/gurl.h"
28 29
29 // This file is to have common definitions that are to be shared by 30 // This file is to have common definitions that are to be shared by
30 // browser and child process. 31 // browser and child process.
31 32
32 namespace storage { 33 namespace storage {
33 class BlobHandle; 34 class BlobHandle;
34 } 35 }
35 36
36 namespace content { 37 namespace content {
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 182
182 int handle_id; 183 int handle_id;
183 GURL url; 184 GURL url;
184 blink::WebServiceWorkerState state; 185 blink::WebServiceWorkerState state;
185 int64_t version_id; 186 int64_t version_id;
186 }; 187 };
187 188
188 // Represents options for register(): 189 // Represents options for register():
189 // https://w3c.github.io/ServiceWorker/#dictdef-registrationoptions 190 // https://w3c.github.io/ServiceWorker/#dictdef-registrationoptions
190 struct CONTENT_EXPORT ServiceWorkerRegistrationOptions { 191 struct CONTENT_EXPORT ServiceWorkerRegistrationOptions {
191 ServiceWorkerRegistrationOptions() = default; 192 ServiceWorkerRegistrationOptions();
192 explicit ServiceWorkerRegistrationOptions(const GURL& scope); 193 explicit ServiceWorkerRegistrationOptions(const GURL& scope);
194 ServiceWorkerRegistrationOptions(
195 const GURL& scope,
196 blink::WebServiceWorkerUpdateViaCache update_via_cache);
193 GURL scope; 197 GURL scope;
194 // TODO(yuryu): Other values will be added as they are supported later. 198 blink::WebServiceWorkerUpdateViaCache update_via_cache;
195 }; 199 };
196 200
197 struct CONTENT_EXPORT ServiceWorkerRegistrationObjectInfo { 201 struct CONTENT_EXPORT ServiceWorkerRegistrationObjectInfo {
198 ServiceWorkerRegistrationObjectInfo(); 202 ServiceWorkerRegistrationObjectInfo();
199 int handle_id; 203 int handle_id;
200 ServiceWorkerRegistrationOptions options; 204 ServiceWorkerRegistrationOptions options;
201 int64_t registration_id; 205 int64_t registration_id;
202 }; 206 };
203 207
204 struct CONTENT_EXPORT ServiceWorkerVersionAttributes { 208 struct CONTENT_EXPORT ServiceWorkerVersionAttributes {
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 NavigationPreloadState(); 257 NavigationPreloadState();
254 NavigationPreloadState(bool enabled, std::string header); 258 NavigationPreloadState(bool enabled, std::string header);
255 NavigationPreloadState(const NavigationPreloadState& other); 259 NavigationPreloadState(const NavigationPreloadState& other);
256 bool enabled; 260 bool enabled;
257 std::string header; 261 std::string header;
258 }; 262 };
259 263
260 } // namespace content 264 } // namespace content
261 265
262 #endif // CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_TYPES_H_ 266 #endif // CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_TYPES_H_
OLDNEW
« no previous file with comments | « content/common/service_worker/service_worker_messages.h ('k') | content/common/service_worker/service_worker_types.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698