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

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

Issue 1710903002: Revert of service worker: use 200 OK for update requests even in the no update case (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 bool skip_waiting() const { return skip_waiting_; } 309 bool skip_waiting() const { return skip_waiting_; }
310 void set_skip_waiting(bool skip_waiting) { skip_waiting_ = skip_waiting; } 310 void set_skip_waiting(bool skip_waiting) { skip_waiting_ = skip_waiting; }
311 311
312 bool force_bypass_cache_for_scripts() const { 312 bool force_bypass_cache_for_scripts() const {
313 return force_bypass_cache_for_scripts_; 313 return force_bypass_cache_for_scripts_;
314 } 314 }
315 void set_force_bypass_cache_for_scripts(bool force_bypass_cache_for_scripts) { 315 void set_force_bypass_cache_for_scripts(bool force_bypass_cache_for_scripts) {
316 force_bypass_cache_for_scripts_ = force_bypass_cache_for_scripts; 316 force_bypass_cache_for_scripts_ = force_bypass_cache_for_scripts;
317 } 317 }
318 318
319 bool pause_after_download() const { return pause_after_download_; } 319 bool skip_script_comparison() const { return skip_script_comparison_; }
320 void set_pause_after_download(bool pause_after_download) { 320 void set_skip_script_comparison(bool skip_script_comparison) {
321 pause_after_download_ = pause_after_download; 321 skip_script_comparison_ = skip_script_comparison;
322 } 322 }
323 323
324 void SetDevToolsAttached(bool attached); 324 void SetDevToolsAttached(bool attached);
325 325
326 // Sets the HttpResponseInfo used to load the main script. 326 // Sets the HttpResponseInfo used to load the main script.
327 // This HttpResponseInfo will be used for all responses sent back from the 327 // This HttpResponseInfo will be used for all responses sent back from the
328 // service worker, as the effective security of these responses is equivalent 328 // service worker, as the effective security of these responses is equivalent
329 // to that of the ServiceWorker. 329 // to that of the ServiceWorker.
330 void SetMainScriptHttpResponseInfo(const net::HttpResponseInfo& http_info); 330 void SetMainScriptHttpResponseInfo(const net::HttpResponseInfo& http_info);
331 const net::HttpResponseInfo* GetMainScriptHttpResponseInfo(); 331 const net::HttpResponseInfo* GetMainScriptHttpResponseInfo();
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
692 // New requests are added to |requests_| along with their entry in a callback 692 // New requests are added to |requests_| along with their entry in a callback
693 // map. Requests are sorted by their expiration time (soonest to expire on top 693 // map. Requests are sorted by their expiration time (soonest to expire on top
694 // of the priority queue). The timeout timer periodically checks |requests_| 694 // of the priority queue). The timeout timer periodically checks |requests_|
695 // for entries that should time out or have already been fulfilled (i.e., 695 // for entries that should time out or have already been fulfilled (i.e.,
696 // removed from the callback map). 696 // removed from the callback map).
697 RequestInfoPriorityQueue requests_; 697 RequestInfoPriorityQueue requests_;
698 698
699 bool skip_waiting_ = false; 699 bool skip_waiting_ = false;
700 bool skip_recording_startup_time_ = false; 700 bool skip_recording_startup_time_ = false;
701 bool force_bypass_cache_for_scripts_ = false; 701 bool force_bypass_cache_for_scripts_ = false;
702 bool pause_after_download_ = false; 702 bool skip_script_comparison_ = false;
703 bool is_update_scheduled_ = false; 703 bool is_update_scheduled_ = false;
704 bool in_dtor_ = false; 704 bool in_dtor_ = false;
705 705
706 std::vector<int> pending_skip_waiting_requests_; 706 std::vector<int> pending_skip_waiting_requests_;
707 scoped_ptr<net::HttpResponseInfo> main_script_http_info_; 707 scoped_ptr<net::HttpResponseInfo> main_script_http_info_;
708 708
709 // The status when StartWorker was invoked. Used for UMA. 709 // The status when StartWorker was invoked. Used for UMA.
710 Status prestart_status_ = NEW; 710 Status prestart_status_ = NEW;
711 // If not OK, the reason that StartWorker failed. Used for 711 // If not OK, the reason that StartWorker failed. Used for
712 // running |start_callbacks_|. 712 // running |start_callbacks_|.
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
795 795
796 // At this point |this| can have been deleted, so don't do anything other 796 // At this point |this| can have been deleted, so don't do anything other
797 // than returning. 797 // than returning.
798 798
799 return true; 799 return true;
800 } 800 }
801 801
802 } // namespace content 802 } // namespace content
803 803
804 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ 804 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_
OLDNEW
« no previous file with comments | « content/browser/service_worker/service_worker_registration.h ('k') | content/browser/service_worker/service_worker_version.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698