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

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

Issue 2417793002: Introduce FetchEventPreloadHandle to pass the preload response to FetchEvent. (Closed)
Patch Set: incorporated dchecng's comment Created 4 years, 2 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 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_VERSION_H_ 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_
6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <functional> 10 #include <functional>
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 foreign_fetch_scopes_ = scopes; 163 foreign_fetch_scopes_ = scopes;
164 } 164 }
165 165
166 const std::vector<url::Origin>& foreign_fetch_origins() const { 166 const std::vector<url::Origin>& foreign_fetch_origins() const {
167 return foreign_fetch_origins_; 167 return foreign_fetch_origins_;
168 } 168 }
169 void set_foreign_fetch_origins(const std::vector<url::Origin>& origins) { 169 void set_foreign_fetch_origins(const std::vector<url::Origin>& origins) {
170 foreign_fetch_origins_ = origins; 170 foreign_fetch_origins_ = origins;
171 } 171 }
172 172
173 bool navigation_preload_enabled() const {
174 return navigation_preload_enabled_;
175 }
176 void set_navigation_preload_enabled(bool enabled) {
177 navigation_preload_enabled_ = enabled;
178 }
179
173 ServiceWorkerMetrics::Site site_for_uma() const { return site_for_uma_; } 180 ServiceWorkerMetrics::Site site_for_uma() const { return site_for_uma_; }
174 181
175 // This sets the new status and also run status change callbacks 182 // This sets the new status and also run status change callbacks
176 // if there're any (see RegisterStatusChangeCallback). 183 // if there're any (see RegisterStatusChangeCallback).
177 void SetStatus(Status status); 184 void SetStatus(Status status);
178 185
179 // Registers status change callback. (This is for one-off observation, 186 // Registers status change callback. (This is for one-off observation,
180 // the consumer needs to re-register if it wants to continue observing 187 // the consumer needs to re-register if it wants to continue observing
181 // status changes) 188 // status changes)
182 void RegisterStatusChangeCallback(const base::Closure& callback); 189 void RegisterStatusChangeCallback(const base::Closure& callback);
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after
695 // callbacks. 702 // callbacks.
696 void FinishStartWorker(ServiceWorkerStatusCode status); 703 void FinishStartWorker(ServiceWorkerStatusCode status);
697 704
698 const int64_t version_id_; 705 const int64_t version_id_;
699 const int64_t registration_id_; 706 const int64_t registration_id_;
700 const GURL script_url_; 707 const GURL script_url_;
701 const GURL scope_; 708 const GURL scope_;
702 std::vector<GURL> foreign_fetch_scopes_; 709 std::vector<GURL> foreign_fetch_scopes_;
703 std::vector<url::Origin> foreign_fetch_origins_; 710 std::vector<url::Origin> foreign_fetch_origins_;
704 FetchHandlerExistence fetch_handler_existence_; 711 FetchHandlerExistence fetch_handler_existence_;
712 bool navigation_preload_enabled_ = false;
705 ServiceWorkerMetrics::Site site_for_uma_; 713 ServiceWorkerMetrics::Site site_for_uma_;
706 714
707 Status status_ = NEW; 715 Status status_ = NEW;
708 std::unique_ptr<EmbeddedWorkerInstance> embedded_worker_; 716 std::unique_ptr<EmbeddedWorkerInstance> embedded_worker_;
709 std::vector<StatusCallback> start_callbacks_; 717 std::vector<StatusCallback> start_callbacks_;
710 std::vector<StatusCallback> stop_callbacks_; 718 std::vector<StatusCallback> stop_callbacks_;
711 std::vector<base::Closure> status_change_callbacks_; 719 std::vector<base::Closure> status_change_callbacks_;
712 720
713 // Holds in-flight requests, including requests due to outstanding push, 721 // Holds in-flight requests, including requests due to outstanding push,
714 // fetch, sync, etc. events. 722 // fetch, sync, etc. events.
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
854 862
855 // At this point |this| can have been deleted, so don't do anything other 863 // At this point |this| can have been deleted, so don't do anything other
856 // than returning. 864 // than returning.
857 865
858 return true; 866 return true;
859 } 867 }
860 868
861 } // namespace content 869 } // namespace content
862 870
863 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ 871 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698