| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "modules/serviceworkers/InstallEvent.h" | 5 #include "modules/serviceworkers/InstallEvent.h" |
| 6 | 6 |
| 7 #include "bindings/modules/v8/UnionTypesModules.h" | 7 #include "bindings/modules/v8/UnionTypesModules.h" |
| 8 #include "core/dom/ExceptionCode.h" | 8 #include "core/dom/ExceptionCode.h" |
| 9 #include "modules/serviceworkers/ServiceWorkerGlobalScopeClient.h" | 9 #include "modules/serviceworkers/ServiceWorkerGlobalScopeClient.h" |
| 10 #include "public/platform/WebSecurityOrigin.h" | 10 #include "public/platform/WebSecurityOrigin.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 if (parsedOrigins[i]->isUnique()) { | 56 if (parsedOrigins[i]->isUnique()) { |
| 57 exceptionState.throwTypeError("Invalid origin URL: " + originLis
t[i]); | 57 exceptionState.throwTypeError("Invalid origin URL: " + originLis
t[i]); |
| 58 return; | 58 return; |
| 59 } | 59 } |
| 60 } | 60 } |
| 61 } | 61 } |
| 62 | 62 |
| 63 ServiceWorkerGlobalScopeClient* client = ServiceWorkerGlobalScopeClient::fro
m(executionContext); | 63 ServiceWorkerGlobalScopeClient* client = ServiceWorkerGlobalScopeClient::fro
m(executionContext); |
| 64 | 64 |
| 65 String scopePath = static_cast<KURL>(client->scope()).path(); | 65 String scopePath = static_cast<KURL>(client->scope()).path(); |
| 66 RefPtr<SecurityOrigin> origin = executionContext->securityOrigin(); | 66 RefPtr<SecurityOrigin> origin = executionContext->getSecurityOrigin(); |
| 67 | 67 |
| 68 if (!options.hasScopes() || options.scopes().isEmpty()) { | 68 if (!options.hasScopes() || options.scopes().isEmpty()) { |
| 69 exceptionState.throwTypeError("At least one scope is required"); | 69 exceptionState.throwTypeError("At least one scope is required"); |
| 70 return; | 70 return; |
| 71 } | 71 } |
| 72 const Vector<String>& subScopes = options.scopes(); | 72 const Vector<String>& subScopes = options.scopes(); |
| 73 Vector<KURL> subScopeURLs(subScopes.size()); | 73 Vector<KURL> subScopeURLs(subScopes.size()); |
| 74 for (size_t i = 0; i < subScopes.size(); ++i) { | 74 for (size_t i = 0; i < subScopes.size(); ++i) { |
| 75 subScopeURLs[i] = executionContext->completeURL(subScopes[i]); | 75 subScopeURLs[i] = executionContext->completeURL(subScopes[i]); |
| 76 if (!subScopeURLs[i].isValid()) { | 76 if (!subScopeURLs[i].isValid()) { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 104 : ExtendableEvent(type, initializer) | 104 : ExtendableEvent(type, initializer) |
| 105 { | 105 { |
| 106 } | 106 } |
| 107 | 107 |
| 108 InstallEvent::InstallEvent(const AtomicString& type, const ExtendableEventInit&
initializer, WaitUntilObserver* observer) | 108 InstallEvent::InstallEvent(const AtomicString& type, const ExtendableEventInit&
initializer, WaitUntilObserver* observer) |
| 109 : ExtendableEvent(type, initializer, observer) | 109 : ExtendableEvent(type, initializer, observer) |
| 110 { | 110 { |
| 111 } | 111 } |
| 112 | 112 |
| 113 } // namespace blink | 113 } // namespace blink |
| OLD | NEW |