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

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 12574007: Merge 186793 "Let the browser handle external navigations from D..." (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1410/src/
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/devtools/devtools_sanity_browsertest.cc ('k') | 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/renderer/render_view_impl.h" 5 #include "content/renderer/render_view_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 2984 matching lines...) Expand 10 before | Expand all | Expand 10 after
2995 // security than loading a WebUI, extension or app page in the wrong process. 2995 // security than loading a WebUI, extension or app page in the wrong process.
2996 // POST requests don't work because this mechanism does not preserve form 2996 // POST requests don't work because this mechanism does not preserve form
2997 // POST data. We will need to send the request's httpBody data up to the 2997 // POST data. We will need to send the request's httpBody data up to the
2998 // browser process, and issue a special POST navigation in WebKit (via 2998 // browser process, and issue a special POST navigation in WebKit (via
2999 // FrameLoader::loadFrameRequest). See ResourceDispatcher and WebURLLoaderImpl 2999 // FrameLoader::loadFrameRequest). See ResourceDispatcher and WebURLLoaderImpl
3000 // for examples of how to send the httpBody data. 3000 // for examples of how to send the httpBody data.
3001 if (!frame->parent() && is_content_initiated && 3001 if (!frame->parent() && is_content_initiated &&
3002 !url.SchemeIs(chrome::kAboutScheme)) { 3002 !url.SchemeIs(chrome::kAboutScheme)) {
3003 bool send_referrer = false; 3003 bool send_referrer = false;
3004 3004
3005 // All navigations to WebUI URLs or within WebUI-enabled RenderProcesses 3005 // All navigations to or from WebUI URLs or within WebUI-enabled
3006 // must be handled by the browser process so that the correct bindings and 3006 // RenderProcesses must be handled by the browser process so that the
3007 // data sources can be registered. 3007 // correct bindings and data sources can be registered.
3008 // Similarly, navigations to view-source URLs or within ViewSource mode 3008 // Similarly, navigations to view-source URLs or within ViewSource mode
3009 // must be handled by the browser process (except for reloads - those are 3009 // must be handled by the browser process (except for reloads - those are
3010 // safe to leave within the renderer). 3010 // safe to leave within the renderer).
3011 // Lastly, access to file:// URLs from non-file:// URL pages must be 3011 // Lastly, access to file:// URLs from non-file:// URL pages must be
3012 // handled by the browser so that ordinary renderer processes don't get 3012 // handled by the browser so that ordinary renderer processes don't get
3013 // blessed with file permissions. 3013 // blessed with file permissions.
3014 int cumulative_bindings = RenderProcess::current()->GetEnabledBindings(); 3014 int cumulative_bindings = RenderProcess::current()->GetEnabledBindings();
3015 bool is_initial_navigation = page_id_ == -1; 3015 bool is_initial_navigation = page_id_ == -1;
3016 bool should_fork = HasWebUIScheme(url) || 3016 bool should_fork = HasWebUIScheme(url) || HasWebUIScheme(old_url) ||
3017 (cumulative_bindings & BINDINGS_POLICY_WEB_UI) || 3017 (cumulative_bindings & BINDINGS_POLICY_WEB_UI) ||
3018 url.SchemeIs(chrome::kViewSourceScheme) || 3018 url.SchemeIs(chrome::kViewSourceScheme) ||
3019 (frame->isViewSourceModeEnabled() && 3019 (frame->isViewSourceModeEnabled() &&
3020 type != WebKit::WebNavigationTypeReload); 3020 type != WebKit::WebNavigationTypeReload);
3021 3021
3022 if (!should_fork && url.SchemeIs(chrome::kFileScheme)) { 3022 if (!should_fork && url.SchemeIs(chrome::kFileScheme)) {
3023 // Fork non-file to file opens. Check the opener URL if this is the 3023 // Fork non-file to file opens. Check the opener URL if this is the
3024 // initial navigation in a newly opened window. 3024 // initial navigation in a newly opened window.
3025 GURL source_url(old_url); 3025 GURL source_url(old_url);
3026 if (is_initial_navigation && source_url.is_empty() && frame->opener()) 3026 if (is_initial_navigation && source_url.is_empty() && frame->opener())
(...skipping 3593 matching lines...) Expand 10 before | Expand all | Expand 10 after
6620 } 6620 }
6621 #endif 6621 #endif
6622 6622
6623 void RenderViewImpl::OnReleaseDisambiguationPopupDIB( 6623 void RenderViewImpl::OnReleaseDisambiguationPopupDIB(
6624 TransportDIB::Handle dib_handle) { 6624 TransportDIB::Handle dib_handle) {
6625 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); 6625 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle);
6626 RenderProcess::current()->ReleaseTransportDIB(dib); 6626 RenderProcess::current()->ReleaseTransportDIB(dib);
6627 } 6627 }
6628 6628
6629 } // namespace content 6629 } // namespace content
OLDNEW
« no previous file with comments | « chrome/browser/devtools/devtools_sanity_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698