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

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

Issue 2288613002: ServiceWorker: Enable CHECK to confirm crash doesn't happen (Closed)
Patch Set: Created 4 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_provider_host.h" 5 #include "content/browser/service_worker/service_worker_provider_host.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/guid.h" 9 #include "base/guid.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 return; 274 return;
275 275
276 // Disassociation message should be sent only for controllees. 276 // Disassociation message should be sent only for controllees.
277 DCHECK(IsProviderForClient()); 277 DCHECK(IsProviderForClient());
278 Send(new ServiceWorkerMsg_DisassociateRegistration( 278 Send(new ServiceWorkerMsg_DisassociateRegistration(
279 render_thread_id_, provider_id())); 279 render_thread_id_, provider_id()));
280 } 280 }
281 281
282 void ServiceWorkerProviderHost::AddMatchingRegistration( 282 void ServiceWorkerProviderHost::AddMatchingRegistration(
283 ServiceWorkerRegistration* registration) { 283 ServiceWorkerRegistration* registration) {
284 DCHECK( 284 // TODO(shimazu): Change CHECK to DCHECK when it's confirmed that
285 // https://crbug.com/634222 has been fixed.
286 CHECK(
285 ServiceWorkerUtils::ScopeMatches(registration->pattern(), document_url_)); 287 ServiceWorkerUtils::ScopeMatches(registration->pattern(), document_url_));
286 if (!IsContextSecureForServiceWorker()) 288 if (!IsContextSecureForServiceWorker())
287 return; 289 return;
288 size_t key = registration->pattern().spec().size(); 290 size_t key = registration->pattern().spec().size();
289 if (base::ContainsKey(matching_registrations_, key)) 291 if (base::ContainsKey(matching_registrations_, key))
290 return; 292 return;
291 IncreaseProcessReference(registration->pattern()); 293 IncreaseProcessReference(registration->pattern());
292 registration->AddListener(this); 294 registration->AddListener(this);
293 matching_registrations_[key] = registration; 295 matching_registrations_[key] = registration;
294 ReturnRegistrationForReadyIfNeeded(); 296 ReturnRegistrationForReadyIfNeeded();
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
671 Send(new ServiceWorkerMsg_SetControllerServiceWorker( 673 Send(new ServiceWorkerMsg_SetControllerServiceWorker(
672 render_thread_id_, provider_id(), 674 render_thread_id_, provider_id(),
673 GetOrCreateServiceWorkerHandle( 675 GetOrCreateServiceWorkerHandle(
674 associated_registration_->active_version()), 676 associated_registration_->active_version()),
675 false /* shouldNotifyControllerChange */)); 677 false /* shouldNotifyControllerChange */));
676 } 678 }
677 } 679 }
678 } 680 }
679 681
680 } // namespace content 682 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698