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

Side by Side Diff: third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainer.cpp

Issue 2387983002: Worker: Reflow comments in worker components (Closed)
Patch Set: manually tweak 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 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 if (!m_provider) { 221 if (!m_provider) {
222 callbacks->onError( 222 callbacks->onError(
223 WebServiceWorkerError(WebServiceWorkerError::ErrorTypeState, 223 WebServiceWorkerError(WebServiceWorkerError::ErrorTypeState,
224 "Failed to register a ServiceWorker: The " 224 "Failed to register a ServiceWorker: The "
225 "document is in an invalid state.")); 225 "document is in an invalid state."));
226 return; 226 return;
227 } 227 }
228 228
229 RefPtr<SecurityOrigin> documentOrigin = executionContext->getSecurityOrigin(); 229 RefPtr<SecurityOrigin> documentOrigin = executionContext->getSecurityOrigin();
230 String errorMessage; 230 String errorMessage;
231 // Restrict to secure origins: https://w3c.github.io/webappsec/specs/powerfulf eatures/#settings-privileged 231 // Restrict to secure origins:
232 // https://w3c.github.io/webappsec/specs/powerfulfeatures/#settings-privileged
232 if (!executionContext->isSecureContext(errorMessage)) { 233 if (!executionContext->isSecureContext(errorMessage)) {
233 callbacks->onError(WebServiceWorkerError( 234 callbacks->onError(WebServiceWorkerError(
234 WebServiceWorkerError::ErrorTypeSecurity, errorMessage)); 235 WebServiceWorkerError::ErrorTypeSecurity, errorMessage));
235 return; 236 return;
236 } 237 }
237 238
238 KURL pageURL = KURL(KURL(), documentOrigin->toString()); 239 KURL pageURL = KURL(KURL(), documentOrigin->toString());
239 if (!SchemeRegistry::shouldTreatURLSchemeAsAllowingServiceWorkers( 240 if (!SchemeRegistry::shouldTreatURLSchemeAsAllowingServiceWorkers(
240 pageURL.protocol())) { 241 pageURL.protocol())) {
241 callbacks->onError(WebServiceWorkerError( 242 callbacks->onError(WebServiceWorkerError(
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
526 527
527 if (ServiceWorkerContainerClient* client = 528 if (ServiceWorkerContainerClient* client =
528 ServiceWorkerContainerClient::from(executionContext)) { 529 ServiceWorkerContainerClient::from(executionContext)) {
529 m_provider = client->provider(); 530 m_provider = client->provider();
530 if (m_provider) 531 if (m_provider)
531 m_provider->setClient(this); 532 m_provider->setClient(this);
532 } 533 }
533 } 534 }
534 535
535 } // namespace blink 536 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698