| 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/test_webkit_platform_support.h" | 5 #include "webkit/support/test_webkit_platform_support.h" |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/metrics/stats_counters.h" | 8 #include "base/metrics/stats_counters.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/scoped_temp_dir.h" | 10 #include "base/scoped_temp_dir.h" |
| (...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 return active_theme_engine_; | 367 return active_theme_engine_; |
| 368 } | 368 } |
| 369 #endif | 369 #endif |
| 370 | 370 |
| 371 WebKit::WebSharedWorkerRepository* | 371 WebKit::WebSharedWorkerRepository* |
| 372 TestWebKitPlatformSupport::sharedWorkerRepository() { | 372 TestWebKitPlatformSupport::sharedWorkerRepository() { |
| 373 return NULL; | 373 return NULL; |
| 374 } | 374 } |
| 375 | 375 |
| 376 WebKit::WebGraphicsContext3D* | 376 WebKit::WebGraphicsContext3D* |
| 377 TestWebKitPlatformSupport::createGraphicsContext3D() { | |
| 378 switch (webkit_support::GetGraphicsContext3DImplementation()) { | |
| 379 case webkit_support::IN_PROCESS: | |
| 380 return new webkit::gpu::WebGraphicsContext3DInProcessImpl( | |
| 381 gfx::kNullPluginWindow, NULL); | |
| 382 case webkit_support::IN_PROCESS_COMMAND_BUFFER: | |
| 383 return new webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl(); | |
| 384 default: | |
| 385 CHECK(false) << "Unknown GraphicsContext3D Implementation"; | |
| 386 return NULL; | |
| 387 } | |
| 388 } | |
| 389 | |
| 390 WebKit::WebGraphicsContext3D* | |
| 391 TestWebKitPlatformSupport::createOffscreenGraphicsContext3D( | 377 TestWebKitPlatformSupport::createOffscreenGraphicsContext3D( |
| 392 const WebKit::WebGraphicsContext3D::Attributes& attributes) { | 378 const WebKit::WebGraphicsContext3D::Attributes& attributes) { |
| 393 scoped_ptr<WebKit::WebGraphicsContext3D> context; | |
| 394 switch (webkit_support::GetGraphicsContext3DImplementation()) { | 379 switch (webkit_support::GetGraphicsContext3DImplementation()) { |
| 395 case webkit_support::IN_PROCESS: | 380 case webkit_support::IN_PROCESS: |
| 396 context.reset(new webkit::gpu::WebGraphicsContext3DInProcessImpl( | 381 return webkit::gpu::WebGraphicsContext3DInProcessImpl::CreateForWebView( |
| 397 gfx::kNullPluginWindow, NULL)); | 382 attributes, NULL, false); |
| 398 break; | 383 case webkit_support::IN_PROCESS_COMMAND_BUFFER: { |
| 399 case webkit_support::IN_PROCESS_COMMAND_BUFFER: | 384 scoped_ptr<WebKit::WebGraphicsContext3D> context( |
| 400 context.reset( | |
| 401 new webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl()); | 385 new webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl()); |
| 402 break; | 386 if (!context->initialize(attributes, NULL, false)) |
| 387 return NULL; |
| 388 return context.release(); |
| 389 } |
| 403 } | 390 } |
| 404 if (!context->initialize(attributes, NULL, false)) | 391 NOTREACHED(); |
| 405 return NULL; | 392 return NULL; |
| 406 return context.release(); | |
| 407 } | 393 } |
| 408 | 394 |
| 409 double TestWebKitPlatformSupport::audioHardwareSampleRate() { | 395 double TestWebKitPlatformSupport::audioHardwareSampleRate() { |
| 410 return 44100.0; | 396 return 44100.0; |
| 411 } | 397 } |
| 412 | 398 |
| 413 size_t TestWebKitPlatformSupport::audioHardwareBufferSize() { | 399 size_t TestWebKitPlatformSupport::audioHardwareBufferSize() { |
| 414 return 128; | 400 return 128; |
| 415 } | 401 } |
| 416 | 402 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 456 const webkit_glue::ResourceLoaderBridge::RequestInfo& request_info) { | 442 const webkit_glue::ResourceLoaderBridge::RequestInfo& request_info) { |
| 457 return SimpleResourceLoaderBridge::Create(request_info); | 443 return SimpleResourceLoaderBridge::Create(request_info); |
| 458 } | 444 } |
| 459 | 445 |
| 460 webkit_glue::WebSocketStreamHandleBridge* | 446 webkit_glue::WebSocketStreamHandleBridge* |
| 461 TestWebKitPlatformSupport::CreateWebSocketBridge( | 447 TestWebKitPlatformSupport::CreateWebSocketBridge( |
| 462 WebKit::WebSocketStreamHandle* handle, | 448 WebKit::WebSocketStreamHandle* handle, |
| 463 webkit_glue::WebSocketStreamHandleDelegate* delegate) { | 449 webkit_glue::WebSocketStreamHandleDelegate* delegate) { |
| 464 return SimpleSocketStreamBridge::Create(handle, delegate); | 450 return SimpleSocketStreamBridge::Create(handle, delegate); |
| 465 } | 451 } |
| OLD | NEW |