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

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 tests Created 3 years, 8 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 namespace content { 7 namespace content {
8 8
9 const char kServiceWorkerRegisterErrorPrefix[] = 9 const char kServiceWorkerRegisterErrorPrefix[] =
10 "Failed to register a ServiceWorker: "; 10 "Failed to register a ServiceWorker: ";
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 ServiceWorkerObjectInfo::ServiceWorkerObjectInfo() 128 ServiceWorkerObjectInfo::ServiceWorkerObjectInfo()
129 : handle_id(kInvalidServiceWorkerHandleId), 129 : handle_id(kInvalidServiceWorkerHandleId),
130 state(blink::WebServiceWorkerStateUnknown), 130 state(blink::WebServiceWorkerStateUnknown),
131 version_id(kInvalidServiceWorkerVersionId) {} 131 version_id(kInvalidServiceWorkerVersionId) {}
132 132
133 bool ServiceWorkerObjectInfo::IsValid() const { 133 bool ServiceWorkerObjectInfo::IsValid() const {
134 return handle_id != kInvalidServiceWorkerHandleId && 134 return handle_id != kInvalidServiceWorkerHandleId &&
135 version_id != kInvalidServiceWorkerVersionId; 135 version_id != kInvalidServiceWorkerVersionId;
136 } 136 }
137 137
138 ServiceWorkerRegistrationOptions::ServiceWorkerRegistrationOptions()
139 : use_cache(UseCache::DontUse) {}
140
141 ServiceWorkerRegistrationOptions::ServiceWorkerRegistrationOptions(
142 const GURL& scope)
143 : scope(scope), use_cache(UseCache::DontUse) {}
nhiroki 2017/03/28 06:49:51 Delegating constructor would work here: ServiceWo
yuryu 2017/07/20 10:15:12 Done.
144
145 ServiceWorkerRegistrationOptions::ServiceWorkerRegistrationOptions(
146 const GURL& scope,
147 UseCache use_cache)
148 : scope(scope), use_cache(use_cache) {}
149
138 ServiceWorkerRegistrationObjectInfo::ServiceWorkerRegistrationObjectInfo() 150 ServiceWorkerRegistrationObjectInfo::ServiceWorkerRegistrationObjectInfo()
139 : handle_id(kInvalidServiceWorkerRegistrationHandleId), 151 : handle_id(kInvalidServiceWorkerRegistrationHandleId),
140 registration_id(kInvalidServiceWorkerRegistrationId) { 152 registration_id(kInvalidServiceWorkerRegistrationId) {}
141 }
142 153
143 ServiceWorkerClientQueryOptions::ServiceWorkerClientQueryOptions() 154 ServiceWorkerClientQueryOptions::ServiceWorkerClientQueryOptions()
144 : client_type(blink::WebServiceWorkerClientTypeWindow), 155 : client_type(blink::WebServiceWorkerClientTypeWindow),
145 include_uncontrolled(false) { 156 include_uncontrolled(false) {
146 } 157 }
147 158
148 ExtendableMessageEventSource::ExtendableMessageEventSource() {} 159 ExtendableMessageEventSource::ExtendableMessageEventSource() {}
149 160
150 ExtendableMessageEventSource::ExtendableMessageEventSource( 161 ExtendableMessageEventSource::ExtendableMessageEventSource(
151 const ServiceWorkerClientInfo& client_info) 162 const ServiceWorkerClientInfo& client_info)
152 : client_info(client_info) {} 163 : client_info(client_info) {}
153 164
154 ExtendableMessageEventSource::ExtendableMessageEventSource( 165 ExtendableMessageEventSource::ExtendableMessageEventSource(
155 const ServiceWorkerObjectInfo& service_worker_info) 166 const ServiceWorkerObjectInfo& service_worker_info)
156 : service_worker_info(service_worker_info) {} 167 : service_worker_info(service_worker_info) {}
157 168
158 NavigationPreloadState::NavigationPreloadState() 169 NavigationPreloadState::NavigationPreloadState()
159 : enabled(false), header("true") {} 170 : enabled(false), header("true") {}
160 171
161 NavigationPreloadState::NavigationPreloadState(bool enabled, std::string header) 172 NavigationPreloadState::NavigationPreloadState(bool enabled, std::string header)
162 : enabled(enabled), header(header) {} 173 : enabled(enabled), header(header) {}
163 174
164 NavigationPreloadState::NavigationPreloadState( 175 NavigationPreloadState::NavigationPreloadState(
165 const NavigationPreloadState& other) = default; 176 const NavigationPreloadState& other) = default;
166 177
167 } // namespace content 178 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698