OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/chromeos/dbus/proxy_resolution_service_provider.h" | 5 #include "chrome/browser/chromeos/dbus/proxy_resolution_service_provider.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/threading/platform_thread.h" | 9 #include "base/threading/platform_thread.h" |
10 #include "chrome/browser/profiles/profile_manager.h" | 10 #include "chrome/browser/profiles/profile_manager.h" |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 private: | 109 private: |
110 // Helper function for ResolveProxy(). | 110 // Helper function for ResolveProxy(). |
111 static void ResolveProxyInternal( | 111 static void ResolveProxyInternal( |
112 Request* request, | 112 Request* request, |
113 scoped_refptr<net::URLRequestContextGetter> getter, | 113 scoped_refptr<net::URLRequestContextGetter> getter, |
114 scoped_refptr<dbus::ExportedObject> exported_object) { | 114 scoped_refptr<dbus::ExportedObject> exported_object) { |
115 // Make sure we're running on IO thread. | 115 // Make sure we're running on IO thread. |
116 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 116 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
117 | 117 |
118 // Check if we have the URLRequestContextGetter. | 118 // Check if we have the URLRequestContextGetter. |
119 if (!getter) { | 119 if (!getter.get()) { |
120 request->error_ = "No URLRequestContextGetter"; | 120 request->error_ = "No URLRequestContextGetter"; |
121 request->OnCompletion(net::ERR_UNEXPECTED); | 121 request->OnCompletion(net::ERR_UNEXPECTED); |
122 return; | 122 return; |
123 } | 123 } |
124 | 124 |
125 // Retrieve ProxyService from profile's request context. | 125 // Retrieve ProxyService from profile's request context. |
126 net::ProxyService* proxy_service = | 126 net::ProxyService* proxy_service = |
127 getter->GetURLRequestContext()->proxy_service(); | 127 getter->GetURLRequestContext()->proxy_service(); |
128 if (!proxy_service) { | 128 if (!proxy_service) { |
129 request->error_ = "No proxy service in chrome"; | 129 request->error_ = "No proxy service in chrome"; |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 ProxyResolutionServiceProvider* | 272 ProxyResolutionServiceProvider* |
273 ProxyResolutionServiceProvider::CreateForTesting( | 273 ProxyResolutionServiceProvider::CreateForTesting( |
274 ProxyResolverInterface* resolver) { | 274 ProxyResolverInterface* resolver) { |
275 return new ProxyResolutionServiceProvider(resolver); | 275 return new ProxyResolutionServiceProvider(resolver); |
276 } | 276 } |
277 | 277 |
278 ProxyResolverInterface::~ProxyResolverInterface() { | 278 ProxyResolverInterface::~ProxyResolverInterface() { |
279 } | 279 } |
280 | 280 |
281 } // namespace chromeos | 281 } // namespace chromeos |
OLD | NEW |