OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 |
(...skipping 1060 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1071 } | 1071 } |
1072 | 1072 |
1073 void ResourceDispatcherHost::OnSSLCertificateError( | 1073 void ResourceDispatcherHost::OnSSLCertificateError( |
1074 URLRequest* request, | 1074 URLRequest* request, |
1075 int cert_error, | 1075 int cert_error, |
1076 net::X509Certificate* cert) { | 1076 net::X509Certificate* cert) { |
1077 DCHECK(request); | 1077 DCHECK(request); |
1078 SSLManager::OnSSLCertificateError(this, request, cert_error, cert); | 1078 SSLManager::OnSSLCertificateError(this, request, cert_error, cert); |
1079 } | 1079 } |
1080 | 1080 |
1081 void ResourceDispatcherHost::OnGetCookies( | |
1082 URLRequest* request, | |
1083 bool blocked_by_policy) { | |
1084 VLOG(1) << "OnGetCookies: " << request->url().spec(); | |
1085 | |
1086 int render_process_id, render_view_id; | |
1087 if (!RenderViewForRequest(request, &render_process_id, &render_view_id)) | |
1088 return; | |
1089 | |
1090 ChromeURLRequestContext* context = | |
1091 static_cast<ChromeURLRequestContext*>(request->context()); | |
1092 if (context->IsExternal()) | |
1093 return; | |
1094 | |
1095 net::CookieOptions options; | |
1096 options.set_include_httponly(); | |
1097 CallRenderViewHostContentSettingsDelegate( | |
1098 render_process_id, render_view_id, | |
1099 &RenderViewHostDelegate::ContentSettings::OnCookiesRead, | |
1100 request->url(), context->cookie_store()->GetCookieMonster(), options, | |
1101 blocked_by_policy); | |
1102 } | |
1103 | |
1081 void ResourceDispatcherHost::OnSetCookie(URLRequest* request, | 1104 void ResourceDispatcherHost::OnSetCookie(URLRequest* request, |
1082 const std::string& cookie_line, | 1105 const std::string& cookie_line, |
1083 const net::CookieOptions& options, | 1106 const net::CookieOptions& options, |
1084 bool blocked_by_policy) { | 1107 bool blocked_by_policy) { |
1085 VLOG(1) << "OnSetCookie: " << request->url().spec(); | 1108 VLOG(1) << "OnSetCookie: " << request->url().spec(); |
1086 | 1109 |
1087 int render_process_id, render_view_id; | 1110 int render_process_id, render_view_id; |
1088 if (!RenderViewForRequest(request, &render_process_id, &render_view_id)) | 1111 if (!RenderViewForRequest(request, &render_process_id, &render_view_id)) |
1089 return; | 1112 return; |
1090 | 1113 |
1091 CallRenderViewHostContentSettingsDelegate( | 1114 CallRenderViewHostContentSettingsDelegate( |
1092 render_process_id, render_view_id, | 1115 render_process_id, render_view_id, |
1093 &RenderViewHostDelegate::ContentSettings::OnCookieAccessed, | 1116 &RenderViewHostDelegate::ContentSettings::OnCookieAccessed, |
darin (slow to review)
2010/11/30 18:24:11
it seems like OnCookieAccessed should be renamed t
jochen (gone - plz use gerrit)
2010/12/03 16:02:32
Done.
| |
1094 request->url(), cookie_line, options, blocked_by_policy); | 1117 request->url(), cookie_line, options, blocked_by_policy); |
1095 } | 1118 } |
1096 | 1119 |
1097 void ResourceDispatcherHost::OnResponseStarted(URLRequest* request) { | 1120 void ResourceDispatcherHost::OnResponseStarted(URLRequest* request) { |
1098 VLOG(1) << "OnResponseStarted: " << request->url().spec(); | 1121 VLOG(1) << "OnResponseStarted: " << request->url().spec(); |
1099 ResourceDispatcherHostRequestInfo* info = InfoForRequest(request); | 1122 ResourceDispatcherHostRequestInfo* info = InfoForRequest(request); |
1100 if (PauseRequestIfNeeded(info)) { | 1123 if (PauseRequestIfNeeded(info)) { |
1101 VLOG(1) << "OnResponseStarted pausing: " << request->url().spec(); | 1124 VLOG(1) << "OnResponseStarted pausing: " << request->url().spec(); |
1102 return; | 1125 return; |
1103 } | 1126 } |
(...skipping 828 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1932 return is_prefetch_enabled_; | 1955 return is_prefetch_enabled_; |
1933 } | 1956 } |
1934 | 1957 |
1935 // static | 1958 // static |
1936 void ResourceDispatcherHost::set_is_prefetch_enabled(bool value) { | 1959 void ResourceDispatcherHost::set_is_prefetch_enabled(bool value) { |
1937 is_prefetch_enabled_ = value; | 1960 is_prefetch_enabled_ = value; |
1938 } | 1961 } |
1939 | 1962 |
1940 // static | 1963 // static |
1941 bool ResourceDispatcherHost::is_prefetch_enabled_ = false; | 1964 bool ResourceDispatcherHost::is_prefetch_enabled_ = false; |
OLD | NEW |