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

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

Issue 19491004: Fix SessionStorage confusion between RenderViewHostImpl and NavigationController. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 return static_cast<RenderViewHostImpl*>( 146 return static_cast<RenderViewHostImpl*>(
147 RenderViewHost::FromID(render_process_id, render_view_id)); 147 RenderViewHost::FromID(render_process_id, render_view_id));
148 } 148 }
149 149
150 RenderViewHostImpl::RenderViewHostImpl( 150 RenderViewHostImpl::RenderViewHostImpl(
151 SiteInstance* instance, 151 SiteInstance* instance,
152 RenderViewHostDelegate* delegate, 152 RenderViewHostDelegate* delegate,
153 RenderWidgetHostDelegate* widget_delegate, 153 RenderWidgetHostDelegate* widget_delegate,
154 int routing_id, 154 int routing_id,
155 int main_frame_routing_id, 155 int main_frame_routing_id,
156 bool swapped_out, 156 bool swapped_out)
157 SessionStorageNamespace* session_storage)
158 : RenderWidgetHostImpl(widget_delegate, instance->GetProcess(), routing_id), 157 : RenderWidgetHostImpl(widget_delegate, instance->GetProcess(), routing_id),
159 delegate_(delegate), 158 delegate_(delegate),
160 instance_(static_cast<SiteInstanceImpl*>(instance)), 159 instance_(static_cast<SiteInstanceImpl*>(instance)),
161 waiting_for_drag_context_response_(false), 160 waiting_for_drag_context_response_(false),
162 enabled_bindings_(0), 161 enabled_bindings_(0),
163 navigations_suspended_(false), 162 navigations_suspended_(false),
164 has_accessed_initial_document_(false), 163 has_accessed_initial_document_(false),
165 is_swapped_out_(swapped_out), 164 is_swapped_out_(swapped_out),
166 is_subframe_(false), 165 is_subframe_(false),
167 main_frame_id_(-1), 166 main_frame_id_(-1),
168 run_modal_reply_msg_(NULL), 167 run_modal_reply_msg_(NULL),
169 run_modal_opener_id_(MSG_ROUTING_NONE), 168 run_modal_opener_id_(MSG_ROUTING_NONE),
170 is_waiting_for_beforeunload_ack_(false), 169 is_waiting_for_beforeunload_ack_(false),
171 is_waiting_for_unload_ack_(false), 170 is_waiting_for_unload_ack_(false),
172 has_timed_out_on_unload_(false), 171 has_timed_out_on_unload_(false),
173 unload_ack_is_for_cross_site_transition_(false), 172 unload_ack_is_for_cross_site_transition_(false),
174 are_javascript_messages_suppressed_(false), 173 are_javascript_messages_suppressed_(false),
175 sudden_termination_allowed_(false), 174 sudden_termination_allowed_(false),
176 session_storage_namespace_(
177 static_cast<SessionStorageNamespaceImpl*>(session_storage)),
178 render_view_termination_status_(base::TERMINATION_STATUS_STILL_RUNNING) { 175 render_view_termination_status_(base::TERMINATION_STATUS_STILL_RUNNING) {
179 DCHECK(session_storage_namespace_.get());
180 DCHECK(instance_.get()); 176 DCHECK(instance_.get());
181 CHECK(delegate_); // http://crbug.com/82827 177 CHECK(delegate_); // http://crbug.com/82827
182 178
183 if (main_frame_routing_id == MSG_ROUTING_NONE) 179 if (main_frame_routing_id == MSG_ROUTING_NONE)
184 main_frame_routing_id = GetProcess()->GetNextRoutingID(); 180 main_frame_routing_id = GetProcess()->GetNextRoutingID();
185 181
186 main_render_frame_host_.reset( 182 main_render_frame_host_.reset(
187 new RenderFrameHostImpl(this, main_frame_routing_id, is_swapped_out_)); 183 new RenderFrameHostImpl(this, main_frame_routing_id, is_swapped_out_));
188 184
189 GetProcess()->EnableSendQueue(); 185 GetProcess()->EnableSendQueue();
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 if (max_page_id > -1) 246 if (max_page_id > -1)
251 next_page_id = max_page_id + 1; 247 next_page_id = max_page_id + 1;
252 248
253 ViewMsg_New_Params params; 249 ViewMsg_New_Params params;
254 params.renderer_preferences = 250 params.renderer_preferences =
255 delegate_->GetRendererPrefs(GetProcess()->GetBrowserContext()); 251 delegate_->GetRendererPrefs(GetProcess()->GetBrowserContext());
256 params.web_preferences = delegate_->GetWebkitPrefs(); 252 params.web_preferences = delegate_->GetWebkitPrefs();
257 params.view_id = GetRoutingID(); 253 params.view_id = GetRoutingID();
258 params.main_frame_routing_id = main_render_frame_host_->routing_id(); 254 params.main_frame_routing_id = main_render_frame_host_->routing_id();
259 params.surface_id = surface_id(); 255 params.surface_id = surface_id();
260 params.session_storage_namespace_id = session_storage_namespace_->id(); 256 params.session_storage_namespace_id =
257 delegate_->GetSessionStorageNamespace(instance_)->id();
261 params.frame_name = frame_name; 258 params.frame_name = frame_name;
262 // Ensure the RenderView sets its opener correctly. 259 // Ensure the RenderView sets its opener correctly.
263 params.opener_route_id = opener_route_id; 260 params.opener_route_id = opener_route_id;
264 params.swapped_out = is_swapped_out_; 261 params.swapped_out = is_swapped_out_;
265 params.next_page_id = next_page_id; 262 params.next_page_id = next_page_id;
266 GetWebScreenInfo(&params.screen_info); 263 GetWebScreenInfo(&params.screen_info);
267 params.accessibility_mode = accessibility_mode(); 264 params.accessibility_mode = accessibility_mode();
268 params.allow_partial_swap = !GetProcess()->IsGuest(); 265 params.allow_partial_swap = !GetProcess()->IsGuest();
269 266
270 Send(new ViewMsg_New(params)); 267 Send(new ViewMsg_New(params));
(...skipping 1782 matching lines...) Expand 10 before | Expand all | Expand 10 after
2053 const std::vector<base::FilePath>& file_paths = state.GetReferencedFiles(); 2050 const std::vector<base::FilePath>& file_paths = state.GetReferencedFiles();
2054 for (std::vector<base::FilePath>::const_iterator file = file_paths.begin(); 2051 for (std::vector<base::FilePath>::const_iterator file = file_paths.begin();
2055 file != file_paths.end(); ++file) { 2052 file != file_paths.end(); ++file) {
2056 if (!policy->CanReadFile(GetProcess()->GetID(), *file)) 2053 if (!policy->CanReadFile(GetProcess()->GetID(), *file))
2057 return false; 2054 return false;
2058 } 2055 }
2059 return true; 2056 return true;
2060 } 2057 }
2061 2058
2062 } // namespace content 2059 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_view_host_impl.h ('k') | content/browser/renderer_host/test_render_view_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698