| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/payments/PaymentManager.h" | 5 #include "modules/payments/PaymentManager.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/ScriptPromise.h" | 7 #include "bindings/core/v8/ScriptPromise.h" |
| 8 #include "core/dom/DOMException.h" | 8 #include "core/dom/DOMException.h" |
| 9 #include "core/dom/Document.h" | 9 #include "core/dom/Document.h" |
| 10 #include "core/frame/LocalFrame.h" | 10 #include "core/frame/LocalFrame.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 if (frame) | 46 if (frame) |
| 47 frame->GetInterfaceProvider()->GetInterface(std::move(request)); | 47 frame->GetInterfaceProvider()->GetInterface(std::move(request)); |
| 48 } else if (context && context->IsWorkerGlobalScope()) { | 48 } else if (context && context->IsWorkerGlobalScope()) { |
| 49 WorkerThread* thread = ToWorkerGlobalScope(context)->GetThread(); | 49 WorkerThread* thread = ToWorkerGlobalScope(context)->GetThread(); |
| 50 if (thread) | 50 if (thread) |
| 51 thread->GetInterfaceProvider()->GetInterface(std::move(request)); | 51 thread->GetInterfaceProvider()->GetInterface(std::move(request)); |
| 52 } | 52 } |
| 53 | 53 |
| 54 manager_.set_connection_error_handler(ConvertToBaseCallback(WTF::Bind( | 54 manager_.set_connection_error_handler(ConvertToBaseCallback(WTF::Bind( |
| 55 &PaymentManager::OnServiceConnectionError, WrapWeakPersistent(this)))); | 55 &PaymentManager::OnServiceConnectionError, WrapWeakPersistent(this)))); |
| 56 manager_->Init(registration_->scope()); | 56 manager_->Init(registration_->GetExecutionContext()->Url().GetString(), |
| 57 registration_->scope()); |
| 57 } | 58 } |
| 58 | 59 |
| 59 void PaymentManager::OnServiceConnectionError() { | 60 void PaymentManager::OnServiceConnectionError() { |
| 60 manager_.reset(); | 61 manager_.reset(); |
| 61 } | 62 } |
| 62 | 63 |
| 63 } // namespace blink | 64 } // namespace blink |
| OLD | NEW |