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 #include "content/browser/loader/cross_site_resource_handler.h" | 5 #include "content/browser/loader/cross_site_resource_handler.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "content/browser/appcache/appcache_interceptor.h" | 12 #include "content/browser/appcache/appcache_interceptor.h" |
13 #include "content/browser/child_process_security_policy_impl.h" | 13 #include "content/browser/child_process_security_policy_impl.h" |
14 #include "content/browser/frame_host/cross_site_transferring_request.h" | 14 #include "content/browser/frame_host/cross_site_transferring_request.h" |
15 #include "content/browser/frame_host/render_frame_host_impl.h" | 15 #include "content/browser/frame_host/render_frame_host_impl.h" |
16 #include "content/browser/loader/resource_dispatcher_host_impl.h" | 16 #include "content/browser/loader/resource_dispatcher_host_impl.h" |
17 #include "content/browser/loader/resource_request_info_impl.h" | 17 #include "content/browser/loader/resource_request_info_impl.h" |
18 #include "content/browser/service_worker/service_worker_request_handler.h" | |
falken
2014/12/08 07:32:15
not needed?
michaeln
2014/12/08 23:56:43
Done.
| |
18 #include "content/browser/site_instance_impl.h" | 19 #include "content/browser/site_instance_impl.h" |
19 #include "content/browser/transition_request_manager.h" | 20 #include "content/browser/transition_request_manager.h" |
20 #include "content/public/browser/browser_thread.h" | 21 #include "content/public/browser/browser_thread.h" |
21 #include "content/public/browser/content_browser_client.h" | 22 #include "content/public/browser/content_browser_client.h" |
22 #include "content/public/browser/global_request_id.h" | 23 #include "content/public/browser/global_request_id.h" |
23 #include "content/public/browser/resource_controller.h" | 24 #include "content/public/browser/resource_controller.h" |
24 #include "content/public/browser/site_instance.h" | 25 #include "content/public/browser/site_instance.h" |
25 #include "content/public/common/content_switches.h" | 26 #include "content/public/common/content_switches.h" |
26 #include "content/public/common/resource_response.h" | 27 #include "content/public/common/resource_response.h" |
27 #include "content/public/common/url_constants.h" | 28 #include "content/public/common/url_constants.h" |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
360 // is starting, so that it can tell its old renderer to run its onunload | 361 // is starting, so that it can tell its old renderer to run its onunload |
361 // handler now. We will wait until the unload is finished and (if a transfer | 362 // handler now. We will wait until the unload is finished and (if a transfer |
362 // is needed) for the new renderer's request to arrive. | 363 // is needed) for the new renderer's request to arrive. |
363 // The |transfer_url_chain| contains any redirect URLs that have already | 364 // The |transfer_url_chain| contains any redirect URLs that have already |
364 // occurred, plus the destination URL at the end. | 365 // occurred, plus the destination URL at the end. |
365 std::vector<GURL> transfer_url_chain; | 366 std::vector<GURL> transfer_url_chain; |
366 Referrer referrer; | 367 Referrer referrer; |
367 int render_frame_id = info->GetRenderFrameID(); | 368 int render_frame_id = info->GetRenderFrameID(); |
368 transfer_url_chain = request()->url_chain(); | 369 transfer_url_chain = request()->url_chain(); |
369 referrer = Referrer(GURL(request()->referrer()), info->GetReferrerPolicy()); | 370 referrer = Referrer(GURL(request()->referrer()), info->GetReferrerPolicy()); |
370 | |
371 AppCacheInterceptor::PrepareForCrossSiteTransfer( | |
372 request(), global_id.child_id); | |
373 ResourceDispatcherHostImpl::Get()->MarkAsTransferredNavigation(global_id); | 371 ResourceDispatcherHostImpl::Get()->MarkAsTransferredNavigation(global_id); |
374 | 372 |
375 BrowserThread::PostTask( | 373 BrowserThread::PostTask( |
376 BrowserThread::UI, | 374 BrowserThread::UI, |
377 FROM_HERE, | 375 FROM_HERE, |
378 base::Bind( | 376 base::Bind( |
379 &OnCrossSiteResponseHelper, | 377 &OnCrossSiteResponseHelper, |
380 CrossSiteResponseParams(render_frame_id, | 378 CrossSiteResponseParams(render_frame_id, |
381 global_id, | 379 global_id, |
382 transfer_url_chain, | 380 transfer_url_chain, |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
424 controller()->Resume(); | 422 controller()->Resume(); |
425 } | 423 } |
426 } | 424 } |
427 | 425 |
428 void CrossSiteResourceHandler::OnDidDefer() { | 426 void CrossSiteResourceHandler::OnDidDefer() { |
429 did_defer_ = true; | 427 did_defer_ = true; |
430 request()->LogBlockedBy("CrossSiteResourceHandler"); | 428 request()->LogBlockedBy("CrossSiteResourceHandler"); |
431 } | 429 } |
432 | 430 |
433 } // namespace content | 431 } // namespace content |
OLD | NEW |