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

Side by Side Diff: chrome/browser/io_thread.cc

Issue 3391028: Reland r59972: Eagerly set the IO loop used for OCSP. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Address wtc comments. Created 10 years, 2 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/browser_main.cc ('k') | chrome/browser/net/chrome_url_request_context.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/io_thread.h" 5 #include "chrome/browser/io_thread.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/leak_tracker.h" 8 #include "base/leak_tracker.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/string_number_conversions.h" 10 #include "base/string_number_conversions.h"
11 #include "base/string_util.h" 11 #include "base/string_util.h"
12 #include "chrome/browser/browser_process.h" 12 #include "chrome/browser/browser_process.h"
13 #include "chrome/browser/chrome_thread.h" 13 #include "chrome/browser/chrome_thread.h"
14 #include "chrome/browser/gpu_process_host.h" 14 #include "chrome/browser/gpu_process_host.h"
15 #include "chrome/browser/net/chrome_net_log.h" 15 #include "chrome/browser/net/chrome_net_log.h"
16 #include "chrome/browser/net/predictor_api.h" 16 #include "chrome/browser/net/predictor_api.h"
17 #include "chrome/browser/net/passive_log_collector.h" 17 #include "chrome/browser/net/passive_log_collector.h"
18 #include "chrome/common/chrome_switches.h" 18 #include "chrome/common/chrome_switches.h"
19 #include "chrome/common/net/url_fetcher.h" 19 #include "chrome/common/net/url_fetcher.h"
20 #include "net/base/mapped_host_resolver.h" 20 #include "net/base/mapped_host_resolver.h"
21 #include "net/base/host_cache.h" 21 #include "net/base/host_cache.h"
22 #include "net/base/host_resolver.h" 22 #include "net/base/host_resolver.h"
23 #include "net/base/host_resolver_impl.h" 23 #include "net/base/host_resolver_impl.h"
24 #include "net/base/net_util.h" 24 #include "net/base/net_util.h"
25 #include "net/http/http_auth_filter.h" 25 #include "net/http/http_auth_filter.h"
26 #include "net/http/http_auth_handler_factory.h" 26 #include "net/http/http_auth_handler_factory.h"
27 #if defined(USE_NSS)
28 #include "net/ocsp/nss_ocsp.h"
29 #endif // defined(USE_NSS)
27 30
28 namespace { 31 namespace {
29 32
30 net::HostResolver* CreateGlobalHostResolver(net::NetLog* net_log) { 33 net::HostResolver* CreateGlobalHostResolver(net::NetLog* net_log) {
31 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 34 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
32 35
33 size_t parallelism = net::HostResolver::kDefaultParallelism; 36 size_t parallelism = net::HostResolver::kDefaultParallelism;
34 37
35 // Use the concurrency override from the command-line, if any. 38 // Use the concurrency override from the command-line, if any.
36 if (command_line.HasSwitch(switches::kHostResolverParallelism)) { 39 if (command_line.HasSwitch(switches::kHostResolverParallelism)) {
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 message_loop()->PostTask( 153 message_loop()->PostTask(
151 FROM_HERE, 154 FROM_HERE,
152 NewRunnableMethod( 155 NewRunnableMethod(
153 this, 156 this,
154 &IOThread::ChangedToOnTheRecordOnIOThread)); 157 &IOThread::ChangedToOnTheRecordOnIOThread));
155 } 158 }
156 159
157 void IOThread::Init() { 160 void IOThread::Init() {
158 BrowserProcessSubThread::Init(); 161 BrowserProcessSubThread::Init();
159 162
163 DCHECK_EQ(MessageLoop::TYPE_IO, message_loop()->type());
164
165 #if defined(USE_NSS)
166 net::SetMessageLoopForOCSP();
167 #endif // defined(USE_NSS)
168
160 DCHECK(!globals_); 169 DCHECK(!globals_);
161 globals_ = new Globals; 170 globals_ = new Globals;
162 171
163 globals_->net_log.reset(new ChromeNetLog()); 172 globals_->net_log.reset(new ChromeNetLog());
164 173
165 // Add an observer that will emit network change events to the ChromeNetLog. 174 // Add an observer that will emit network change events to the ChromeNetLog.
166 // Assuming NetworkChangeNotifier dispatches in FIFO order, we should be 175 // Assuming NetworkChangeNotifier dispatches in FIFO order, we should be
167 // logging the network change before other IO thread consumers respond to it. 176 // logging the network change before other IO thread consumers respond to it.
168 network_change_observer_.reset( 177 network_change_observer_.reset(
169 new LoggingNetworkChangeObserver(globals_->net_log.get())); 178 new LoggingNetworkChangeObserver(globals_->net_log.get()));
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 net::HostCache* host_cache = 314 net::HostCache* host_cache =
306 globals_->host_resolver.get()->GetAsHostResolverImpl()->cache(); 315 globals_->host_resolver.get()->GetAsHostResolverImpl()->cache();
307 if (host_cache) 316 if (host_cache)
308 host_cache->clear(); 317 host_cache->clear();
309 } 318 }
310 // Clear all of the passively logged data. 319 // Clear all of the passively logged data.
311 // TODO(eroman): this is a bit heavy handed, really all we need to do is 320 // TODO(eroman): this is a bit heavy handed, really all we need to do is
312 // clear the data pertaining to off the record context. 321 // clear the data pertaining to off the record context.
313 globals_->net_log->passive_collector()->Clear(); 322 globals_->net_log->passive_collector()->Clear();
314 } 323 }
OLDNEW
« no previous file with comments | « chrome/browser/browser_main.cc ('k') | chrome/browser/net/chrome_url_request_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698