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

Side by Side Diff: content/browser/renderer_host/render_view_host_impl.cc

Issue 9978015: Make browser_handles_top_level_requests synchronous. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ExternalTabContainer::ShouldIgnoreNavigation returns true if is_content_initiated Created 8 years, 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/browser/renderer_host/render_view_host_impl.h" 5 #include "content/browser/renderer_host/render_view_host_impl.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 810 matching lines...) Expand 10 before | Expand all | Expand 10 after
821 IPC_MESSAGE_HANDLER(ViewHostMsg_DidChangeLoadProgress, 821 IPC_MESSAGE_HANDLER(ViewHostMsg_DidChangeLoadProgress,
822 OnMsgDidChangeLoadProgress) 822 OnMsgDidChangeLoadProgress)
823 IPC_MESSAGE_HANDLER(ViewHostMsg_DocumentAvailableInMainFrame, 823 IPC_MESSAGE_HANDLER(ViewHostMsg_DocumentAvailableInMainFrame,
824 OnMsgDocumentAvailableInMainFrame) 824 OnMsgDocumentAvailableInMainFrame)
825 IPC_MESSAGE_HANDLER(ViewHostMsg_DocumentOnLoadCompletedInMainFrame, 825 IPC_MESSAGE_HANDLER(ViewHostMsg_DocumentOnLoadCompletedInMainFrame,
826 OnMsgDocumentOnLoadCompletedInMainFrame) 826 OnMsgDocumentOnLoadCompletedInMainFrame)
827 IPC_MESSAGE_HANDLER(ViewHostMsg_ContextMenu, OnMsgContextMenu) 827 IPC_MESSAGE_HANDLER(ViewHostMsg_ContextMenu, OnMsgContextMenu)
828 IPC_MESSAGE_HANDLER(ViewHostMsg_ToggleFullscreen, 828 IPC_MESSAGE_HANDLER(ViewHostMsg_ToggleFullscreen,
829 OnMsgToggleFullscreen) 829 OnMsgToggleFullscreen)
830 IPC_MESSAGE_HANDLER(ViewHostMsg_OpenURL, OnMsgOpenURL) 830 IPC_MESSAGE_HANDLER(ViewHostMsg_OpenURL, OnMsgOpenURL)
831 IPC_MESSAGE_HANDLER(ViewHostMsg_ShouldIgnoreNavigation,
832 OnMsgShouldIgnoreNavigation)
831 IPC_MESSAGE_HANDLER(ViewHostMsg_DidContentsPreferredSizeChange, 833 IPC_MESSAGE_HANDLER(ViewHostMsg_DidContentsPreferredSizeChange,
832 OnMsgDidContentsPreferredSizeChange) 834 OnMsgDidContentsPreferredSizeChange)
833 IPC_MESSAGE_HANDLER(ViewHostMsg_DidChangeScrollbarsForMainFrame, 835 IPC_MESSAGE_HANDLER(ViewHostMsg_DidChangeScrollbarsForMainFrame,
834 OnMsgDidChangeScrollbarsForMainFrame) 836 OnMsgDidChangeScrollbarsForMainFrame)
835 IPC_MESSAGE_HANDLER(ViewHostMsg_DidChangeScrollOffsetPinningForMainFrame, 837 IPC_MESSAGE_HANDLER(ViewHostMsg_DidChangeScrollOffsetPinningForMainFrame,
836 OnMsgDidChangeScrollOffsetPinningForMainFrame) 838 OnMsgDidChangeScrollOffsetPinningForMainFrame)
837 IPC_MESSAGE_HANDLER(ViewHostMsg_DidChangeNumWheelEvents, 839 IPC_MESSAGE_HANDLER(ViewHostMsg_DidChangeNumWheelEvents,
838 OnMsgDidChangeNumWheelEvents) 840 OnMsgDidChangeNumWheelEvents)
839 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_RunJavaScriptMessage, 841 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_RunJavaScriptMessage,
840 OnMsgRunJavaScriptMessage) 842 OnMsgRunJavaScriptMessage)
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
1152 const content::Referrer& referrer, 1154 const content::Referrer& referrer,
1153 WindowOpenDisposition disposition, 1155 WindowOpenDisposition disposition,
1154 int64 source_frame_id) { 1156 int64 source_frame_id) {
1155 GURL validated_url(url); 1157 GURL validated_url(url);
1156 FilterURL(ChildProcessSecurityPolicyImpl::GetInstance(), 1158 FilterURL(ChildProcessSecurityPolicyImpl::GetInstance(),
1157 GetProcess()->GetID(), false, &validated_url); 1159 GetProcess()->GetID(), false, &validated_url);
1158 1160
1159 delegate_->RequestOpenURL( 1161 delegate_->RequestOpenURL(
1160 validated_url, referrer, disposition, source_frame_id); 1162 validated_url, referrer, disposition, source_frame_id);
1161 } 1163 }
1162 1164
darin (slow to review) 2012/04/16 15:47:11 This creates a dead-lock. It is not valid to hand
mkosiba (inactive) 2012/04/16 16:15:08 Is is a guaranteed deadlock or only under certain
1165 void RenderViewHostImpl::OnMsgShouldIgnoreNavigation(
1166 const GURL& url,
1167 const content::Referrer& referrer,
1168 WindowOpenDisposition disposition,
1169 int64 source_frame_id,
1170 bool is_content_initiated,
1171 bool* result) {
1172 GURL validated_url(url);
1173 FilterURL(ChildProcessSecurityPolicyImpl::GetInstance(),
1174 GetProcess()->GetID(), false, &validated_url);
1175 *result = delegate_->ShouldIgnoreNavigation(validated_url, referrer,
1176 disposition, source_frame_id,
1177 is_content_initiated);
1178 }
1179
1163 void RenderViewHostImpl::OnMsgDidContentsPreferredSizeChange( 1180 void RenderViewHostImpl::OnMsgDidContentsPreferredSizeChange(
1164 const gfx::Size& new_size) { 1181 const gfx::Size& new_size) {
1165 delegate_->UpdatePreferredSize(new_size); 1182 delegate_->UpdatePreferredSize(new_size);
1166 } 1183 }
1167 1184
1168 void RenderViewHostImpl::OnRenderAutoResized(const gfx::Size& new_size) { 1185 void RenderViewHostImpl::OnRenderAutoResized(const gfx::Size& new_size) {
1169 delegate_->ResizeDueToAutoResize(new_size); 1186 delegate_->ResizeDueToAutoResize(new_size);
1170 } 1187 }
1171 1188
1172 void RenderViewHostImpl::OnMsgDidChangeScrollbarsForMainFrame( 1189 void RenderViewHostImpl::OnMsgDidChangeScrollbarsForMainFrame(
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after
1726 // can cause navigations to be ignored in OnMsgNavigate. 1743 // can cause navigations to be ignored in OnMsgNavigate.
1727 is_waiting_for_beforeunload_ack_ = false; 1744 is_waiting_for_beforeunload_ack_ = false;
1728 is_waiting_for_unload_ack_ = false; 1745 is_waiting_for_unload_ack_ = false;
1729 } 1746 }
1730 1747
1731 void RenderViewHostImpl::ClearPowerSaveBlockers() { 1748 void RenderViewHostImpl::ClearPowerSaveBlockers() {
1732 STLDeleteValues(&power_save_blockers_); 1749 STLDeleteValues(&power_save_blockers_);
1733 } 1750 }
1734 1751
1735 } // namespace content 1752 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_view_host_impl.h ('k') | content/browser/tab_contents/tab_contents.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698