Chromium Code Reviews| Index: content/browser/payments/payment_app_context_impl.cc |
| diff --git a/content/browser/payments/payment_app_context.cc b/content/browser/payments/payment_app_context_impl.cc |
| similarity index 63% |
| rename from content/browser/payments/payment_app_context.cc |
| rename to content/browser/payments/payment_app_context_impl.cc |
| index 8fc961a5243d3821e1b51dc9484f882fa653e4f7..7672a947c3f0b68341be0a899920c02280e51c43 100644 |
| --- a/content/browser/payments/payment_app_context.cc |
| +++ b/content/browser/payments/payment_app_context_impl.cc |
| @@ -2,7 +2,7 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#include "content/browser/payments/payment_app_context.h" |
| +#include "content/browser/payments/payment_app_context_impl.h" |
| #include <utility> |
| @@ -15,52 +15,60 @@ |
| namespace content { |
| -PaymentAppContext::PaymentAppContext( |
| +PaymentAppContextImpl::PaymentAppContextImpl( |
| scoped_refptr<ServiceWorkerContextWrapper> service_worker_context) |
| : service_worker_context_(std::move(service_worker_context)) { |
| DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| } |
| -PaymentAppContext::~PaymentAppContext() { |
| +PaymentAppContextImpl::~PaymentAppContextImpl() { |
| DCHECK(services_.empty()); |
|
please use gerrit instead
2016/12/14 17:39:40
Put the destructor right after GetAllManifests().
zino
2016/12/14 17:48:01
Done.
|
| } |
| -void PaymentAppContext::Shutdown() { |
| +void PaymentAppContextImpl::Shutdown() { |
| DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| - BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, |
| - base::Bind(&PaymentAppContext::ShutdownOnIO, this)); |
| + BrowserThread::PostTask( |
| + BrowserThread::IO, FROM_HERE, |
| + base::Bind(&PaymentAppContextImpl::ShutdownOnIO, this)); |
| } |
| -void PaymentAppContext::CreateService( |
| +void PaymentAppContextImpl::CreateService( |
| mojo::InterfaceRequest<payments::mojom::PaymentAppManager> request) { |
| DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| BrowserThread::PostTask( |
| BrowserThread::IO, FROM_HERE, |
| - base::Bind(&PaymentAppContext::CreateServiceOnIOThread, this, |
| + base::Bind(&PaymentAppContextImpl::CreateServiceOnIOThread, this, |
| base::Passed(&request))); |
| } |
| -void PaymentAppContext::ServiceHadConnectionError(PaymentAppManager* service) { |
| +void PaymentAppContextImpl::ServiceHadConnectionError( |
| + PaymentAppManager* service) { |
| DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| DCHECK(base::ContainsKey(services_, service)); |
| services_.erase(service); |
| } |
| -ServiceWorkerContextWrapper* PaymentAppContext::service_worker_context() const { |
| +ServiceWorkerContextWrapper* PaymentAppContextImpl::service_worker_context() |
| + const { |
| return service_worker_context_.get(); |
| } |
| -void PaymentAppContext::CreateServiceOnIOThread( |
| +void PaymentAppContextImpl::GetAllManifests( |
| + const GetAllManifestsCallback& callback) { |
| + NOTIMPLEMENTED(); |
| +} |
| + |
| +void PaymentAppContextImpl::CreateServiceOnIOThread( |
| mojo::InterfaceRequest<payments::mojom::PaymentAppManager> request) { |
| DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| PaymentAppManager* service = new PaymentAppManager(this, std::move(request)); |
| services_[service] = base::WrapUnique(service); |
| } |
| -void PaymentAppContext::ShutdownOnIO() { |
| +void PaymentAppContextImpl::ShutdownOnIO() { |
| DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| services_.clear(); |