Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(92)

Side by Side Diff: chrome/browser/net/utility_process_mojo_proxy_resolver_factory.cc

Issue 1121213002: [chrome/browser/net] Replace MessageLoopProxy usage with ThreadTaskRunnerHandle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed Review Comments Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/net/quota_policy_channel_id_store_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "chrome/browser/net/utility_process_mojo_proxy_resolver_factory.h" 5 #include "chrome/browser/net/utility_process_mojo_proxy_resolver_factory.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/singleton.h" 8 #include "base/memory/singleton.h"
9 #include "base/single_thread_task_runner.h"
10 #include "base/thread_task_runner_handle.h"
9 #include "chrome/grit/generated_resources.h" 11 #include "chrome/grit/generated_resources.h"
10 #include "content/public/browser/browser_thread.h" 12 #include "content/public/browser/browser_thread.h"
11 #include "content/public/browser/utility_process_host.h" 13 #include "content/public/browser/utility_process_host.h"
12 #include "content/public/browser/utility_process_host_client.h" 14 #include "content/public/browser/utility_process_host_client.h"
13 #include "content/public/common/service_registry.h" 15 #include "content/public/common/service_registry.h"
14 #include "ui/base/l10n/l10n_util.h" 16 #include "ui/base/l10n/l10n_util.h"
15 17
16 // static 18 // static
17 UtilityProcessMojoProxyResolverFactory* 19 UtilityProcessMojoProxyResolverFactory*
18 UtilityProcessMojoProxyResolverFactory::GetInstance() { 20 UtilityProcessMojoProxyResolverFactory::GetInstance() {
(...skipping 11 matching lines...) Expand all
30 UtilityProcessMojoProxyResolverFactory:: 32 UtilityProcessMojoProxyResolverFactory::
31 ~UtilityProcessMojoProxyResolverFactory() { 33 ~UtilityProcessMojoProxyResolverFactory() {
32 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); 34 DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
33 } 35 }
34 36
35 void UtilityProcessMojoProxyResolverFactory::CreateProcessAndConnect() { 37 void UtilityProcessMojoProxyResolverFactory::CreateProcessAndConnect() {
36 DVLOG(1) << "Attempting to create utility process for proxy resolver"; 38 DVLOG(1) << "Attempting to create utility process for proxy resolver";
37 content::UtilityProcessHost* utility_process_host = 39 content::UtilityProcessHost* utility_process_host =
38 content::UtilityProcessHost::Create( 40 content::UtilityProcessHost::Create(
39 scoped_refptr<content::UtilityProcessHostClient>(), 41 scoped_refptr<content::UtilityProcessHostClient>(),
40 base::MessageLoopProxy::current().get()); 42 base::ThreadTaskRunnerHandle::Get());
41 utility_process_host->SetName(l10n_util::GetStringUTF16( 43 utility_process_host->SetName(l10n_util::GetStringUTF16(
42 IDS_UTILITY_PROCESS_PROXY_RESOLVER_NAME)); 44 IDS_UTILITY_PROCESS_PROXY_RESOLVER_NAME));
43 bool process_started = utility_process_host->StartMojoMode(); 45 bool process_started = utility_process_host->StartMojoMode();
44 if (process_started) { 46 if (process_started) {
45 content::ServiceRegistry* service_registry = 47 content::ServiceRegistry* service_registry =
46 utility_process_host->GetServiceRegistry(); 48 utility_process_host->GetServiceRegistry();
47 service_registry->ConnectToRemoteService(&resolver_factory_); 49 service_registry->ConnectToRemoteService(&resolver_factory_);
48 resolver_factory_.set_error_handler(this); 50 resolver_factory_.set_error_handler(this);
49 } else { 51 } else {
50 LOG(ERROR) << "Unable to connect to utility process"; 52 LOG(ERROR) << "Unable to connect to utility process";
(...skipping 16 matching lines...) Expand all
67 return; 69 return;
68 } 70 }
69 resolver_factory_->CreateResolver(pac_script, req.Pass(), 71 resolver_factory_->CreateResolver(pac_script, req.Pass(),
70 host_resolver.Pass(), client.Pass()); 72 host_resolver.Pass(), client.Pass());
71 } 73 }
72 74
73 void UtilityProcessMojoProxyResolverFactory::OnConnectionError() { 75 void UtilityProcessMojoProxyResolverFactory::OnConnectionError() {
74 DVLOG(1) << "Disconnection from utility process detected"; 76 DVLOG(1) << "Disconnection from utility process detected";
75 resolver_factory_.reset(); 77 resolver_factory_.reset();
76 } 78 }
OLDNEW
« no previous file with comments | « chrome/browser/net/quota_policy_channel_id_store_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698