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

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

Issue 2150243002: Revert of Simplify RenderFrameImpl::decidePolicyForNavigation and avoid DCHECK (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 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 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 4961 matching lines...) Expand 10 before | Expand all | Expand 10 after
4972 // blessed with file permissions. 4972 // blessed with file permissions.
4973 int cumulative_bindings = RenderProcess::current()->GetEnabledBindings(); 4973 int cumulative_bindings = RenderProcess::current()->GetEnabledBindings();
4974 bool is_initial_navigation = render_view_->history_list_length_ == 0; 4974 bool is_initial_navigation = render_view_->history_list_length_ == 0;
4975 bool should_fork = HasWebUIScheme(url) || HasWebUIScheme(old_url) || 4975 bool should_fork = HasWebUIScheme(url) || HasWebUIScheme(old_url) ||
4976 (cumulative_bindings & BINDINGS_POLICY_WEB_UI) || 4976 (cumulative_bindings & BINDINGS_POLICY_WEB_UI) ||
4977 url.SchemeIs(kViewSourceScheme) || 4977 url.SchemeIs(kViewSourceScheme) ||
4978 (frame_->isViewSourceModeEnabled() && 4978 (frame_->isViewSourceModeEnabled() &&
4979 info.navigationType != blink::WebNavigationTypeReload); 4979 info.navigationType != blink::WebNavigationTypeReload);
4980 4980
4981 if (!should_fork && url.SchemeIs(url::kFileScheme)) { 4981 if (!should_fork && url.SchemeIs(url::kFileScheme)) {
4982 // Fork non-file to file opens. Note that this may fork unnecessarily if 4982 // Fork non-file to file opens. Check the opener URL if this is the
4983 // another tab (hosting a file or not) targeted this one before its 4983 // initial navigation in a newly opened window.
4984 // initial navigation, but that shouldn't cause a problem. 4984 GURL source_url(old_url);
4985 should_fork = !old_url.SchemeIs(url::kFileScheme); 4985 if (is_initial_navigation && source_url.is_empty() && frame_->opener())
4986 source_url = frame_->opener()->top()->document().url();
4987 DCHECK(!source_url.is_empty());
4988 should_fork = !source_url.SchemeIs(url::kFileScheme);
4986 } 4989 }
4987 4990
4988 if (!should_fork) { 4991 if (!should_fork) {
4989 // Give the embedder a chance. 4992 // Give the embedder a chance.
4990 should_fork = GetContentClient()->renderer()->ShouldFork( 4993 should_fork = GetContentClient()->renderer()->ShouldFork(
4991 frame_, url, info.urlRequest.httpMethod().utf8(), 4994 frame_, url, info.urlRequest.httpMethod().utf8(),
4992 is_initial_navigation, is_redirect, &send_referrer); 4995 is_initial_navigation, is_redirect, &send_referrer);
4993 } 4996 }
4994 4997
4995 if (should_fork) { 4998 if (should_fork) {
(...skipping 1330 matching lines...) Expand 10 before | Expand all | Expand 10 after
6326 // event target. Potentially a Pepper plugin will receive the event. 6329 // event target. Potentially a Pepper plugin will receive the event.
6327 // In order to tell whether a plugin gets the last mouse event and which it 6330 // In order to tell whether a plugin gets the last mouse event and which it
6328 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6331 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6329 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6332 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6330 // |pepper_last_mouse_event_target_|. 6333 // |pepper_last_mouse_event_target_|.
6331 pepper_last_mouse_event_target_ = nullptr; 6334 pepper_last_mouse_event_target_ = nullptr;
6332 #endif 6335 #endif
6333 } 6336 }
6334 6337
6335 } // namespace content 6338 } // 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