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

Side by Side Diff: content/browser/service_worker/service_worker_context_core.cc

Issue 2771823002: Implement updateViaCache flag and no-cache by default for main service worker scripts
Patch Set: change useCache to updateViaCache Created 3 years, 6 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 #include "content/browser/service_worker/service_worker_context_core.h" 5 #include "content/browser/service_worker/service_worker_context_core.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <set> 8 #include <set>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 406
407 ServiceWorkerProviderHost* ServiceWorkerContextCore::GetProviderHostByClientID( 407 ServiceWorkerProviderHost* ServiceWorkerContextCore::GetProviderHostByClientID(
408 const std::string& client_uuid) { 408 const std::string& client_uuid) {
409 auto found = provider_by_uuid_->find(client_uuid); 409 auto found = provider_by_uuid_->find(client_uuid);
410 if (found == provider_by_uuid_->end()) 410 if (found == provider_by_uuid_->end())
411 return nullptr; 411 return nullptr;
412 return found->second; 412 return found->second;
413 } 413 }
414 414
415 void ServiceWorkerContextCore::RegisterServiceWorker( 415 void ServiceWorkerContextCore::RegisterServiceWorker(
416 const GURL& pattern,
417 const GURL& script_url, 416 const GURL& script_url,
417 const ServiceWorkerRegistrationOptions& options,
418 ServiceWorkerProviderHost* provider_host, 418 ServiceWorkerProviderHost* provider_host,
419 const RegistrationCallback& callback) { 419 const RegistrationCallback& callback) {
420 DCHECK_CURRENTLY_ON(BrowserThread::IO); 420 DCHECK_CURRENTLY_ON(BrowserThread::IO);
421 was_service_worker_registered_ = true; 421 was_service_worker_registered_ = true;
422 job_coordinator_->Register( 422 job_coordinator_->Register(
423 pattern, 423 script_url, options, provider_host,
424 script_url, 424 base::Bind(&ServiceWorkerContextCore::RegistrationComplete, AsWeakPtr(),
425 provider_host, 425 options.scope, callback));
426 base::Bind(&ServiceWorkerContextCore::RegistrationComplete,
427 AsWeakPtr(),
428 pattern,
429 callback));
430 } 426 }
431 427
432 void ServiceWorkerContextCore::UpdateServiceWorker( 428 void ServiceWorkerContextCore::UpdateServiceWorker(
433 ServiceWorkerRegistration* registration, 429 ServiceWorkerRegistration* registration,
434 bool force_bypass_cache) { 430 bool force_bypass_cache) {
435 DCHECK_CURRENTLY_ON(BrowserThread::IO); 431 DCHECK_CURRENTLY_ON(BrowserThread::IO);
436 job_coordinator_->Update(registration, force_bypass_cache); 432 job_coordinator_->Update(registration, force_bypass_cache);
437 } 433 }
438 434
439 void ServiceWorkerContextCore::UpdateServiceWorker( 435 void ServiceWorkerContextCore::UpdateServiceWorker(
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after
921 int service_worker_provider_id, 917 int service_worker_provider_id,
922 mojom::ServiceWorkerWorkerClientAssociatedPtrInfo client_ptr_info) { 918 mojom::ServiceWorkerWorkerClientAssociatedPtrInfo client_ptr_info) {
923 ServiceWorkerProviderHost* provider_host = 919 ServiceWorkerProviderHost* provider_host =
924 GetProviderHost(render_process_id, service_worker_provider_id); 920 GetProviderHost(render_process_id, service_worker_provider_id);
925 if (!provider_host) 921 if (!provider_host)
926 return; 922 return;
927 provider_host->BindWorkerFetchContext(std::move(client_ptr_info)); 923 provider_host->BindWorkerFetchContext(std::move(client_ptr_info));
928 } 924 }
929 925
930 } // namespace content 926 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698