OLD | NEW |
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 // 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 "content/browser/renderer_host/resource_dispatcher_host.h" | 7 #include "content/browser/renderer_host/resource_dispatcher_host.h" |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
(...skipping 1417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1428 } | 1428 } |
1429 | 1429 |
1430 void ResourceDispatcherHost::OnSSLCertificateError( | 1430 void ResourceDispatcherHost::OnSSLCertificateError( |
1431 net::URLRequest* request, | 1431 net::URLRequest* request, |
1432 const net::SSLInfo& ssl_info, | 1432 const net::SSLInfo& ssl_info, |
1433 bool is_hsts_host) { | 1433 bool is_hsts_host) { |
1434 DCHECK(request); | 1434 DCHECK(request); |
1435 SSLManager::OnSSLCertificateError(this, request, ssl_info, is_hsts_host); | 1435 SSLManager::OnSSLCertificateError(this, request, ssl_info, is_hsts_host); |
1436 } | 1436 } |
1437 | 1437 |
1438 bool ResourceDispatcherHost::CanGetCookies( | |
1439 const net::URLRequest* request, | |
1440 const net::CookieList& cookie_list) const { | |
1441 VLOG(1) << "OnGetCookies: " << request->url().spec(); | |
1442 int render_process_id, render_view_id; | |
1443 if (!RenderViewForRequest(request, &render_process_id, &render_view_id)) | |
1444 return false; | |
1445 | |
1446 const ResourceRequestInfoImpl* info = InfoForRequest(request); | |
1447 | |
1448 return content::GetContentClient()->browser()->AllowGetCookie( | |
1449 request->url(), request->first_party_for_cookies(), cookie_list, | |
1450 info->GetContext(), render_process_id, render_view_id); | |
1451 } | |
1452 | |
1453 bool ResourceDispatcherHost::CanSetCookie(const net::URLRequest* request, | |
1454 const std::string& cookie_line, | |
1455 net::CookieOptions* options) const { | |
1456 VLOG(1) << "OnSetCookie: " << request->url().spec(); | |
1457 | |
1458 int render_process_id, render_view_id; | |
1459 if (!RenderViewForRequest(request, &render_process_id, &render_view_id)) | |
1460 return false; | |
1461 | |
1462 const ResourceRequestInfoImpl* info = InfoForRequest(request); | |
1463 return content::GetContentClient()->browser()->AllowSetCookie( | |
1464 request->url(), request->first_party_for_cookies(), cookie_line, | |
1465 info->GetContext(), render_process_id, render_view_id, options); | |
1466 } | |
1467 | |
1468 void ResourceDispatcherHost::OnResponseStarted(net::URLRequest* request) { | 1438 void ResourceDispatcherHost::OnResponseStarted(net::URLRequest* request) { |
1469 VLOG(1) << "OnResponseStarted: " << request->url().spec(); | 1439 VLOG(1) << "OnResponseStarted: " << request->url().spec(); |
1470 ResourceRequestInfoImpl* info = InfoForRequest(request); | 1440 ResourceRequestInfoImpl* info = InfoForRequest(request); |
1471 | 1441 |
1472 if (request->status().is_success()) { | 1442 if (request->status().is_success()) { |
1473 if (PauseRequestIfNeeded(info)) { | 1443 if (PauseRequestIfNeeded(info)) { |
1474 VLOG(1) << "OnResponseStarted pausing: " << request->url().spec(); | 1444 VLOG(1) << "OnResponseStarted pausing: " << request->url().spec(); |
1475 return; | 1445 return; |
1476 } | 1446 } |
1477 | 1447 |
(...skipping 801 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2279 scoped_refptr<ResourceHandler> transferred_resource_handler( | 2249 scoped_refptr<ResourceHandler> transferred_resource_handler( |
2280 new DoomedResourceHandler(info->resource_handler())); | 2250 new DoomedResourceHandler(info->resource_handler())); |
2281 info->set_resource_handler(transferred_resource_handler.get()); | 2251 info->set_resource_handler(transferred_resource_handler.get()); |
2282 } | 2252 } |
2283 | 2253 |
2284 bool ResourceDispatcherHost::IsTransferredNavigation( | 2254 bool ResourceDispatcherHost::IsTransferredNavigation( |
2285 const content::GlobalRequestID& transferred_request_id) const { | 2255 const content::GlobalRequestID& transferred_request_id) const { |
2286 return transferred_navigations_.find(transferred_request_id) != | 2256 return transferred_navigations_.find(transferred_request_id) != |
2287 transferred_navigations_.end(); | 2257 transferred_navigations_.end(); |
2288 } | 2258 } |
OLD | NEW |