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

Side by Side Diff: content/browser/loader/cross_site_resource_handler.cc

Issue 972773003: Make sure the --site-per-process flag is present for subframe process swaps. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 }; 61 };
62 62
63 void OnCrossSiteResponseHelper(const CrossSiteResponseParams& params) { 63 void OnCrossSiteResponseHelper(const CrossSiteResponseParams& params) {
64 scoped_ptr<CrossSiteTransferringRequest> cross_site_transferring_request( 64 scoped_ptr<CrossSiteTransferringRequest> cross_site_transferring_request(
65 new CrossSiteTransferringRequest(params.global_request_id)); 65 new CrossSiteTransferringRequest(params.global_request_id));
66 66
67 RenderFrameHostImpl* rfh = 67 RenderFrameHostImpl* rfh =
68 RenderFrameHostImpl::FromID(params.global_request_id.child_id, 68 RenderFrameHostImpl::FromID(params.global_request_id.child_id,
69 params.render_frame_id); 69 params.render_frame_id);
70 if (rfh) { 70 if (rfh) {
71 if (rfh->GetParent()) {
72 // We should only swap processes for subframes in --site-per-process mode.
73 // CrossSiteResourceHandler is not installed on subframe requests in
74 // default Chrome.
75 CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch(
76 switches::kSitePerProcess));
77 }
71 rfh->OnCrossSiteResponse( 78 rfh->OnCrossSiteResponse(
72 params.global_request_id, cross_site_transferring_request.Pass(), 79 params.global_request_id, cross_site_transferring_request.Pass(),
73 params.transfer_url_chain, params.referrer, 80 params.transfer_url_chain, params.referrer,
74 params.page_transition, params.should_replace_current_entry); 81 params.page_transition, params.should_replace_current_entry);
75 } else if (leak_requests_for_testing_ && cross_site_transferring_request) { 82 } else if (leak_requests_for_testing_ && cross_site_transferring_request) {
76 // Some unit tests expect requests to be leaked in this case, so they can 83 // Some unit tests expect requests to be leaked in this case, so they can
77 // pass them along manually. 84 // pass them along manually.
78 cross_site_transferring_request->ReleaseRequest(); 85 cross_site_transferring_request->ReleaseRequest();
79 } 86 }
80 } 87 }
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 controller()->Resume(); 429 controller()->Resume();
423 } 430 }
424 } 431 }
425 432
426 void CrossSiteResourceHandler::OnDidDefer() { 433 void CrossSiteResourceHandler::OnDidDefer() {
427 did_defer_ = true; 434 did_defer_ = true;
428 request()->LogBlockedBy("CrossSiteResourceHandler"); 435 request()->LogBlockedBy("CrossSiteResourceHandler");
429 } 436 }
430 437
431 } // namespace content 438 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698