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

Side by Side Diff: chrome/renderer/render_view.cc

Issue 545054: Introduce all the plumbing for Session Storage. This mostly consists of crea... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 11 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
« no previous file with comments | « chrome/renderer/render_view.h ('k') | chrome/renderer/renderer_webkitclient_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "chrome/renderer/render_view.h" 5 #include "chrome/renderer/render_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 } 237 }
238 238
239 return false; 239 return false;
240 } 240 }
241 241
242 /////////////////////////////////////////////////////////////////////////////// 242 ///////////////////////////////////////////////////////////////////////////////
243 243
244 int32 RenderView::next_page_id_ = 1; 244 int32 RenderView::next_page_id_ = 1;
245 245
246 RenderView::RenderView(RenderThreadBase* render_thread, 246 RenderView::RenderView(RenderThreadBase* render_thread,
247 const WebPreferences& webkit_preferences) 247 const WebPreferences& webkit_preferences,
248 int64 session_storage_namespace_id)
248 : RenderWidget(render_thread, true), 249 : RenderWidget(render_thread, true),
249 enabled_bindings_(0), 250 enabled_bindings_(0),
250 target_url_status_(TARGET_NONE), 251 target_url_status_(TARGET_NONE),
251 is_loading_(false), 252 is_loading_(false),
252 navigation_gesture_(NavigationGestureUnknown), 253 navigation_gesture_(NavigationGestureUnknown),
253 page_id_(-1), 254 page_id_(-1),
254 last_page_id_sent_to_browser_(-1), 255 last_page_id_sent_to_browser_(-1),
255 last_indexed_page_id_(-1), 256 last_indexed_page_id_(-1),
256 opened_by_user_gesture_(true), 257 opened_by_user_gesture_(true),
257 opener_suppressed_(false), 258 opener_suppressed_(false),
(...skipping 13 matching lines...) Expand all
271 ALLOW_THIS_IN_INITIALIZER_LIST( 272 ALLOW_THIS_IN_INITIALIZER_LIST(
272 notification_provider_(new NotificationProvider(this))), 273 notification_provider_(new NotificationProvider(this))),
273 determine_page_text_after_loading_stops_(false), 274 determine_page_text_after_loading_stops_(false),
274 view_type_(ViewType::INVALID), 275 view_type_(ViewType::INVALID),
275 browser_window_id_(-1), 276 browser_window_id_(-1),
276 last_top_level_navigation_page_id_(-1), 277 last_top_level_navigation_page_id_(-1),
277 #if defined(OS_MACOSX) 278 #if defined(OS_MACOSX)
278 has_document_tag_(false), 279 has_document_tag_(false),
279 #endif 280 #endif
280 document_tag_(0), 281 document_tag_(0),
281 webkit_preferences_(webkit_preferences) { 282 webkit_preferences_(webkit_preferences),
283 session_storage_namespace_id_(session_storage_namespace_id) {
282 } 284 }
283 285
284 RenderView::~RenderView() { 286 RenderView::~RenderView() {
285 if (decrement_shared_popup_at_destruction_) 287 if (decrement_shared_popup_at_destruction_)
286 shared_popup_counter_->data--; 288 shared_popup_counter_->data--;
287 289
288 // Dispose of un-disposed image fetchers. 290 // Dispose of un-disposed image fetchers.
289 for (ImageResourceFetcherSet::iterator i = image_fetchers_.begin(); 291 for (ImageResourceFetcherSet::iterator i = image_fetchers_.begin();
290 i != image_fetchers_.end(); ++i) { 292 i != image_fetchers_.end(); ++i) {
291 delete *i; 293 delete *i;
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 } 330 }
329 331
330 /*static*/ 332 /*static*/
331 RenderView* RenderView::Create( 333 RenderView* RenderView::Create(
332 RenderThreadBase* render_thread, 334 RenderThreadBase* render_thread,
333 gfx::NativeViewId parent_hwnd, 335 gfx::NativeViewId parent_hwnd,
334 int32 opener_id, 336 int32 opener_id,
335 const RendererPreferences& renderer_prefs, 337 const RendererPreferences& renderer_prefs,
336 const WebPreferences& webkit_prefs, 338 const WebPreferences& webkit_prefs,
337 SharedRenderViewCounter* counter, 339 SharedRenderViewCounter* counter,
338 int32 routing_id) { 340 int32 routing_id,
341 int64 session_storage_namespace_id) {
339 DCHECK(routing_id != MSG_ROUTING_NONE); 342 DCHECK(routing_id != MSG_ROUTING_NONE);
340 scoped_refptr<RenderView> view = new RenderView(render_thread, webkit_prefs); 343 scoped_refptr<RenderView> view = new RenderView(render_thread, webkit_prefs,
344 session_storage_namespace_id);
341 view->Init(parent_hwnd, 345 view->Init(parent_hwnd,
342 opener_id, 346 opener_id,
343 renderer_prefs, 347 renderer_prefs,
344 counter, 348 counter,
345 routing_id); // adds reference 349 routing_id); // adds reference
346 return view; 350 return view;
347 } 351 }
348 352
349 /*static*/ 353 /*static*/
350 void RenderView::SetNextPageID(int32 next_page_id) { 354 void RenderView::SetNextPageID(int32 next_page_id) {
(...skipping 997 matching lines...) Expand 10 before | Expand all | Expand 10 after
1348 if (shared_popup_counter_->data > kMaximumNumberOfUnacknowledgedPopups) 1352 if (shared_popup_counter_->data > kMaximumNumberOfUnacknowledgedPopups)
1349 return NULL; 1353 return NULL;
1350 1354
1351 // This window can't be closed from a window.close() call until we receive a 1355 // This window can't be closed from a window.close() call until we receive a
1352 // message from the Browser process explicitly allowing it. 1356 // message from the Browser process explicitly allowing it.
1353 popup_notification_visible_ = true; 1357 popup_notification_visible_ = true;
1354 1358
1355 int32 routing_id = MSG_ROUTING_NONE; 1359 int32 routing_id = MSG_ROUTING_NONE;
1356 bool user_gesture = creator->isProcessingUserGesture(); 1360 bool user_gesture = creator->isProcessingUserGesture();
1357 bool opener_suppressed = creator->willSuppressOpenerInNewFrame(); 1361 bool opener_suppressed = creator->willSuppressOpenerInNewFrame();
1362 int64 cloned_session_storage_namespace_id;
1358 1363
1359 render_thread_->Send( 1364 render_thread_->Send(
1360 new ViewHostMsg_CreateWindow(routing_id_, user_gesture, &routing_id)); 1365 new ViewHostMsg_CreateWindow(routing_id_, user_gesture,
1366 session_storage_namespace_id_,
1367 &routing_id,
1368 &cloned_session_storage_namespace_id));
1361 if (routing_id == MSG_ROUTING_NONE) 1369 if (routing_id == MSG_ROUTING_NONE)
1362 return NULL; 1370 return NULL;
1363 1371
1364 RenderView* view = RenderView::Create(render_thread_, 1372 RenderView* view = RenderView::Create(render_thread_,
1365 0, 1373 0,
1366 routing_id_, 1374 routing_id_,
1367 renderer_preferences_, 1375 renderer_preferences_,
1368 webkit_preferences_, 1376 webkit_preferences_,
1369 shared_popup_counter_, 1377 shared_popup_counter_,
1370 routing_id); 1378 routing_id,
1379 cloned_session_storage_namespace_id);
1371 view->opened_by_user_gesture_ = user_gesture; 1380 view->opened_by_user_gesture_ = user_gesture;
1372 1381
1373 // Record whether the creator frame is trying to suppress the opener field. 1382 // Record whether the creator frame is trying to suppress the opener field.
1374 view->opener_suppressed_ = opener_suppressed; 1383 view->opener_suppressed_ = opener_suppressed;
1375 1384
1376 // Record the security origin of the creator. 1385 // Record the security origin of the creator.
1377 GURL creator_url(creator->securityOrigin().toString().utf8()); 1386 GURL creator_url(creator->securityOrigin().toString().utf8());
1378 if (!creator_url.is_valid() || !creator_url.IsStandard()) 1387 if (!creator_url.is_valid() || !creator_url.IsStandard())
1379 creator_url = GURL(); 1388 creator_url = GURL();
1380 view->creator_url_ = creator_url; 1389 view->creator_url_ = creator_url;
(...skipping 2590 matching lines...) Expand 10 before | Expand all | Expand 10 after
3971 new PluginMsg_SignalModalDialogEvent(host_window_)); 3980 new PluginMsg_SignalModalDialogEvent(host_window_));
3972 3981
3973 message->EnableMessagePumping(); // Runs a nested message loop. 3982 message->EnableMessagePumping(); // Runs a nested message loop.
3974 bool rv = Send(message); 3983 bool rv = Send(message);
3975 3984
3976 PluginChannelHost::Broadcast( 3985 PluginChannelHost::Broadcast(
3977 new PluginMsg_ResetModalDialogEvent(host_window_)); 3986 new PluginMsg_ResetModalDialogEvent(host_window_));
3978 3987
3979 return rv; 3988 return rv;
3980 } 3989 }
OLDNEW
« no previous file with comments | « chrome/renderer/render_view.h ('k') | chrome/renderer/renderer_webkitclient_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698