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

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

Issue 2153573002: 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 4965 matching lines...) Expand 10 before | Expand all | Expand 10 after
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. Check the opener URL if this is the 4982 // Fork non-file to file opens. Check the opener URL if this is the
4983 // initial navigation in a newly opened window. 4983 // initial navigation in a newly opened window.
4984 GURL source_url(old_url); 4984 GURL source_url(old_url);
4985 if (is_initial_navigation && source_url.is_empty() && frame_->opener()) 4985 if (is_initial_navigation && source_url.is_empty() && frame_->opener())
4986 source_url = frame_->opener()->top()->document().url(); 4986 source_url = frame_->opener()->top()->document().url();
Charlie Reis 2016/07/14 21:16:47 Do we gain much by having the opener check at all?
Tom Sepez 2016/07/14 21:27:59 Done.
4987 DCHECK(!source_url.is_empty());
4988 should_fork = !source_url.SchemeIs(url::kFileScheme); 4987 should_fork = !source_url.SchemeIs(url::kFileScheme);
4989 } 4988 }
4990 4989
4991 if (!should_fork) { 4990 if (!should_fork) {
4992 // Give the embedder a chance. 4991 // Give the embedder a chance.
4993 should_fork = GetContentClient()->renderer()->ShouldFork( 4992 should_fork = GetContentClient()->renderer()->ShouldFork(
4994 frame_, url, info.urlRequest.httpMethod().utf8(), 4993 frame_, url, info.urlRequest.httpMethod().utf8(),
4995 is_initial_navigation, is_redirect, &send_referrer); 4994 is_initial_navigation, is_redirect, &send_referrer);
4996 } 4995 }
4997 4996
(...skipping 1331 matching lines...) Expand 10 before | Expand all | Expand 10 after
6329 // event target. Potentially a Pepper plugin will receive the event. 6328 // event target. Potentially a Pepper plugin will receive the event.
6330 // In order to tell whether a plugin gets the last mouse event and which it 6329 // In order to tell whether a plugin gets the last mouse event and which it
6331 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6330 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6332 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6331 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6333 // |pepper_last_mouse_event_target_|. 6332 // |pepper_last_mouse_event_target_|.
6334 pepper_last_mouse_event_target_ = nullptr; 6333 pepper_last_mouse_event_target_ = nullptr;
6335 #endif 6334 #endif
6336 } 6335 }
6337 6336
6338 } // namespace content 6337 } // 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