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 3214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3225 // handled by the browser so that ordinary renderer processes don't get | 3225 // handled by the browser so that ordinary renderer processes don't get |
3226 // blessed with file permissions. | 3226 // blessed with file permissions. |
3227 int cumulative_bindings = RenderProcess::current()->GetEnabledBindings(); | 3227 int cumulative_bindings = RenderProcess::current()->GetEnabledBindings(); |
3228 bool is_initial_navigation = render_view_->page_id_ == -1; | 3228 bool is_initial_navigation = render_view_->page_id_ == -1; |
3229 bool should_fork = HasWebUIScheme(url) || HasWebUIScheme(old_url) || | 3229 bool should_fork = HasWebUIScheme(url) || HasWebUIScheme(old_url) || |
3230 (cumulative_bindings & BINDINGS_POLICY_WEB_UI) || | 3230 (cumulative_bindings & BINDINGS_POLICY_WEB_UI) || |
3231 url.SchemeIs(kViewSourceScheme) || | 3231 url.SchemeIs(kViewSourceScheme) || |
3232 (frame->isViewSourceModeEnabled() && | 3232 (frame->isViewSourceModeEnabled() && |
3233 type != blink::WebNavigationTypeReload); | 3233 type != blink::WebNavigationTypeReload); |
3234 | 3234 |
3235 if (!should_fork && url.SchemeIs(kFileScheme)) { | 3235 if (!should_fork && url.SchemeIs(url::kFileScheme)) { |
3236 // Fork non-file to file opens. Check the opener URL if this is the | 3236 // Fork non-file to file opens. Check the opener URL if this is the |
3237 // initial navigation in a newly opened window. | 3237 // initial navigation in a newly opened window. |
3238 GURL source_url(old_url); | 3238 GURL source_url(old_url); |
3239 if (is_initial_navigation && source_url.is_empty() && frame->opener()) | 3239 if (is_initial_navigation && source_url.is_empty() && frame->opener()) |
3240 source_url = frame->opener()->top()->document().url(); | 3240 source_url = frame->opener()->top()->document().url(); |
3241 DCHECK(!source_url.is_empty()); | 3241 DCHECK(!source_url.is_empty()); |
3242 should_fork = !source_url.SchemeIs(kFileScheme); | 3242 should_fork = !source_url.SchemeIs(url::kFileScheme); |
3243 } | 3243 } |
3244 | 3244 |
3245 if (!should_fork) { | 3245 if (!should_fork) { |
3246 // Give the embedder a chance. | 3246 // Give the embedder a chance. |
3247 should_fork = GetContentClient()->renderer()->ShouldFork( | 3247 should_fork = GetContentClient()->renderer()->ShouldFork( |
3248 frame, url, request.httpMethod().utf8(), is_initial_navigation, | 3248 frame, url, request.httpMethod().utf8(), is_initial_navigation, |
3249 is_redirect, &send_referrer); | 3249 is_redirect, &send_referrer); |
3250 } | 3250 } |
3251 | 3251 |
3252 if (should_fork) { | 3252 if (should_fork) { |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3506 #if defined(VIDEO_HOLE) | 3506 #if defined(VIDEO_HOLE) |
3507 render_view_->RegisterVideoHoleFrame(this); | 3507 render_view_->RegisterVideoHoleFrame(this); |
3508 #endif // defined(VIDEO_HOLE) | 3508 #endif // defined(VIDEO_HOLE) |
3509 } | 3509 } |
3510 return media_player_manager_; | 3510 return media_player_manager_; |
3511 } | 3511 } |
3512 | 3512 |
3513 #endif // defined(OS_ANDROID) | 3513 #endif // defined(OS_ANDROID) |
3514 | 3514 |
3515 } // namespace content | 3515 } // namespace content |
OLD | NEW |