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

Side by Side Diff: chrome/browser/chromeos/login/auth/auth_prewarmer.cc

Issue 2004453002: Add a Dns preresolve interface in //content (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@predictor_dns_browsertest
Patch Set: remove controller class Created 4 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/chromeos/login/auth/auth_prewarmer.h" 5 #include "chrome/browser/chromeos/login/auth/auth_prewarmer.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "chrome/browser/chrome_notification_types.h" 9 #include "chrome/browser/chrome_notification_types.h"
10 #include "chrome/browser/chromeos/login/helper.h" 10 #include "chrome/browser/chromeos/login/helper.h"
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 default: 89 default:
90 NOTREACHED(); 90 NOTREACHED();
91 } 91 }
92 } 92 }
93 93
94 void AuthPrewarmer::DoPrewarm() { 94 void AuthPrewarmer::DoPrewarm() {
95 const int kConnectionsNeeded = 1; 95 const int kConnectionsNeeded = 1;
96 const GURL& url = GaiaUrls::GetInstance()->service_login_url(); 96 const GURL& url = GaiaUrls::GetInstance()->service_login_url();
97 content::BrowserThread::PostTask( 97 content::BrowserThread::PostTask(
98 content::BrowserThread::IO, FROM_HERE, 98 content::BrowserThread::IO, FROM_HERE,
99 base::Bind(&content::PreconnectUrl, 99 base::Bind(&content::PreconnectUrl, login::GetSigninResourceContext(),
achuithb 2016/05/25 21:17:10 Why not ProfileHelper::GetSigninProfile()->GetReso
Charlie Harrison 2016/05/25 21:36:19 That's much better. Done.
100 base::RetainedRef(GetRequestContext()), url, url, 100 url, url, kConnectionsNeeded, true,
101 kConnectionsNeeded, true,
102 net::HttpRequestInfo::EARLY_LOAD_MOTIVATED)); 101 net::HttpRequestInfo::EARLY_LOAD_MOTIVATED));
103 if (!completion_callback_.is_null()) { 102 if (!completion_callback_.is_null()) {
104 content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, 103 content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE,
105 completion_callback_); 104 completion_callback_);
106 } 105 }
107 } 106 }
108 107
109 bool AuthPrewarmer::IsNetworkConnected() const { 108 bool AuthPrewarmer::IsNetworkConnected() const {
110 NetworkStateHandler* nsh = NetworkHandler::Get()->network_state_handler(); 109 NetworkStateHandler* nsh = NetworkHandler::Get()->network_state_handler();
111 return (nsh->ConnectedNetworkByType(NetworkTypePattern::Default()) != NULL); 110 return (nsh->ConnectedNetworkByType(NetworkTypePattern::Default()) != NULL);
112 } 111 }
113 112
114 net::URLRequestContextGetter* AuthPrewarmer::GetRequestContext() const { 113 net::URLRequestContextGetter* AuthPrewarmer::GetRequestContext() const {
115 return login::GetSigninContext(); 114 return login::GetSigninContext();
116 } 115 }
117 116
118 } // namespace chromeos 117 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/helper.h » ('j') | chrome/browser/chromeos/login/helper.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698