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

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

Issue 2166113002: Simplify decidePolicyForNavigation + remove POST-only-in-http(s) 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
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 4967 matching lines...) Expand 10 before | Expand all | Expand 10 after
4978 // blessed with file permissions. 4978 // blessed with file permissions.
4979 int cumulative_bindings = RenderProcess::current()->GetEnabledBindings(); 4979 int cumulative_bindings = RenderProcess::current()->GetEnabledBindings();
4980 bool is_initial_navigation = render_view_->history_list_length_ == 0; 4980 bool is_initial_navigation = render_view_->history_list_length_ == 0;
4981 bool should_fork = HasWebUIScheme(url) || HasWebUIScheme(old_url) || 4981 bool should_fork = HasWebUIScheme(url) || HasWebUIScheme(old_url) ||
4982 (cumulative_bindings & BINDINGS_POLICY_WEB_UI) || 4982 (cumulative_bindings & BINDINGS_POLICY_WEB_UI) ||
4983 url.SchemeIs(kViewSourceScheme) || 4983 url.SchemeIs(kViewSourceScheme) ||
4984 (frame_->isViewSourceModeEnabled() && 4984 (frame_->isViewSourceModeEnabled() &&
4985 info.navigationType != blink::WebNavigationTypeReload); 4985 info.navigationType != blink::WebNavigationTypeReload);
4986 4986
4987 if (!should_fork && url.SchemeIs(url::kFileScheme)) { 4987 if (!should_fork && url.SchemeIs(url::kFileScheme)) {
4988 // Fork non-file to file opens. Check the opener URL if this is the 4988 // Fork non-file to file opens. Note that this may fork unnecessarily if
4989 // initial navigation in a newly opened window. 4989 // another tab (hosting a file or not) targeted this one before its
4990 GURL source_url(old_url); 4990 // initial navigation, but that shouldn't cause a problem.
4991 if (is_initial_navigation && source_url.is_empty() && frame_->opener()) 4991 should_fork = !old_url.SchemeIs(url::kFileScheme);
Łukasz Anforowicz 2016/07/20 22:23:04 The changes above [should] just replicate the chan
4992 source_url = frame_->opener()->top()->document().url();
4993 should_fork = !source_url.SchemeIs(url::kFileScheme);
4994 } 4992 }
4995 4993
4996 if (!should_fork) { 4994 if (!should_fork) {
4997 // Give the embedder a chance. 4995 // Give the embedder a chance.
4998 should_fork = GetContentClient()->renderer()->ShouldFork( 4996 should_fork = GetContentClient()->renderer()->ShouldFork(
4999 frame_, url, info.urlRequest.httpMethod().utf8(), 4997 frame_, url, info.urlRequest.httpMethod().utf8(),
5000 is_initial_navigation, is_redirect, &send_referrer); 4998 is_initial_navigation, is_redirect, &send_referrer);
5001 } 4999 }
5002 5000
5003 if (should_fork) { 5001 if (should_fork) {
(...skipping 1332 matching lines...) Expand 10 before | Expand all | Expand 10 after
6336 // event target. Potentially a Pepper plugin will receive the event. 6334 // event target. Potentially a Pepper plugin will receive the event.
6337 // In order to tell whether a plugin gets the last mouse event and which it 6335 // In order to tell whether a plugin gets the last mouse event and which it
6338 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6336 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6339 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6337 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6340 // |pepper_last_mouse_event_target_|. 6338 // |pepper_last_mouse_event_target_|.
6341 pepper_last_mouse_event_target_ = nullptr; 6339 pepper_last_mouse_event_target_ = nullptr;
6342 #endif 6340 #endif
6343 } 6341 }
6344 6342
6345 } // namespace content 6343 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698