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

Side by Side Diff: content/browser/service_worker/service_worker_storage.h

Issue 2521793004: service worker: Persist NavigationPreloadState (Closed)
Patch Set: expect_ name Created 4 years 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_BROWSER_SERVICE_WORKER_SERVICE_WORKER_STORAGE_H_ 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_STORAGE_H_
6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_STORAGE_H_ 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_STORAGE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <deque> 10 #include <deque>
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 136
137 // Updates the state of the registration's stored version to active. 137 // Updates the state of the registration's stored version to active.
138 void UpdateToActiveState( 138 void UpdateToActiveState(
139 ServiceWorkerRegistration* registration, 139 ServiceWorkerRegistration* registration,
140 const StatusCallback& callback); 140 const StatusCallback& callback);
141 141
142 // Updates the stored time to match the value of 142 // Updates the stored time to match the value of
143 // registration->last_update_check(). 143 // registration->last_update_check().
144 void UpdateLastUpdateCheckTime(ServiceWorkerRegistration* registration); 144 void UpdateLastUpdateCheckTime(ServiceWorkerRegistration* registration);
145 145
146 // Updates the specified registration's navigation preload state in storage.
147 // The caller is responsible for mutating the live registration's state.
148 void UpdateNavigationPreloadEnabled(int64_t registration_id,
149 const GURL& origin,
150 bool enable,
151 const StatusCallback& callback);
152 void UpdateNavigationPreloadHeader(int64_t registration_id,
153 const GURL& origin,
154 const std::string& value,
155 const StatusCallback& callback);
156
146 // Deletes the registration data for |registration_id|. If the registration's 157 // Deletes the registration data for |registration_id|. If the registration's
147 // version is live, its script resources will remain available. 158 // version is live, its script resources will remain available.
148 // PurgeResources should be called when it's OK to delete them. 159 // PurgeResources should be called when it's OK to delete them.
149 void DeleteRegistration(int64_t registration_id, 160 void DeleteRegistration(int64_t registration_id,
150 const GURL& origin, 161 const GURL& origin,
151 const StatusCallback& callback); 162 const StatusCallback& callback);
152 163
153 // Creates a resource accessor. Never returns nullptr but an accessor may be 164 // Creates a resource accessor. Never returns nullptr but an accessor may be
154 // associated with the disabled disk cache if the storage is disabled. 165 // associated with the disabled disk cache if the storage is disabled.
155 std::unique_ptr<ServiceWorkerResponseReader> CreateResponseReader( 166 std::unique_ptr<ServiceWorkerResponseReader> CreateResponseReader(
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 std::set<int64_t> pending_deletions_; 560 std::set<int64_t> pending_deletions_;
550 561
551 base::WeakPtrFactory<ServiceWorkerStorage> weak_factory_; 562 base::WeakPtrFactory<ServiceWorkerStorage> weak_factory_;
552 563
553 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerStorage); 564 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerStorage);
554 }; 565 };
555 566
556 } // namespace content 567 } // namespace content
557 568
558 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_STORAGE_H_ 569 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_STORAGE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698