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

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

Issue 265123003: DRAFT CL: Check that we already know the renderer's page ID (outside commit). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 7 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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 : RenderWidgetHostImpl(widget_delegate, 200 : RenderWidgetHostImpl(widget_delegate,
201 instance->GetProcess(), 201 instance->GetProcess(),
202 routing_id, 202 routing_id,
203 hidden), 203 hidden),
204 frames_ref_count_(0), 204 frames_ref_count_(0),
205 delegate_(delegate), 205 delegate_(delegate),
206 instance_(static_cast<SiteInstanceImpl*>(instance)), 206 instance_(static_cast<SiteInstanceImpl*>(instance)),
207 waiting_for_drag_context_response_(false), 207 waiting_for_drag_context_response_(false),
208 enabled_bindings_(0), 208 enabled_bindings_(0),
209 navigations_suspended_(false), 209 navigations_suspended_(false),
210 page_id_(-1),
210 main_frame_routing_id_(main_frame_routing_id), 211 main_frame_routing_id_(main_frame_routing_id),
211 run_modal_reply_msg_(NULL), 212 run_modal_reply_msg_(NULL),
212 run_modal_opener_id_(MSG_ROUTING_NONE), 213 run_modal_opener_id_(MSG_ROUTING_NONE),
213 is_waiting_for_beforeunload_ack_(false), 214 is_waiting_for_beforeunload_ack_(false),
214 unload_ack_is_for_cross_site_transition_(false), 215 unload_ack_is_for_cross_site_transition_(false),
215 sudden_termination_allowed_(false), 216 sudden_termination_allowed_(false),
216 render_view_termination_status_(base::TERMINATION_STATUS_STILL_RUNNING), 217 render_view_termination_status_(base::TERMINATION_STATUS_STILL_RUNNING),
217 virtual_keyboard_requested_(false), 218 virtual_keyboard_requested_(false),
218 weak_factory_(this) { 219 weak_factory_(this) {
219 DCHECK(instance_.get()); 220 DCHECK(instance_.get());
(...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after
1168 1169
1169 // Our base class RenderWidgetHost needs to reset some stuff. 1170 // Our base class RenderWidgetHost needs to reset some stuff.
1170 RendererExited(render_view_termination_status_, exit_code); 1171 RendererExited(render_view_termination_status_, exit_code);
1171 1172
1172 delegate_->RenderViewTerminated(this, 1173 delegate_->RenderViewTerminated(this,
1173 static_cast<base::TerminationStatus>(status), 1174 static_cast<base::TerminationStatus>(status),
1174 exit_code); 1175 exit_code);
1175 } 1176 }
1176 1177
1177 void RenderViewHostImpl::OnUpdateState(int32 page_id, const PageState& state) { 1178 void RenderViewHostImpl::OnUpdateState(int32 page_id, const PageState& state) {
1179 CHECK_EQ(page_id_, page_id);
1178 // Without this check, the renderer can trick the browser into using 1180 // Without this check, the renderer can trick the browser into using
1179 // filenames it can't access in a future session restore. 1181 // filenames it can't access in a future session restore.
1180 if (!CanAccessFilesOfPageState(state)) { 1182 if (!CanAccessFilesOfPageState(state)) {
1181 GetProcess()->ReceivedBadMessage(); 1183 GetProcess()->ReceivedBadMessage();
1182 return; 1184 return;
1183 } 1185 }
1184 1186
1185 delegate_->UpdateState(this, page_id, state); 1187 delegate_->UpdateState(this, page_id_, state);
1186 } 1188 }
1187 1189
1188 void RenderViewHostImpl::OnUpdateTitle( 1190 void RenderViewHostImpl::OnUpdateTitle(
1189 int32 page_id, 1191 int32 page_id,
1190 const base::string16& title, 1192 const base::string16& title,
1191 blink::WebTextDirection title_direction) { 1193 blink::WebTextDirection title_direction) {
1194 CHECK_EQ(page_id_, page_id);
1192 if (title.length() > kMaxTitleChars) { 1195 if (title.length() > kMaxTitleChars) {
1193 NOTREACHED() << "Renderer sent too many characters in title."; 1196 NOTREACHED() << "Renderer sent too many characters in title.";
1194 return; 1197 return;
1195 } 1198 }
1196 1199
1197 delegate_->UpdateTitle(this, page_id, title, 1200 delegate_->UpdateTitle(this, page_id_, title,
1198 WebTextDirectionToChromeTextDirection( 1201 WebTextDirectionToChromeTextDirection(
1199 title_direction)); 1202 title_direction));
1200 } 1203 }
1201 1204
1202 void RenderViewHostImpl::OnUpdateEncoding(const std::string& encoding_name) { 1205 void RenderViewHostImpl::OnUpdateEncoding(const std::string& encoding_name) {
1203 delegate_->UpdateEncoding(this, encoding_name); 1206 delegate_->UpdateEncoding(this, encoding_name);
1204 } 1207 }
1205 1208
1206 void RenderViewHostImpl::OnUpdateTargetURL(int32 page_id, const GURL& url) { 1209 void RenderViewHostImpl::OnUpdateTargetURL(int32 page_id, const GURL& url) {
1210 CHECK_EQ(page_id_, page_id);
1207 if (IsRVHStateActive(rvh_state_)) 1211 if (IsRVHStateActive(rvh_state_))
1208 delegate_->UpdateTargetURL(page_id, url); 1212 delegate_->UpdateTargetURL(page_id_, url);
1209 1213
1210 // Send a notification back to the renderer that we are ready to 1214 // Send a notification back to the renderer that we are ready to
1211 // receive more target urls. 1215 // receive more target urls.
1212 Send(new ViewMsg_UpdateTargetURL_ACK(GetRoutingID())); 1216 Send(new ViewMsg_UpdateTargetURL_ACK(GetRoutingID()));
1213 } 1217 }
1214 1218
1215 void RenderViewHostImpl::OnUpdateInspectorSetting( 1219 void RenderViewHostImpl::OnUpdateInspectorSetting(
1216 const std::string& key, const std::string& value) { 1220 const std::string& key, const std::string& value) {
1217 GetContentClient()->browser()->UpdateInspectorSetting( 1221 GetContentClient()->browser()->UpdateInspectorSetting(
1218 this, key, value); 1222 this, key, value);
(...skipping 14 matching lines...) Expand all
1233 void RenderViewHostImpl::OnDidChangeLoadProgress(double load_progress) { 1237 void RenderViewHostImpl::OnDidChangeLoadProgress(double load_progress) {
1234 delegate_->DidChangeLoadProgress(load_progress); 1238 delegate_->DidChangeLoadProgress(load_progress);
1235 } 1239 }
1236 1240
1237 void RenderViewHostImpl::OnDocumentAvailableInMainFrame() { 1241 void RenderViewHostImpl::OnDocumentAvailableInMainFrame() {
1238 delegate_->DocumentAvailableInMainFrame(this); 1242 delegate_->DocumentAvailableInMainFrame(this);
1239 } 1243 }
1240 1244
1241 void RenderViewHostImpl::OnDocumentOnLoadCompletedInMainFrame( 1245 void RenderViewHostImpl::OnDocumentOnLoadCompletedInMainFrame(
1242 int32 page_id) { 1246 int32 page_id) {
1243 delegate_->DocumentOnLoadCompletedInMainFrame(this, page_id); 1247 CHECK_EQ(page_id_, page_id);
1248 delegate_->DocumentOnLoadCompletedInMainFrame(this, page_id_);
1244 } 1249 }
1245 1250
1246 void RenderViewHostImpl::OnToggleFullscreen(bool enter_fullscreen) { 1251 void RenderViewHostImpl::OnToggleFullscreen(bool enter_fullscreen) {
1247 DCHECK_CURRENTLY_ON(BrowserThread::UI); 1252 DCHECK_CURRENTLY_ON(BrowserThread::UI);
1248 delegate_->ToggleFullscreenMode(enter_fullscreen); 1253 delegate_->ToggleFullscreenMode(enter_fullscreen);
1249 // We need to notify the contents that its fullscreen state has changed. This 1254 // We need to notify the contents that its fullscreen state has changed. This
1250 // is done as part of the resize message. 1255 // is done as part of the resize message.
1251 WasResized(); 1256 WasResized();
1252 } 1257 }
1253 1258
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
1732 return true; 1737 return true;
1733 } 1738 }
1734 1739
1735 void RenderViewHostImpl::AttachToFrameTree() { 1740 void RenderViewHostImpl::AttachToFrameTree() {
1736 FrameTree* frame_tree = delegate_->GetFrameTree(); 1741 FrameTree* frame_tree = delegate_->GetFrameTree();
1737 1742
1738 frame_tree->ResetForMainFrameSwap(); 1743 frame_tree->ResetForMainFrameSwap();
1739 } 1744 }
1740 1745
1741 } // namespace content 1746 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_view_host_impl.h ('k') | content/browser/web_contents/web_contents_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698