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

Side by Side Diff: chrome/browser/renderer_host/resource_dispatcher_host.cc

Issue 345037: Fifth patch in getting rid of caching MessageLoop pointers. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc e-loading 5 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc e-loading
6 6
7 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" 7 #include "chrome/browser/renderer_host/resource_dispatcher_host.h"
8 8
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/command_line.h" 11 #include "base/command_line.h"
12 #include "base/message_loop.h" 12 #include "base/message_loop.h"
cpu_(ooo_6.6-7.5) 2009/11/03 02:16:24 so that include is not needed?
jam 2009/11/03 03:52:47 for just a little bit longer, since we do MessageL
13 #include "base/scoped_ptr.h" 13 #include "base/scoped_ptr.h"
14 #include "base/shared_memory.h" 14 #include "base/shared_memory.h"
15 #include "base/stl_util-inl.h" 15 #include "base/stl_util-inl.h"
16 #include "base/time.h" 16 #include "base/time.h"
17 #include "chrome/browser/cert_store.h" 17 #include "chrome/browser/cert_store.h"
18 #include "chrome/browser/child_process_security_policy.h" 18 #include "chrome/browser/child_process_security_policy.h"
19 #include "chrome/browser/cross_site_request_manager.h" 19 #include "chrome/browser/cross_site_request_manager.h"
20 #include "chrome/browser/download/download_file.h" 20 #include "chrome/browser/download/download_file.h"
21 #include "chrome/browser/download/download_manager.h" 21 #include "chrome/browser/download/download_manager.h"
22 #include "chrome/browser/download/download_request_manager.h" 22 #include "chrome/browser/download/download_request_manager.h"
(...skipping 1016 matching lines...) Expand 10 before | Expand all | Expand 10 after
1039 net::AuthChallengeInfo* auth_info) { 1039 net::AuthChallengeInfo* auth_info) {
1040 // Create a login dialog on the UI thread to get authentication data, 1040 // Create a login dialog on the UI thread to get authentication data,
1041 // or pull from cache and continue on the IO thread. 1041 // or pull from cache and continue on the IO thread.
1042 // TODO(mpcomplete): We should block the parent tab while waiting for 1042 // TODO(mpcomplete): We should block the parent tab while waiting for
1043 // authentication. 1043 // authentication.
1044 // That would also solve the problem of the URLRequest being cancelled 1044 // That would also solve the problem of the URLRequest being cancelled
1045 // before we receive authentication. 1045 // before we receive authentication.
1046 ResourceDispatcherHostRequestInfo* info = InfoForRequest(request); 1046 ResourceDispatcherHostRequestInfo* info = InfoForRequest(request);
1047 DCHECK(!info->login_handler()) << 1047 DCHECK(!info->login_handler()) <<
1048 "OnAuthRequired called with login_handler pending"; 1048 "OnAuthRequired called with login_handler pending";
1049 info->set_login_handler(CreateLoginPrompt(auth_info, request, ui_loop_)); 1049 info->set_login_handler(CreateLoginPrompt(auth_info, request));
1050 } 1050 }
1051 1051
1052 void ResourceDispatcherHost::OnCertificateRequested( 1052 void ResourceDispatcherHost::OnCertificateRequested(
1053 URLRequest* request, 1053 URLRequest* request,
1054 net::SSLCertRequestInfo* cert_request_info) { 1054 net::SSLCertRequestInfo* cert_request_info) {
1055 DCHECK(request); 1055 DCHECK(request);
1056 1056
1057 #if defined(OS_LINUX) 1057 #if defined(OS_LINUX)
1058 bool select_first_cert = CommandLine::ForCurrentProcess()->HasSwitch( 1058 bool select_first_cert = CommandLine::ForCurrentProcess()->HasSwitch(
1059 switches::kAutoSSLClientAuth); 1059 switches::kAutoSSLClientAuth);
1060 net::X509Certificate* cert = 1060 net::X509Certificate* cert =
1061 select_first_cert && !cert_request_info->client_certs.empty() ? 1061 select_first_cert && !cert_request_info->client_certs.empty() ?
1062 cert_request_info->client_certs[0] : NULL; 1062 cert_request_info->client_certs[0] : NULL;
1063 request->ContinueWithCertificate(cert); 1063 request->ContinueWithCertificate(cert);
1064 #else 1064 #else
1065 if (cert_request_info->client_certs.empty()) { 1065 if (cert_request_info->client_certs.empty()) {
1066 // No need to query the user if there are no certs to choose from. 1066 // No need to query the user if there are no certs to choose from.
1067 request->ContinueWithCertificate(NULL); 1067 request->ContinueWithCertificate(NULL);
1068 return; 1068 return;
1069 } 1069 }
1070 1070
1071 ResourceDispatcherHostRequestInfo* info = InfoForRequest(request); 1071 ResourceDispatcherHostRequestInfo* info = InfoForRequest(request);
1072 DCHECK(!info->ssl_client_auth_handler()) << 1072 DCHECK(!info->ssl_client_auth_handler()) <<
1073 "OnCertificateRequested called with ssl_client_auth_handler pending"; 1073 "OnCertificateRequested called with ssl_client_auth_handler pending";
1074 info->set_ssl_client_auth_handler( 1074 info->set_ssl_client_auth_handler(
1075 new SSLClientAuthHandler(request, cert_request_info, io_loop_, ui_loop_)); 1075 new SSLClientAuthHandler(request, cert_request_info));
1076 info->ssl_client_auth_handler()->SelectCertificate(); 1076 info->ssl_client_auth_handler()->SelectCertificate();
1077 #endif 1077 #endif
1078 } 1078 }
1079 1079
1080 void ResourceDispatcherHost::OnSSLCertificateError( 1080 void ResourceDispatcherHost::OnSSLCertificateError(
1081 URLRequest* request, 1081 URLRequest* request,
1082 int cert_error, 1082 int cert_error,
1083 net::X509Certificate* cert) { 1083 net::X509Certificate* cert) {
1084 DCHECK(request); 1084 DCHECK(request);
1085 SSLManager::OnSSLCertificateError(this, request, cert_error, cert, ui_loop_); 1085 SSLManager::OnSSLCertificateError(this, request, cert_error, cert);
1086 } 1086 }
1087 1087
1088 void ResourceDispatcherHost::OnResponseStarted(URLRequest* request) { 1088 void ResourceDispatcherHost::OnResponseStarted(URLRequest* request) {
1089 RESOURCE_LOG("OnResponseStarted: " << request->url().spec()); 1089 RESOURCE_LOG("OnResponseStarted: " << request->url().spec());
1090 ResourceDispatcherHostRequestInfo* info = InfoForRequest(request); 1090 ResourceDispatcherHostRequestInfo* info = InfoForRequest(request);
1091 if (PauseRequestIfNeeded(info)) { 1091 if (PauseRequestIfNeeded(info)) {
1092 RESOURCE_LOG("OnResponseStarted pausing: " << request->url().spec()); 1092 RESOURCE_LOG("OnResponseStarted pausing: " << request->url().spec());
1093 return; 1093 return;
1094 } 1094 }
1095 1095
(...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after
1799 case ViewHostMsg_UploadProgress_ACK::ID: 1799 case ViewHostMsg_UploadProgress_ACK::ID:
1800 case ViewHostMsg_SyncLoad::ID: 1800 case ViewHostMsg_SyncLoad::ID:
1801 return true; 1801 return true;
1802 1802
1803 default: 1803 default:
1804 break; 1804 break;
1805 } 1805 }
1806 1806
1807 return false; 1807 return false;
1808 } 1808 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698