OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_frame_impl.h" | 5 #include "content/renderer/render_frame_impl.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 3182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3193 // handled by the browser so that ordinary renderer processes don't get | 3193 // handled by the browser so that ordinary renderer processes don't get |
3194 // blessed with file permissions. | 3194 // blessed with file permissions. |
3195 int cumulative_bindings = RenderProcess::current()->GetEnabledBindings(); | 3195 int cumulative_bindings = RenderProcess::current()->GetEnabledBindings(); |
3196 bool is_initial_navigation = render_view_->page_id_ == -1; | 3196 bool is_initial_navigation = render_view_->page_id_ == -1; |
3197 bool should_fork = HasWebUIScheme(url) || HasWebUIScheme(old_url) || | 3197 bool should_fork = HasWebUIScheme(url) || HasWebUIScheme(old_url) || |
3198 (cumulative_bindings & BINDINGS_POLICY_WEB_UI) || | 3198 (cumulative_bindings & BINDINGS_POLICY_WEB_UI) || |
3199 url.SchemeIs(kViewSourceScheme) || | 3199 url.SchemeIs(kViewSourceScheme) || |
3200 (frame->isViewSourceModeEnabled() && | 3200 (frame->isViewSourceModeEnabled() && |
3201 type != blink::WebNavigationTypeReload); | 3201 type != blink::WebNavigationTypeReload); |
3202 | 3202 |
3203 if (!should_fork && url.SchemeIs(kFileScheme)) { | 3203 if (!should_fork && url.SchemeIs(url::kFileScheme)) { |
3204 // Fork non-file to file opens. Check the opener URL if this is the | 3204 // Fork non-file to file opens. Check the opener URL if this is the |
3205 // initial navigation in a newly opened window. | 3205 // initial navigation in a newly opened window. |
3206 GURL source_url(old_url); | 3206 GURL source_url(old_url); |
3207 if (is_initial_navigation && source_url.is_empty() && frame->opener()) | 3207 if (is_initial_navigation && source_url.is_empty() && frame->opener()) |
3208 source_url = frame->opener()->top()->document().url(); | 3208 source_url = frame->opener()->top()->document().url(); |
3209 DCHECK(!source_url.is_empty()); | 3209 DCHECK(!source_url.is_empty()); |
3210 should_fork = !source_url.SchemeIs(kFileScheme); | 3210 should_fork = !source_url.SchemeIs(url::kFileScheme); |
3211 } | 3211 } |
3212 | 3212 |
3213 if (!should_fork) { | 3213 if (!should_fork) { |
3214 // Give the embedder a chance. | 3214 // Give the embedder a chance. |
3215 should_fork = GetContentClient()->renderer()->ShouldFork( | 3215 should_fork = GetContentClient()->renderer()->ShouldFork( |
3216 frame, url, request.httpMethod().utf8(), is_initial_navigation, | 3216 frame, url, request.httpMethod().utf8(), is_initial_navigation, |
3217 is_redirect, &send_referrer); | 3217 is_redirect, &send_referrer); |
3218 } | 3218 } |
3219 | 3219 |
3220 if (should_fork) { | 3220 if (should_fork) { |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3457 weak_factory_.GetWeakPtr(), | 3457 weak_factory_.GetWeakPtr(), |
3458 render_view_->media_player_manager_, | 3458 render_view_->media_player_manager_, |
3459 stream_texture_factory, | 3459 stream_texture_factory, |
3460 RenderThreadImpl::current()->GetMediaThreadMessageLoopProxy(), | 3460 RenderThreadImpl::current()->GetMediaThreadMessageLoopProxy(), |
3461 new RenderMediaLog()); | 3461 new RenderMediaLog()); |
3462 } | 3462 } |
3463 | 3463 |
3464 #endif | 3464 #endif |
3465 | 3465 |
3466 } // namespace content | 3466 } // namespace content |
OLD | NEW |