| 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 "net/proxy/in_process_mojo_proxy_resolver_factory.h" | 5 #include "net/proxy/in_process_mojo_proxy_resolver_factory.h" |
| 6 | 6 |
| 7 #include <utility> |
| 8 |
| 7 #include "base/memory/singleton.h" | 9 #include "base/memory/singleton.h" |
| 8 #include "net/proxy/mojo_proxy_resolver_factory_impl.h" | 10 #include "net/proxy/mojo_proxy_resolver_factory_impl.h" |
| 9 | 11 |
| 10 namespace net { | 12 namespace net { |
| 11 | 13 |
| 12 // static | 14 // static |
| 13 InProcessMojoProxyResolverFactory* | 15 InProcessMojoProxyResolverFactory* |
| 14 InProcessMojoProxyResolverFactory::GetInstance() { | 16 InProcessMojoProxyResolverFactory::GetInstance() { |
| 15 return base::Singleton<InProcessMojoProxyResolverFactory>::get(); | 17 return base::Singleton<InProcessMojoProxyResolverFactory>::get(); |
| 16 } | 18 } |
| 17 | 19 |
| 18 InProcessMojoProxyResolverFactory::InProcessMojoProxyResolverFactory() { | 20 InProcessMojoProxyResolverFactory::InProcessMojoProxyResolverFactory() { |
| 19 // Implementation lifetime is strongly bound to the life of the connection via | 21 // Implementation lifetime is strongly bound to the life of the connection via |
| 20 // |factory_|. When |factory_| is destroyed, the Mojo connection is terminated | 22 // |factory_|. When |factory_| is destroyed, the Mojo connection is terminated |
| 21 // which causes this object to be destroyed. | 23 // which causes this object to be destroyed. |
| 22 new MojoProxyResolverFactoryImpl(mojo::GetProxy(&factory_)); | 24 new MojoProxyResolverFactoryImpl(mojo::GetProxy(&factory_)); |
| 23 } | 25 } |
| 24 | 26 |
| 25 InProcessMojoProxyResolverFactory::~InProcessMojoProxyResolverFactory() = | 27 InProcessMojoProxyResolverFactory::~InProcessMojoProxyResolverFactory() = |
| 26 default; | 28 default; |
| 27 | 29 |
| 28 scoped_ptr<base::ScopedClosureRunner> | 30 scoped_ptr<base::ScopedClosureRunner> |
| 29 InProcessMojoProxyResolverFactory::CreateResolver( | 31 InProcessMojoProxyResolverFactory::CreateResolver( |
| 30 const mojo::String& pac_script, | 32 const mojo::String& pac_script, |
| 31 mojo::InterfaceRequest<interfaces::ProxyResolver> req, | 33 mojo::InterfaceRequest<interfaces::ProxyResolver> req, |
| 32 interfaces::ProxyResolverFactoryRequestClientPtr client) { | 34 interfaces::ProxyResolverFactoryRequestClientPtr client) { |
| 33 factory_->CreateResolver(pac_script, req.Pass(), client.Pass()); | 35 factory_->CreateResolver(pac_script, std::move(req), std::move(client)); |
| 34 return nullptr; | 36 return nullptr; |
| 35 } | 37 } |
| 36 | 38 |
| 37 } // namespace net | 39 } // namespace net |
| OLD | NEW |