| 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 "modules/payments/PaymentInstruments.h" | 9 #include "modules/payments/PaymentInstruments.h" |
| 10 #include "modules/serviceworkers/ServiceWorkerRegistration.h" | 10 #include "modules/serviceworkers/ServiceWorkerRegistration.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 PaymentManager::PaymentManager(ServiceWorkerRegistration* registration) | 34 PaymentManager::PaymentManager(ServiceWorkerRegistration* registration) |
| 35 : registration_(registration), instruments_(nullptr) { | 35 : registration_(registration), instruments_(nullptr) { |
| 36 DCHECK(registration); | 36 DCHECK(registration); |
| 37 Platform::Current()->GetInterfaceProvider()->GetInterface( | 37 Platform::Current()->GetInterfaceProvider()->GetInterface( |
| 38 mojo::MakeRequest(&manager_)); | 38 mojo::MakeRequest(&manager_)); |
| 39 | 39 |
| 40 manager_.set_connection_error_handler(ConvertToBaseCallback(WTF::Bind( | 40 manager_.set_connection_error_handler(ConvertToBaseCallback(WTF::Bind( |
| 41 &PaymentManager::OnServiceConnectionError, WrapWeakPersistent(this)))); | 41 &PaymentManager::OnServiceConnectionError, WrapWeakPersistent(this)))); |
| 42 | 42 |
| 43 manager_->Init(registration_->scope()); | 43 manager_->Init(registration_->GetExecutionContext()->Url().GetString(), |
| 44 registration_->scope()); |
| 44 } | 45 } |
| 45 | 46 |
| 46 void PaymentManager::OnServiceConnectionError() { | 47 void PaymentManager::OnServiceConnectionError() { |
| 47 manager_.reset(); | 48 manager_.reset(); |
| 48 } | 49 } |
| 49 | 50 |
| 50 } // namespace blink | 51 } // namespace blink |
| OLD | NEW |