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

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

Issue 1122383003: Revert of Lazily initialize MessageLoop for faster thread startup (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/io_thread.h ('k') | chrome/browser/metrics/thread_watcher_unittest.cc » ('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) 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/io_thread.h" 5 #include "chrome/browser/io_thread.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/base64.h" 9 #include "base/base64.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after
612 612
613 net::URLRequestContextGetter* IOThread::system_url_request_context_getter() { 613 net::URLRequestContextGetter* IOThread::system_url_request_context_getter() {
614 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 614 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
615 if (!system_url_request_context_getter_.get()) { 615 if (!system_url_request_context_getter_.get()) {
616 InitSystemRequestContext(); 616 InitSystemRequestContext();
617 } 617 }
618 return system_url_request_context_getter_.get(); 618 return system_url_request_context_getter_.get();
619 } 619 }
620 620
621 void IOThread::Init() { 621 void IOThread::Init() {
622 // Prefer to use InitAsync unless you need initialization to block
623 // the UI thread
624 }
625
626 void IOThread::InitAsync() {
622 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432 627 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432
623 // is fixed. 628 // is fixed.
624 tracked_objects::ScopedTracker tracking_profile1( 629 tracked_objects::ScopedTracker tracking_profile1(
625 FROM_HERE_WITH_EXPLICIT_FUNCTION("466432 IOThread::InitAsync::Start")); 630 FROM_HERE_WITH_EXPLICIT_FUNCTION("466432 IOThread::InitAsync::Start"));
626 TRACE_EVENT0("startup", "IOThread::InitAsync"); 631 TRACE_EVENT0("startup", "IOThread::InitAsync");
627 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 632 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
628 633
629 #if defined(USE_NSS_CERTS) || defined(OS_IOS) 634 #if defined(USE_NSS_CERTS) || defined(OS_IOS)
630 net::SetMessageLoopForNSSHttpIO(); 635 net::SetMessageLoopForNSSHttpIO();
631 #endif 636 #endif
(...skipping 1007 matching lines...) Expand 10 before | Expand all | Expand 10 after
1639 net::QuicVersionVector supported_versions = net::QuicSupportedVersions(); 1644 net::QuicVersionVector supported_versions = net::QuicSupportedVersions();
1640 for (size_t i = 0; i < supported_versions.size(); ++i) { 1645 for (size_t i = 0; i < supported_versions.size(); ++i) {
1641 net::QuicVersion version = supported_versions[i]; 1646 net::QuicVersion version = supported_versions[i];
1642 if (net::QuicVersionToString(version) == quic_version) { 1647 if (net::QuicVersionToString(version) == quic_version) {
1643 return version; 1648 return version;
1644 } 1649 }
1645 } 1650 }
1646 1651
1647 return net::QUIC_VERSION_UNSUPPORTED; 1652 return net::QUIC_VERSION_UNSUPPORTED;
1648 } 1653 }
OLDNEW
« no previous file with comments | « chrome/browser/io_thread.h ('k') | chrome/browser/metrics/thread_watcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698