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

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

Issue 2061203002: WIP Reland: service worker: Don't control a subframe of an insecure context Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: maybe fix drmemory Created 4 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_registration.h" 5 #include "content/browser/service_worker/service_worker_registration.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "content/browser/service_worker/embedded_worker_status.h" 9 #include "content/browser/service_worker/embedded_worker_status.h"
10 #include "content/browser/service_worker/service_worker_context_core.h" 10 #include "content/browser/service_worker/service_worker_context_core.h"
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 DCHECK(active_version()); 194 DCHECK(active_version());
195 195
196 for (std::unique_ptr<ServiceWorkerContextCore::ProviderHostIterator> it = 196 for (std::unique_ptr<ServiceWorkerContextCore::ProviderHostIterator> it =
197 context_->GetProviderHostIterator(); 197 context_->GetProviderHostIterator();
198 !it->IsAtEnd(); it->Advance()) { 198 !it->IsAtEnd(); it->Advance()) {
199 ServiceWorkerProviderHost* host = it->GetProviderHost(); 199 ServiceWorkerProviderHost* host = it->GetProviderHost();
200 if (host->IsHostToRunningServiceWorker()) 200 if (host->IsHostToRunningServiceWorker())
201 continue; 201 continue;
202 if (host->controlling_version() == active_version()) 202 if (host->controlling_version() == active_version())
203 continue; 203 continue;
204 if (!host->IsContextSecureForServiceWorker())
205 continue;
204 if (host->MatchRegistration() == this) 206 if (host->MatchRegistration() == this)
205 host->ClaimedByRegistration(this); 207 host->ClaimedByRegistration(this);
206 } 208 }
207 } 209 }
208 210
209 void ServiceWorkerRegistration::ClearWhenReady() { 211 void ServiceWorkerRegistration::ClearWhenReady() {
210 DCHECK(context_); 212 DCHECK(context_);
211 if (is_uninstalling_) 213 if (is_uninstalling_)
212 return; 214 return;
213 is_uninstalling_ = true; 215 is_uninstalling_ = true;
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
473 if (!context_) { 475 if (!context_) {
474 callback.Run(SERVICE_WORKER_ERROR_ABORT); 476 callback.Run(SERVICE_WORKER_ERROR_ABORT);
475 return; 477 return;
476 } 478 }
477 context_->storage()->NotifyDoneInstallingRegistration( 479 context_->storage()->NotifyDoneInstallingRegistration(
478 this, version.get(), status); 480 this, version.get(), status);
479 callback.Run(status); 481 callback.Run(status);
480 } 482 }
481 483
482 } // namespace content 484 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698