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/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 3025 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3036 if (!frame->parent() && is_content_initiated && | 3036 if (!frame->parent() && is_content_initiated && |
3037 !url.SchemeIs(chrome::kAboutScheme)) { | 3037 !url.SchemeIs(chrome::kAboutScheme)) { |
3038 bool send_referrer = false; | 3038 bool send_referrer = false; |
3039 | 3039 |
3040 // All navigations to WebUI URLs or within WebUI-enabled RenderProcesses | 3040 // All navigations to WebUI URLs or within WebUI-enabled RenderProcesses |
3041 // must be handled by the browser process so that the correct bindings and | 3041 // must be handled by the browser process so that the correct bindings and |
3042 // data sources can be registered. | 3042 // data sources can be registered. |
3043 // Similarly, navigations to view-source URLs or within ViewSource mode | 3043 // Similarly, navigations to view-source URLs or within ViewSource mode |
3044 // must be handled by the browser process (except for reloads - those are | 3044 // must be handled by the browser process (except for reloads - those are |
3045 // safe to leave within the renderer). | 3045 // safe to leave within the renderer). |
3046 // Also navigations from devtools URLs must be handled by the browser | |
3047 // process. | |
3046 // Lastly, access to file:// URLs from non-file:// URL pages must be | 3048 // Lastly, access to file:// URLs from non-file:// URL pages must be |
3047 // handled by the browser so that ordinary renderer processes don't get | 3049 // handled by the browser so that ordinary renderer processes don't get |
3048 // blessed with file permissions. | 3050 // blessed with file permissions. |
3049 int cumulative_bindings = RenderProcess::current()->GetEnabledBindings(); | 3051 int cumulative_bindings = RenderProcess::current()->GetEnabledBindings(); |
3050 bool is_initial_navigation = page_id_ == -1; | 3052 bool is_initial_navigation = page_id_ == -1; |
3051 bool should_fork = HasWebUIScheme(url) || | 3053 bool should_fork = HasWebUIScheme(url) || |
3052 (cumulative_bindings & BINDINGS_POLICY_WEB_UI) || | 3054 (cumulative_bindings & BINDINGS_POLICY_WEB_UI) || |
3053 url.SchemeIs(chrome::kViewSourceScheme) || | 3055 url.SchemeIs(chrome::kViewSourceScheme) || |
3054 (frame->isViewSourceModeEnabled() && | 3056 (frame->isViewSourceModeEnabled() && |
3055 type != WebKit::WebNavigationTypeReload); | 3057 type != WebKit::WebNavigationTypeReload) || |
3058 old_url.SchemeIs(chrome::kChromeDevToolsScheme); | |
pfeldman
2013/03/06 14:00:35
Charlie: can we do
HasWebUIScheme(old_url) instead
Charlie Reis
2013/03/06 18:18:25
This seems ok, because it's broader than before.
| |
3056 | 3059 |
3057 if (!should_fork && url.SchemeIs(chrome::kFileScheme)) { | 3060 if (!should_fork && url.SchemeIs(chrome::kFileScheme)) { |
3058 // Fork non-file to file opens. Check the opener URL if this is the | 3061 // Fork non-file to file opens. Check the opener URL if this is the |
3059 // initial navigation in a newly opened window. | 3062 // initial navigation in a newly opened window. |
3060 GURL source_url(old_url); | 3063 GURL source_url(old_url); |
3061 if (is_initial_navigation && source_url.is_empty() && frame->opener()) | 3064 if (is_initial_navigation && source_url.is_empty() && frame->opener()) |
3062 source_url = frame->opener()->top()->document().url(); | 3065 source_url = frame->opener()->top()->document().url(); |
3063 DCHECK(!source_url.is_empty()); | 3066 DCHECK(!source_url.is_empty()); |
3064 should_fork = !source_url.SchemeIs(chrome::kFileScheme); | 3067 should_fork = !source_url.SchemeIs(chrome::kFileScheme); |
3065 } | 3068 } |
(...skipping 3685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6751 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); | 6754 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); |
6752 RenderProcess::current()->ReleaseTransportDIB(dib); | 6755 RenderProcess::current()->ReleaseTransportDIB(dib); |
6753 } | 6756 } |
6754 | 6757 |
6755 void RenderViewImpl::DidCommitCompositorFrame() { | 6758 void RenderViewImpl::DidCommitCompositorFrame() { |
6756 RenderWidget::DidCommitCompositorFrame(); | 6759 RenderWidget::DidCommitCompositorFrame(); |
6757 FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidCommitCompositorFrame()); | 6760 FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidCommitCompositorFrame()); |
6758 } | 6761 } |
6759 | 6762 |
6760 } // namespace content | 6763 } // namespace content |
OLD | NEW |