| 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/presentation/PresentationRequest.h" | 5 #include "modules/presentation/PresentationRequest.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/CallbackPromiseAdapter.h" | 7 #include "bindings/core/v8/CallbackPromiseAdapter.h" |
| 8 #include "bindings/core/v8/ExceptionState.h" | 8 #include "bindings/core/v8/ExceptionState.h" |
| 9 #include "bindings/core/v8/ScriptPromise.h" | 9 #include "bindings/core/v8/ScriptPromise.h" |
| 10 #include "bindings/core/v8/ScriptPromiseResolver.h" | 10 #include "bindings/core/v8/ScriptPromiseResolver.h" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 const KURL& parsedUrl = KURL(executionContext->url(), urls[i]); | 85 const KURL& parsedUrl = KURL(executionContext->url(), urls[i]); |
| 86 | 86 |
| 87 if (!parsedUrl.isValid() || parsedUrl.protocolIsAbout()) { | 87 if (!parsedUrl.isValid() || parsedUrl.protocolIsAbout()) { |
| 88 exceptionState.throwDOMException( | 88 exceptionState.throwDOMException( |
| 89 SyntaxError, "'" + urls[i] + "' can't be resolved to a valid URL."); | 89 SyntaxError, "'" + urls[i] + "' can't be resolved to a valid URL."); |
| 90 return nullptr; | 90 return nullptr; |
| 91 } | 91 } |
| 92 | 92 |
| 93 if (MixedContentChecker::isMixedContent( | 93 if (MixedContentChecker::isMixedContent( |
| 94 executionContext->getSecurityOrigin(), parsedUrl)) { | 94 executionContext->getSecurityOrigin(), parsedUrl)) { |
| 95 exceptionState.throwDOMException( | 95 exceptionState.throwSecurityError( |
| 96 SecurityError, "Presentation of an insecure document [" + urls[i] + | 96 "Presentation of an insecure document [" + urls[i] + |
| 97 "] is prohibited from a secure context."); | 97 "] is prohibited from a secure context."); |
| 98 return nullptr; | 98 return nullptr; |
| 99 } | 99 } |
| 100 | 100 |
| 101 parsedUrls[i] = parsedUrl; | 101 parsedUrls[i] = parsedUrl; |
| 102 } | 102 } |
| 103 return new PresentationRequest(executionContext, parsedUrls); | 103 return new PresentationRequest(executionContext, parsedUrls); |
| 104 } | 104 } |
| 105 | 105 |
| 106 const AtomicString& PresentationRequest::interfaceName() const { | 106 const AtomicString& PresentationRequest::interfaceName() const { |
| 107 return EventTargetNames::PresentationRequest; | 107 return EventTargetNames::PresentationRequest; |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 visitor->trace(m_availabilityProperty); | 221 visitor->trace(m_availabilityProperty); |
| 222 EventTargetWithInlineData::trace(visitor); | 222 EventTargetWithInlineData::trace(visitor); |
| 223 ContextLifecycleObserver::trace(visitor); | 223 ContextLifecycleObserver::trace(visitor); |
| 224 } | 224 } |
| 225 | 225 |
| 226 PresentationRequest::PresentationRequest(ExecutionContext* executionContext, | 226 PresentationRequest::PresentationRequest(ExecutionContext* executionContext, |
| 227 const Vector<KURL>& urls) | 227 const Vector<KURL>& urls) |
| 228 : ContextLifecycleObserver(executionContext), m_urls(urls) {} | 228 : ContextLifecycleObserver(executionContext), m_urls(urls) {} |
| 229 | 229 |
| 230 } // namespace blink | 230 } // namespace blink |
| OLD | NEW |