| 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 "webkit/support/webkit_support.h" | 5 #include "webkit/support/webkit_support.h" |
| 6 | 6 |
| 7 #include "base/at_exit.h" | 7 #include "base/at_exit.h" |
| 8 #include "base/base64.h" | 8 #include "base/base64.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 #include "ui/gl/gl_implementation.h" | 50 #include "ui/gl/gl_implementation.h" |
| 51 #include "ui/gl/gl_surface.h" | 51 #include "ui/gl/gl_surface.h" |
| 52 #include "webkit/appcache/web_application_cache_host_impl.h" | 52 #include "webkit/appcache/web_application_cache_host_impl.h" |
| 53 #include "webkit/base/file_path_string_conversions.h" | 53 #include "webkit/base/file_path_string_conversions.h" |
| 54 #include "webkit/compositor_bindings/web_compositor_support_impl.h" | 54 #include "webkit/compositor_bindings/web_compositor_support_impl.h" |
| 55 #include "webkit/compositor_bindings/web_layer_tree_view_impl_for_testing.h" | 55 #include "webkit/compositor_bindings/web_layer_tree_view_impl_for_testing.h" |
| 56 #include "webkit/fileapi/isolated_context.h" | 56 #include "webkit/fileapi/isolated_context.h" |
| 57 #include "webkit/glue/webkit_constants.h" | 57 #include "webkit/glue/webkit_constants.h" |
| 58 #include "webkit/glue/webkit_glue.h" | 58 #include "webkit/glue/webkit_glue.h" |
| 59 #include "webkit/glue/webkitplatformsupport_impl.h" | 59 #include "webkit/glue/webkitplatformsupport_impl.h" |
| 60 #include "webkit/glue/webthread_impl.h" |
| 60 #include "webkit/glue/weburlrequest_extradata_impl.h" | 61 #include "webkit/glue/weburlrequest_extradata_impl.h" |
| 61 #include "webkit/gpu/test_context_provider_factory.h" | 62 #include "webkit/gpu/test_context_provider_factory.h" |
| 62 #include "webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h" | 63 #include "webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h" |
| 63 #include "webkit/gpu/webgraphicscontext3d_in_process_impl.h" | 64 #include "webkit/gpu/webgraphicscontext3d_in_process_impl.h" |
| 64 #if defined(OS_ANDROID) | 65 #if defined(OS_ANDROID) |
| 65 #include "webkit/media/android/media_player_bridge_manager_impl.h" | 66 #include "webkit/media/android/media_player_bridge_manager_impl.h" |
| 66 #include "webkit/media/android/webmediaplayer_in_process_android.h" | 67 #include "webkit/media/android/webmediaplayer_in_process_android.h" |
| 67 #include "webkit/media/android/webmediaplayer_manager_android.h" | 68 #include "webkit/media/android/webmediaplayer_manager_android.h" |
| 68 #endif | 69 #endif |
| 69 #include "webkit/media/media_stream_client.h" | 70 #include "webkit/media/media_stream_client.h" |
| (...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 517 if (!context->Initialize(attributes, NULL)) | 518 if (!context->Initialize(attributes, NULL)) |
| 518 return NULL; | 519 return NULL; |
| 519 return context.release(); | 520 return context.release(); |
| 520 } | 521 } |
| 521 } | 522 } |
| 522 NOTREACHED(); | 523 NOTREACHED(); |
| 523 return NULL; | 524 return NULL; |
| 524 } | 525 } |
| 525 | 526 |
| 526 static WebKit::WebLayerTreeView* CreateLayerTreeView( | 527 static WebKit::WebLayerTreeView* CreateLayerTreeView( |
| 527 WebKit::WebLayerTreeViewImplForTesting::RenderingType type, | 528 LayerTreeViewType type, |
| 528 DRTLayerTreeViewClient* client) { | 529 DRTLayerTreeViewClient* client, |
| 530 scoped_ptr<cc::Thread> compositor_thread) { |
| 529 scoped_ptr<WebKit::WebLayerTreeViewImplForTesting> view( | 531 scoped_ptr<WebKit::WebLayerTreeViewImplForTesting> view( |
| 530 new WebKit::WebLayerTreeViewImplForTesting(type, client)); | 532 new WebKit::WebLayerTreeViewImplForTesting(type, client)); |
| 531 | 533 |
| 534 if (!view->initialize(compositor_thread.Pass())) |
| 535 return NULL; |
| 536 return view.release(); |
| 537 } |
| 538 |
| 539 WebKit::WebLayerTreeView* CreateLayerTreeView( |
| 540 LayerTreeViewType type, |
| 541 DRTLayerTreeViewClient* client, |
| 542 WebKit::WebThread* thread) { |
| 543 scoped_ptr<cc::Thread> compositor_thread; |
| 544 if (thread) |
| 545 compositor_thread = cc::ThreadImpl::createForDifferentThread( |
| 546 static_cast<webkit_glue::WebThreadImpl*>(thread)-> |
| 547 message_loop()->message_loop_proxy()); |
| 548 return CreateLayerTreeView(type, client, compositor_thread.Pass()); |
| 549 } |
| 550 |
| 551 // DEPRECATED. TODO(jamesr): Remove these three after fixing WebKit callers. |
| 552 static WebKit::WebLayerTreeView* CreateLayerTreeView( |
| 553 LayerTreeViewType type, |
| 554 DRTLayerTreeViewClient* client) { |
| 532 scoped_ptr<cc::Thread> compositor_thread; | 555 scoped_ptr<cc::Thread> compositor_thread; |
| 533 | 556 |
| 534 webkit::WebCompositorSupportImpl* compositor_support_impl = | 557 webkit::WebCompositorSupportImpl* compositor_support_impl = |
| 535 test_environment->webkit_platform_support()->compositor_support_impl(); | 558 test_environment->webkit_platform_support()->compositor_support_impl(); |
| 536 if (compositor_support_impl->compositor_thread_message_loop_proxy()) | 559 if (compositor_support_impl->compositor_thread_message_loop_proxy()) |
| 537 compositor_thread = cc::ThreadImpl::createForDifferentThread( | 560 compositor_thread = cc::ThreadImpl::createForDifferentThread( |
| 538 compositor_support_impl->compositor_thread_message_loop_proxy()); | 561 compositor_support_impl->compositor_thread_message_loop_proxy()); |
| 539 | 562 return CreateLayerTreeView(type, client, compositor_thread.Pass()); |
| 540 if (!view->initialize(compositor_thread.Pass())) | |
| 541 return NULL; | |
| 542 return view.release(); | |
| 543 } | 563 } |
| 544 | |
| 545 WebKit::WebLayerTreeView* CreateLayerTreeViewSoftware( | 564 WebKit::WebLayerTreeView* CreateLayerTreeViewSoftware( |
| 546 DRTLayerTreeViewClient* client) { | 565 DRTLayerTreeViewClient* client) { |
| 547 return CreateLayerTreeView( | 566 return CreateLayerTreeView(SOFTWARE_CONTEXT, client); |
| 548 WebKit::WebLayerTreeViewImplForTesting::SOFTWARE_CONTEXT, client); | |
| 549 } | 567 } |
| 550 | |
| 551 WebKit::WebLayerTreeView* CreateLayerTreeView3d( | 568 WebKit::WebLayerTreeView* CreateLayerTreeView3d( |
| 552 DRTLayerTreeViewClient* client) { | 569 DRTLayerTreeViewClient* client) { |
| 553 return CreateLayerTreeView( | 570 return CreateLayerTreeView(MESA_CONTEXT, client); |
| 554 WebKit::WebLayerTreeViewImplForTesting::MESA_CONTEXT, client); | |
| 555 } | 571 } |
| 556 | 572 |
| 557 void RegisterMockedURL(const WebKit::WebURL& url, | 573 void RegisterMockedURL(const WebKit::WebURL& url, |
| 558 const WebKit::WebURLResponse& response, | 574 const WebKit::WebURLResponse& response, |
| 559 const WebKit::WebString& file_path) { | 575 const WebKit::WebString& file_path) { |
| 560 test_environment->webkit_platform_support()->url_loader_factory()-> | 576 test_environment->webkit_platform_support()->url_loader_factory()-> |
| 561 RegisterURL(url, response, file_path); | 577 RegisterURL(url, response, file_path); |
| 562 } | 578 } |
| 563 | 579 |
| 564 void RegisterMockedErrorURL(const WebKit::WebURL& url, | 580 void RegisterMockedErrorURL(const WebKit::WebURL& url, |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 919 // Logging | 935 // Logging |
| 920 void EnableWebCoreLogChannels(const std::string& channels) { | 936 void EnableWebCoreLogChannels(const std::string& channels) { |
| 921 webkit_glue::EnableWebCoreLogChannels(channels); | 937 webkit_glue::EnableWebCoreLogChannels(channels); |
| 922 } | 938 } |
| 923 | 939 |
| 924 void SetGamepadData(const WebKit::WebGamepads& pads) { | 940 void SetGamepadData(const WebKit::WebGamepads& pads) { |
| 925 test_environment->webkit_platform_support()->setGamepadData(pads); | 941 test_environment->webkit_platform_support()->setGamepadData(pads); |
| 926 } | 942 } |
| 927 | 943 |
| 928 } // namespace webkit_support | 944 } // namespace webkit_support |
| OLD | NEW |