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