OLD | NEW |
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/renderer/render_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 WebFileChooserCompletion* completion; // MAY BE NULL to skip callback. | 330 WebFileChooserCompletion* completion; // MAY BE NULL to skip callback. |
331 }; | 331 }; |
332 | 332 |
333 RenderViewImpl::RenderViewImpl( | 333 RenderViewImpl::RenderViewImpl( |
334 gfx::NativeViewId parent_hwnd, | 334 gfx::NativeViewId parent_hwnd, |
335 int32 opener_id, | 335 int32 opener_id, |
336 const content::RendererPreferences& renderer_prefs, | 336 const content::RendererPreferences& renderer_prefs, |
337 const WebPreferences& webkit_prefs, | 337 const WebPreferences& webkit_prefs, |
338 SharedRenderViewCounter* counter, | 338 SharedRenderViewCounter* counter, |
339 int32 routing_id, | 339 int32 routing_id, |
| 340 int32 surface_id, |
340 int64 session_storage_namespace_id, | 341 int64 session_storage_namespace_id, |
341 const string16& frame_name, | 342 const string16& frame_name, |
342 int32 next_page_id) | 343 int32 next_page_id) |
343 : RenderWidget(WebKit::WebPopupTypeNone), | 344 : RenderWidget(WebKit::WebPopupTypeNone), |
344 webkit_preferences_(webkit_prefs), | 345 webkit_preferences_(webkit_prefs), |
345 send_content_state_immediately_(false), | 346 send_content_state_immediately_(false), |
346 enabled_bindings_(0), | 347 enabled_bindings_(0), |
347 send_preferred_size_changes_(false), | 348 send_preferred_size_changes_(false), |
348 is_loading_(false), | 349 is_loading_(false), |
349 navigation_gesture_(NavigationGestureUnknown), | 350 navigation_gesture_(NavigationGestureUnknown), |
(...skipping 18 matching lines...) Expand all Loading... |
368 p2p_socket_dispatcher_(NULL), | 369 p2p_socket_dispatcher_(NULL), |
369 devtools_agent_(NULL), | 370 devtools_agent_(NULL), |
370 renderer_accessibility_(NULL), | 371 renderer_accessibility_(NULL), |
371 session_storage_namespace_id_(session_storage_namespace_id), | 372 session_storage_namespace_id_(session_storage_namespace_id), |
372 handling_select_range_(false), | 373 handling_select_range_(false), |
373 #if defined(OS_WIN) | 374 #if defined(OS_WIN) |
374 focused_plugin_id_(-1), | 375 focused_plugin_id_(-1), |
375 #endif | 376 #endif |
376 ALLOW_THIS_IN_INITIALIZER_LIST(pepper_delegate_(this)) { | 377 ALLOW_THIS_IN_INITIALIZER_LIST(pepper_delegate_(this)) { |
377 routing_id_ = routing_id; | 378 routing_id_ = routing_id; |
| 379 surface_id_ = surface_id; |
378 if (opener_id != MSG_ROUTING_NONE) | 380 if (opener_id != MSG_ROUTING_NONE) |
379 opener_id_ = opener_id; | 381 opener_id_ = opener_id; |
380 | 382 |
381 // Ensure we start with a valid next_page_id_ from the browser. | 383 // Ensure we start with a valid next_page_id_ from the browser. |
382 DCHECK_GE(next_page_id_, 0); | 384 DCHECK_GE(next_page_id_, 0); |
383 | 385 |
384 #if defined(ENABLE_NOTIFICATIONS) | 386 #if defined(ENABLE_NOTIFICATIONS) |
385 notification_provider_ = new NotificationProvider(this); | 387 notification_provider_ = new NotificationProvider(this); |
386 #else | 388 #else |
387 notification_provider_ = NULL; | 389 notification_provider_ = NULL; |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
507 } | 509 } |
508 | 510 |
509 /*static*/ | 511 /*static*/ |
510 RenderViewImpl* RenderViewImpl::Create( | 512 RenderViewImpl* RenderViewImpl::Create( |
511 gfx::NativeViewId parent_hwnd, | 513 gfx::NativeViewId parent_hwnd, |
512 int32 opener_id, | 514 int32 opener_id, |
513 const content::RendererPreferences& renderer_prefs, | 515 const content::RendererPreferences& renderer_prefs, |
514 const WebPreferences& webkit_prefs, | 516 const WebPreferences& webkit_prefs, |
515 SharedRenderViewCounter* counter, | 517 SharedRenderViewCounter* counter, |
516 int32 routing_id, | 518 int32 routing_id, |
| 519 int32 surface_id, |
517 int64 session_storage_namespace_id, | 520 int64 session_storage_namespace_id, |
518 const string16& frame_name, | 521 const string16& frame_name, |
519 int32 next_page_id) { | 522 int32 next_page_id) { |
520 DCHECK(routing_id != MSG_ROUTING_NONE); | 523 DCHECK(routing_id != MSG_ROUTING_NONE); |
521 return new RenderViewImpl( | 524 return new RenderViewImpl( |
522 parent_hwnd, | 525 parent_hwnd, |
523 opener_id, | 526 opener_id, |
524 renderer_prefs, | 527 renderer_prefs, |
525 webkit_prefs, | 528 webkit_prefs, |
526 counter, | 529 counter, |
527 routing_id, | 530 routing_id, |
| 531 surface_id, |
528 session_storage_namespace_id, | 532 session_storage_namespace_id, |
529 frame_name, | 533 frame_name, |
530 next_page_id); // adds reference | 534 next_page_id); // adds reference |
531 } | 535 } |
532 | 536 |
533 WebKit::WebPeerConnectionHandler* RenderViewImpl::CreatePeerConnectionHandler( | 537 WebKit::WebPeerConnectionHandler* RenderViewImpl::CreatePeerConnectionHandler( |
534 WebKit::WebPeerConnectionHandlerClient* client) { | 538 WebKit::WebPeerConnectionHandlerClient* client) { |
535 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); | 539 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); |
536 if (!cmd_line->HasSwitch(switches::kEnableMediaStream)) | 540 if (!cmd_line->HasSwitch(switches::kEnableMediaStream)) |
537 return NULL; | 541 return NULL; |
(...skipping 799 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1337 params.session_storage_namespace_id = session_storage_namespace_id_; | 1341 params.session_storage_namespace_id = session_storage_namespace_id_; |
1338 params.frame_name = frame_name; | 1342 params.frame_name = frame_name; |
1339 params.opener_frame_id = creator->identifier(); | 1343 params.opener_frame_id = creator->identifier(); |
1340 params.opener_url = creator->document().url(); | 1344 params.opener_url = creator->document().url(); |
1341 params.opener_security_origin = | 1345 params.opener_security_origin = |
1342 creator->document().securityOrigin().toString().utf8(); | 1346 creator->document().securityOrigin().toString().utf8(); |
1343 if (!request.isNull()) | 1347 if (!request.isNull()) |
1344 params.target_url = request.url(); | 1348 params.target_url = request.url(); |
1345 | 1349 |
1346 int32 routing_id = MSG_ROUTING_NONE; | 1350 int32 routing_id = MSG_ROUTING_NONE; |
| 1351 int32 surface_id = 0; |
1347 int64 cloned_session_storage_namespace_id; | 1352 int64 cloned_session_storage_namespace_id; |
1348 bool opener_suppressed = creator->willSuppressOpenerInNewFrame(); | 1353 bool opener_suppressed = creator->willSuppressOpenerInNewFrame(); |
1349 | 1354 |
1350 RenderThread::Get()->Send( | 1355 RenderThread::Get()->Send( |
1351 new ViewHostMsg_CreateWindow(params, | 1356 new ViewHostMsg_CreateWindow(params, |
1352 &routing_id, | 1357 &routing_id, |
| 1358 &surface_id, |
1353 &cloned_session_storage_namespace_id)); | 1359 &cloned_session_storage_namespace_id)); |
1354 if (routing_id == MSG_ROUTING_NONE) | 1360 if (routing_id == MSG_ROUTING_NONE) |
1355 return NULL; | 1361 return NULL; |
1356 | 1362 |
1357 RenderViewImpl* view = RenderViewImpl::Create( | 1363 RenderViewImpl* view = RenderViewImpl::Create( |
1358 0, | 1364 0, |
1359 routing_id_, | 1365 routing_id_, |
1360 renderer_preferences_, | 1366 renderer_preferences_, |
1361 webkit_preferences_, | 1367 webkit_preferences_, |
1362 shared_popup_counter_, | 1368 shared_popup_counter_, |
1363 routing_id, | 1369 routing_id, |
| 1370 surface_id, |
1364 cloned_session_storage_namespace_id, | 1371 cloned_session_storage_namespace_id, |
1365 frame_name, | 1372 frame_name, |
1366 1); | 1373 1); |
1367 view->opened_by_user_gesture_ = params.user_gesture; | 1374 view->opened_by_user_gesture_ = params.user_gesture; |
1368 | 1375 |
1369 // Record whether the creator frame is trying to suppress the opener field. | 1376 // Record whether the creator frame is trying to suppress the opener field. |
1370 view->opener_suppressed_ = opener_suppressed; | 1377 view->opener_suppressed_ = opener_suppressed; |
1371 | 1378 |
1372 // Record the security origin of the creator. | 1379 // Record the security origin of the creator. |
1373 GURL creator_url(creator->document().securityOrigin().toString().utf8()); | 1380 GURL creator_url(creator->document().securityOrigin().toString().utf8()); |
(...skipping 3493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4867 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { | 4874 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { |
4868 return !!RenderThreadImpl::current()->compositor_thread(); | 4875 return !!RenderThreadImpl::current()->compositor_thread(); |
4869 } | 4876 } |
4870 | 4877 |
4871 void RenderViewImpl::OnJavaBridgeInit() { | 4878 void RenderViewImpl::OnJavaBridgeInit() { |
4872 DCHECK(!java_bridge_dispatcher_.get()); | 4879 DCHECK(!java_bridge_dispatcher_.get()); |
4873 #if defined(ENABLE_JAVA_BRIDGE) | 4880 #if defined(ENABLE_JAVA_BRIDGE) |
4874 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this)); | 4881 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this)); |
4875 #endif | 4882 #endif |
4876 } | 4883 } |
OLD | NEW |