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

Side by Side Diff: webkit/support/test_webkit_platform_support.cc

Issue 8602002: Move some webkit_glue embedder functions into WebKitPlatformSupport virtual methods (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: style Created 9 years, 1 month 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 24 matching lines...) Expand all
35 #include "v8/include/v8.h" 35 #include "v8/include/v8.h"
36 #include "webkit/appcache/web_application_cache_host_impl.h" 36 #include "webkit/appcache/web_application_cache_host_impl.h"
37 #include "webkit/database/vfs_backend.h" 37 #include "webkit/database/vfs_backend.h"
38 #include "webkit/extensions/v8/gc_extension.h" 38 #include "webkit/extensions/v8/gc_extension.h"
39 #include "webkit/glue/simple_webmimeregistry_impl.h" 39 #include "webkit/glue/simple_webmimeregistry_impl.h"
40 #include "webkit/glue/webclipboard_impl.h" 40 #include "webkit/glue/webclipboard_impl.h"
41 #include "webkit/glue/webkit_glue.h" 41 #include "webkit/glue/webkit_glue.h"
42 #include "webkit/glue/webkitplatformsupport_impl.h" 42 #include "webkit/glue/webkitplatformsupport_impl.h"
43 #include "webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h" 43 #include "webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h"
44 #include "webkit/gpu/webgraphicscontext3d_in_process_impl.h" 44 #include "webkit/gpu/webgraphicscontext3d_in_process_impl.h"
45 #include "webkit/plugins/npapi/plugin_list.h"
45 #include "webkit/support/simple_database_system.h" 46 #include "webkit/support/simple_database_system.h"
46 #include "webkit/support/test_webmessageportchannel.h" 47 #include "webkit/support/test_webmessageportchannel.h"
47 #include "webkit/support/webkit_support.h" 48 #include "webkit/support/webkit_support.h"
48 #include "webkit/support/weburl_loader_mock_factory.h" 49 #include "webkit/support/weburl_loader_mock_factory.h"
49 #include "webkit/support/web_audio_device_mock.h" 50 #include "webkit/support/web_audio_device_mock.h"
50 #include "webkit/tools/test_shell/mock_webclipboard_impl.h" 51 #include "webkit/tools/test_shell/mock_webclipboard_impl.h"
51 #include "webkit/tools/test_shell/simple_appcache_system.h" 52 #include "webkit/tools/test_shell/simple_appcache_system.h"
52 #include "webkit/tools/test_shell/simple_file_system.h" 53 #include "webkit/tools/test_shell/simple_file_system.h"
54 #include "webkit/tools/test_shell/simple_socket_stream_bridge.h"
53 #include "webkit/tools/test_shell/simple_resource_loader_bridge.h" 55 #include "webkit/tools/test_shell/simple_resource_loader_bridge.h"
54 #include "webkit/tools/test_shell/simple_webcookiejar_impl.h" 56 #include "webkit/tools/test_shell/simple_webcookiejar_impl.h"
55 #include "webkit/tools/test_shell/test_shell_request_context.h" 57 #include "webkit/tools/test_shell/test_shell_request_context.h"
56 #include "webkit/tools/test_shell/test_shell_webblobregistry_impl.h" 58 #include "webkit/tools/test_shell/test_shell_webblobregistry_impl.h"
57 59
58 #if defined(OS_WIN) 60 #if defined(OS_WIN)
59 #include "third_party/WebKit/Source/WebKit/chromium/public/win/WebThemeEngine.h" 61 #include "third_party/WebKit/Source/WebKit/chromium/public/win/WebThemeEngine.h"
60 #include "webkit/tools/test_shell/test_shell_webthemeengine.h" 62 #include "webkit/tools/test_shell/test_shell_webthemeengine.h"
61 #elif defined(OS_MACOSX) 63 #elif defined(OS_MACOSX)
62 #include "base/mac/mac_util.h" 64 #include "base/mac/mac_util.h"
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 391
390 size_t TestWebKitPlatformSupport::audioHardwareBufferSize() { 392 size_t TestWebKitPlatformSupport::audioHardwareBufferSize() {
391 return 128; 393 return 128;
392 } 394 }
393 395
394 WebKit::WebAudioDevice* TestWebKitPlatformSupport::createAudioDevice( 396 WebKit::WebAudioDevice* TestWebKitPlatformSupport::createAudioDevice(
395 size_t bufferSize, unsigned numberOfChannels, double sampleRate, 397 size_t bufferSize, unsigned numberOfChannels, double sampleRate,
396 WebKit::WebAudioDevice::RenderCallback*) { 398 WebKit::WebAudioDevice::RenderCallback*) {
397 return new WebAudioDeviceMock(sampleRate); 399 return new WebAudioDeviceMock(sampleRate);
398 } 400 }
401
402 void TestWebKitPlatformSupport::GetPlugins(
403 bool refresh, std::vector<webkit::WebPluginInfo>* plugins) {
404 if (refresh)
405 webkit::npapi::PluginList::Singleton()->RefreshPlugins();
406 webkit::npapi::PluginList::Singleton()->GetPlugins(plugins);
407 // Don't load the forked npapi_layout_test_plugin in DRT, we only want to
408 // use the upstream version TestNetscapePlugIn.
409 const FilePath::StringType kPluginBlackList[] = {
410 FILE_PATH_LITERAL("npapi_layout_test_plugin.dll"),
411 FILE_PATH_LITERAL("WebKitTestNetscapePlugIn.plugin"),
412 FILE_PATH_LITERAL("libnpapi_layout_test_plugin.so"),
413 };
414 for (int i = plugins->size() - 1; i >= 0; --i) {
415 webkit::WebPluginInfo plugin_info = plugins->at(i);
416 for (size_t j = 0; j < arraysize(kPluginBlackList); ++j) {
417 if (plugin_info.path.BaseName() == FilePath(kPluginBlackList[j])) {
418 plugins->erase(plugins->begin() + i);
419 }
420 }
421 }
422 }
423
424 webkit_glue::ResourceLoaderBridge*
425 TestWebKitPlatformSupport::CreateResourceLoader(
426 const webkit_glue::ResourceLoaderBridge::RequestInfo& request_info) {
427 return SimpleResourceLoaderBridge::Create(request_info);
428 }
429
430 webkit_glue::WebSocketStreamHandleBridge*
431 TestWebKitPlatformSupport::CreateWebSocketBridge(
432 WebKit::WebSocketStreamHandle* handle,
433 webkit_glue::WebSocketStreamHandleDelegate* delegate) {
434 return SimpleSocketStreamBridge::Create(handle, delegate);
435 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698