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

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

Issue 1131513007: Reland (3rd try): Lazily initialize MessageLoop for faster thread startup (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove unnecessary include 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_android_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 593 matching lines...) Expand 10 before | Expand all | Expand 10 after
604 604
605 net::URLRequestContextGetter* IOThread::system_url_request_context_getter() { 605 net::URLRequestContextGetter* IOThread::system_url_request_context_getter() {
606 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 606 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
607 if (!system_url_request_context_getter_.get()) { 607 if (!system_url_request_context_getter_.get()) {
608 InitSystemRequestContext(); 608 InitSystemRequestContext();
609 } 609 }
610 return system_url_request_context_getter_.get(); 610 return system_url_request_context_getter_.get();
611 } 611 }
612 612
613 void IOThread::Init() { 613 void IOThread::Init() {
614 // Prefer to use InitAsync unless you need initialization to block
615 // the UI thread
616 }
617
618 void IOThread::InitAsync() {
619 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432 614 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432
620 // is fixed. 615 // is fixed.
621 tracked_objects::ScopedTracker tracking_profile1( 616 tracked_objects::ScopedTracker tracking_profile1(
622 FROM_HERE_WITH_EXPLICIT_FUNCTION("466432 IOThread::InitAsync::Start")); 617 FROM_HERE_WITH_EXPLICIT_FUNCTION("466432 IOThread::InitAsync::Start"));
623 TRACE_EVENT0("startup", "IOThread::InitAsync"); 618 TRACE_EVENT0("startup", "IOThread::InitAsync");
624 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 619 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
625 620
626 #if defined(USE_NSS_CERTS) || defined(OS_IOS) 621 #if defined(USE_NSS_CERTS) || defined(OS_IOS)
627 net::SetMessageLoopForNSSHttpIO(); 622 net::SetMessageLoopForNSSHttpIO();
628 #endif 623 #endif
(...skipping 992 matching lines...) Expand 10 before | Expand all | Expand 10 after
1621 net::QuicVersionVector supported_versions = net::QuicSupportedVersions(); 1616 net::QuicVersionVector supported_versions = net::QuicSupportedVersions();
1622 for (size_t i = 0; i < supported_versions.size(); ++i) { 1617 for (size_t i = 0; i < supported_versions.size(); ++i) {
1623 net::QuicVersion version = supported_versions[i]; 1618 net::QuicVersion version = supported_versions[i];
1624 if (net::QuicVersionToString(version) == quic_version) { 1619 if (net::QuicVersionToString(version) == quic_version) {
1625 return version; 1620 return version;
1626 } 1621 }
1627 } 1622 }
1628 1623
1629 return net::QUIC_VERSION_UNSUPPORTED; 1624 return net::QUIC_VERSION_UNSUPPORTED;
1630 } 1625 }
OLDNEW
« no previous file with comments | « chrome/browser/io_thread.h ('k') | chrome/browser/metrics/thread_watcher_android_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698