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

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

Issue 18500005: Fix SessionStorage confusion between RenderViewHostImpl and NavigationController. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: code review Created 7 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 | 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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 return static_cast<RenderViewHostImpl*>( 147 return static_cast<RenderViewHostImpl*>(
148 RenderViewHost::FromID(render_process_id, render_view_id)); 148 RenderViewHost::FromID(render_process_id, render_view_id));
149 } 149 }
150 150
151 RenderViewHostImpl::RenderViewHostImpl( 151 RenderViewHostImpl::RenderViewHostImpl(
152 SiteInstance* instance, 152 SiteInstance* instance,
153 RenderViewHostDelegate* delegate, 153 RenderViewHostDelegate* delegate,
154 RenderWidgetHostDelegate* widget_delegate, 154 RenderWidgetHostDelegate* widget_delegate,
155 int routing_id, 155 int routing_id,
156 int main_frame_routing_id, 156 int main_frame_routing_id,
157 bool swapped_out, 157 bool swapped_out)
158 SessionStorageNamespace* session_storage)
159 : RenderWidgetHostImpl(widget_delegate, instance->GetProcess(), routing_id), 158 : RenderWidgetHostImpl(widget_delegate, instance->GetProcess(), routing_id),
160 delegate_(delegate), 159 delegate_(delegate),
161 instance_(static_cast<SiteInstanceImpl*>(instance)), 160 instance_(static_cast<SiteInstanceImpl*>(instance)),
162 waiting_for_drag_context_response_(false), 161 waiting_for_drag_context_response_(false),
163 enabled_bindings_(0), 162 enabled_bindings_(0),
164 navigations_suspended_(false), 163 navigations_suspended_(false),
165 has_accessed_initial_document_(false), 164 has_accessed_initial_document_(false),
166 is_swapped_out_(swapped_out), 165 is_swapped_out_(swapped_out),
167 is_subframe_(false), 166 is_subframe_(false),
168 main_frame_id_(-1), 167 main_frame_id_(-1),
169 run_modal_reply_msg_(NULL), 168 run_modal_reply_msg_(NULL),
170 run_modal_opener_id_(MSG_ROUTING_NONE), 169 run_modal_opener_id_(MSG_ROUTING_NONE),
171 is_waiting_for_beforeunload_ack_(false), 170 is_waiting_for_beforeunload_ack_(false),
172 is_waiting_for_unload_ack_(false), 171 is_waiting_for_unload_ack_(false),
173 has_timed_out_on_unload_(false), 172 has_timed_out_on_unload_(false),
174 unload_ack_is_for_cross_site_transition_(false), 173 unload_ack_is_for_cross_site_transition_(false),
175 are_javascript_messages_suppressed_(false), 174 are_javascript_messages_suppressed_(false),
176 sudden_termination_allowed_(false), 175 sudden_termination_allowed_(false),
177 session_storage_namespace_(
178 static_cast<SessionStorageNamespaceImpl*>(session_storage)),
179 render_view_termination_status_(base::TERMINATION_STATUS_STILL_RUNNING) { 176 render_view_termination_status_(base::TERMINATION_STATUS_STILL_RUNNING) {
180 DCHECK(session_storage_namespace_.get());
181 DCHECK(instance_.get()); 177 DCHECK(instance_.get());
182 CHECK(delegate_); // http://crbug.com/82827 178 CHECK(delegate_); // http://crbug.com/82827
183 179
184 if (main_frame_routing_id == MSG_ROUTING_NONE) 180 if (main_frame_routing_id == MSG_ROUTING_NONE)
185 main_frame_routing_id = GetProcess()->GetNextRoutingID(); 181 main_frame_routing_id = GetProcess()->GetNextRoutingID();
186 182
187 main_render_frame_host_.reset( 183 main_render_frame_host_.reset(
188 new RenderFrameHostImpl(this, main_frame_routing_id, is_swapped_out_)); 184 new RenderFrameHostImpl(this, main_frame_routing_id, is_swapped_out_));
189 185
190 GetProcess()->EnableSendQueue(); 186 GetProcess()->EnableSendQueue();
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 if (max_page_id > -1) 249 if (max_page_id > -1)
254 next_page_id = max_page_id + 1; 250 next_page_id = max_page_id + 1;
255 251
256 ViewMsg_New_Params params; 252 ViewMsg_New_Params params;
257 params.renderer_preferences = 253 params.renderer_preferences =
258 delegate_->GetRendererPrefs(GetProcess()->GetBrowserContext()); 254 delegate_->GetRendererPrefs(GetProcess()->GetBrowserContext());
259 params.web_preferences = delegate_->GetWebkitPrefs(); 255 params.web_preferences = delegate_->GetWebkitPrefs();
260 params.view_id = GetRoutingID(); 256 params.view_id = GetRoutingID();
261 params.main_frame_routing_id = main_render_frame_host_->routing_id(); 257 params.main_frame_routing_id = main_render_frame_host_->routing_id();
262 params.surface_id = surface_id(); 258 params.surface_id = surface_id();
263 params.session_storage_namespace_id = session_storage_namespace_->id(); 259 params.session_storage_namespace_id =
260 delegate_->GetSessionStorageNamespace()->id();
264 params.frame_name = frame_name; 261 params.frame_name = frame_name;
265 // Ensure the RenderView sets its opener correctly. 262 // Ensure the RenderView sets its opener correctly.
266 params.opener_route_id = opener_route_id; 263 params.opener_route_id = opener_route_id;
267 params.swapped_out = is_swapped_out_; 264 params.swapped_out = is_swapped_out_;
268 params.next_page_id = next_page_id; 265 params.next_page_id = next_page_id;
269 GetWebScreenInfo(&params.screen_info); 266 GetWebScreenInfo(&params.screen_info);
270 params.accessibility_mode = accessibility_mode(); 267 params.accessibility_mode = accessibility_mode();
271 params.allow_partial_swap = !GetProcess()->IsGuest(); 268 params.allow_partial_swap = !GetProcess()->IsGuest();
272 269
273 Send(new ViewMsg_New(params)); 270 Send(new ViewMsg_New(params));
(...skipping 1815 matching lines...) Expand 10 before | Expand all | Expand 10 after
2089 const std::vector<base::FilePath>& file_paths = state.GetReferencedFiles(); 2086 const std::vector<base::FilePath>& file_paths = state.GetReferencedFiles();
2090 for (std::vector<base::FilePath>::const_iterator file = file_paths.begin(); 2087 for (std::vector<base::FilePath>::const_iterator file = file_paths.begin();
2091 file != file_paths.end(); ++file) { 2088 file != file_paths.end(); ++file) {
2092 if (!policy->CanReadFile(GetProcess()->GetID(), *file)) 2089 if (!policy->CanReadFile(GetProcess()->GetID(), *file))
2093 return false; 2090 return false;
2094 } 2091 }
2095 return true; 2092 return true;
2096 } 2093 }
2097 2094
2098 } // namespace content 2095 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698