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

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

Issue 1058603004: [Approach 3] Pre-allocate IncomigTaskQueue before MessageLoop for faster thread startup Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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 597 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 608
609 net::URLRequestContextGetter* IOThread::system_url_request_context_getter() { 609 net::URLRequestContextGetter* IOThread::system_url_request_context_getter() {
610 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 610 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
611 if (!system_url_request_context_getter_.get()) { 611 if (!system_url_request_context_getter_.get()) {
612 InitSystemRequestContext(); 612 InitSystemRequestContext();
613 } 613 }
614 return system_url_request_context_getter_.get(); 614 return system_url_request_context_getter_.get();
615 } 615 }
616 616
617 void IOThread::Init() { 617 void IOThread::Init() {
618 // Prefer to use InitAsync unless you need initialization to block
619 // the UI thread
620 }
621
622 void IOThread::InitAsync() {
623 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432 618 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432
624 // is fixed. 619 // is fixed.
625 tracked_objects::ScopedTracker tracking_profile1( 620 tracked_objects::ScopedTracker tracking_profile1(
626 FROM_HERE_WITH_EXPLICIT_FUNCTION("466432 IOThread::InitAsync::Start")); 621 FROM_HERE_WITH_EXPLICIT_FUNCTION("466432 IOThread::InitAsync::Start"));
627 TRACE_EVENT0("startup", "IOThread::InitAsync"); 622 TRACE_EVENT0("startup", "IOThread::InitAsync");
628 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 623 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
629 624
630 #if defined(USE_NSS) || defined(OS_IOS) 625 #if defined(USE_NSS) || defined(OS_IOS)
631 net::SetMessageLoopForNSSHttpIO(); 626 net::SetMessageLoopForNSSHttpIO();
632 #endif 627 #endif
(...skipping 968 matching lines...) Expand 10 before | Expand all | Expand 10 after
1601 net::QuicVersionVector supported_versions = net::QuicSupportedVersions(); 1596 net::QuicVersionVector supported_versions = net::QuicSupportedVersions();
1602 for (size_t i = 0; i < supported_versions.size(); ++i) { 1597 for (size_t i = 0; i < supported_versions.size(); ++i) {
1603 net::QuicVersion version = supported_versions[i]; 1598 net::QuicVersion version = supported_versions[i];
1604 if (net::QuicVersionToString(version) == quic_version) { 1599 if (net::QuicVersionToString(version) == quic_version) {
1605 return version; 1600 return version;
1606 } 1601 }
1607 } 1602 }
1608 1603
1609 return net::QUIC_VERSION_UNSUPPORTED; 1604 return net::QUIC_VERSION_UNSUPPORTED;
1610 } 1605 }
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