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

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

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 #include "content/common/service_worker/service_worker_types.h" 5 #include "content/common/service_worker/service_worker_types.h"
6 6
7 #include "content/public/common/service_worker_modes.h" 7 #include "content/public/common/service_worker_modes.h"
8 #include "storage/common/blob_storage/blob_handle.h" 8 #include "storage/common/blob_storage/blob_handle.h"
9 9
10 namespace content { 10 namespace content {
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 ServiceWorkerObjectInfo::ServiceWorkerObjectInfo() 136 ServiceWorkerObjectInfo::ServiceWorkerObjectInfo()
137 : handle_id(kInvalidServiceWorkerHandleId), 137 : handle_id(kInvalidServiceWorkerHandleId),
138 state(blink::kWebServiceWorkerStateUnknown), 138 state(blink::kWebServiceWorkerStateUnknown),
139 version_id(kInvalidServiceWorkerVersionId) {} 139 version_id(kInvalidServiceWorkerVersionId) {}
140 140
141 bool ServiceWorkerObjectInfo::IsValid() const { 141 bool ServiceWorkerObjectInfo::IsValid() const {
142 return handle_id != kInvalidServiceWorkerHandleId && 142 return handle_id != kInvalidServiceWorkerHandleId &&
143 version_id != kInvalidServiceWorkerVersionId; 143 version_id != kInvalidServiceWorkerVersionId;
144 } 144 }
145 145
146 ServiceWorkerRegistrationOptions::ServiceWorkerRegistrationOptions()
147 : update_via_cache(blink::WebServiceWorkerUpdateViaCache::kImports) {}
148
146 ServiceWorkerRegistrationOptions::ServiceWorkerRegistrationOptions( 149 ServiceWorkerRegistrationOptions::ServiceWorkerRegistrationOptions(
147 const GURL& scope) 150 const GURL& scope)
148 : scope(scope) {} 151 : ServiceWorkerRegistrationOptions(
152 scope,
153 blink::WebServiceWorkerUpdateViaCache::kImports) {}
154
155 ServiceWorkerRegistrationOptions::ServiceWorkerRegistrationOptions(
156 const GURL& scope,
157 blink::WebServiceWorkerUpdateViaCache update_via_cache)
158 : scope(scope), update_via_cache(update_via_cache) {}
149 159
150 ServiceWorkerRegistrationObjectInfo::ServiceWorkerRegistrationObjectInfo() 160 ServiceWorkerRegistrationObjectInfo::ServiceWorkerRegistrationObjectInfo()
151 : handle_id(kInvalidServiceWorkerRegistrationHandleId), 161 : handle_id(kInvalidServiceWorkerRegistrationHandleId),
152 registration_id(kInvalidServiceWorkerRegistrationId) { 162 registration_id(kInvalidServiceWorkerRegistrationId) {}
153 }
154 163
155 ServiceWorkerClientQueryOptions::ServiceWorkerClientQueryOptions() 164 ServiceWorkerClientQueryOptions::ServiceWorkerClientQueryOptions()
156 : client_type(blink::kWebServiceWorkerClientTypeWindow), 165 : client_type(blink::kWebServiceWorkerClientTypeWindow),
157 include_uncontrolled(false) {} 166 include_uncontrolled(false) {}
158 167
159 ExtendableMessageEventSource::ExtendableMessageEventSource() {} 168 ExtendableMessageEventSource::ExtendableMessageEventSource() {}
160 169
161 ExtendableMessageEventSource::ExtendableMessageEventSource( 170 ExtendableMessageEventSource::ExtendableMessageEventSource(
162 const ServiceWorkerClientInfo& client_info) 171 const ServiceWorkerClientInfo& client_info)
163 : client_info(client_info) {} 172 : client_info(client_info) {}
164 173
165 ExtendableMessageEventSource::ExtendableMessageEventSource( 174 ExtendableMessageEventSource::ExtendableMessageEventSource(
166 const ServiceWorkerObjectInfo& service_worker_info) 175 const ServiceWorkerObjectInfo& service_worker_info)
167 : service_worker_info(service_worker_info) {} 176 : service_worker_info(service_worker_info) {}
168 177
169 NavigationPreloadState::NavigationPreloadState() 178 NavigationPreloadState::NavigationPreloadState()
170 : enabled(false), header("true") {} 179 : enabled(false), header("true") {}
171 180
172 NavigationPreloadState::NavigationPreloadState(bool enabled, std::string header) 181 NavigationPreloadState::NavigationPreloadState(bool enabled, std::string header)
173 : enabled(enabled), header(header) {} 182 : enabled(enabled), header(header) {}
174 183
175 NavigationPreloadState::NavigationPreloadState( 184 NavigationPreloadState::NavigationPreloadState(
176 const NavigationPreloadState& other) = default; 185 const NavigationPreloadState& other) = default;
177 186
178 } // namespace content 187 } // namespace content
OLDNEW
« no previous file with comments | « content/common/service_worker/service_worker_types.h ('k') | content/public/browser/service_worker_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698