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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: webkit/support/test_webkit_platform_support.cc
diff --git a/webkit/support/test_webkit_platform_support.cc b/webkit/support/test_webkit_platform_support.cc
index 8db2e944152181d0c007a6b2fd0d8d6433d6cd61..ae85283da4ce6596d9c45073f73fdfc00da5177b 100644
--- a/webkit/support/test_webkit_platform_support.cc
+++ b/webkit/support/test_webkit_platform_support.cc
@@ -42,6 +42,7 @@
#include "webkit/glue/webkitplatformsupport_impl.h"
#include "webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h"
#include "webkit/gpu/webgraphicscontext3d_in_process_impl.h"
+#include "webkit/plugins/npapi/plugin_list.h"
#include "webkit/support/simple_database_system.h"
#include "webkit/support/test_webmessageportchannel.h"
#include "webkit/support/webkit_support.h"
@@ -50,6 +51,7 @@
#include "webkit/tools/test_shell/mock_webclipboard_impl.h"
#include "webkit/tools/test_shell/simple_appcache_system.h"
#include "webkit/tools/test_shell/simple_file_system.h"
+#include "webkit/tools/test_shell/simple_socket_stream_bridge.h"
#include "webkit/tools/test_shell/simple_resource_loader_bridge.h"
#include "webkit/tools/test_shell/simple_webcookiejar_impl.h"
#include "webkit/tools/test_shell/test_shell_request_context.h"
@@ -396,3 +398,38 @@ WebKit::WebAudioDevice* TestWebKitPlatformSupport::createAudioDevice(
WebKit::WebAudioDevice::RenderCallback*) {
return new WebAudioDeviceMock(sampleRate);
}
+
+void TestWebKitPlatformSupport::GetPlugins(
+ bool refresh, std::vector<webkit::WebPluginInfo>* plugins) {
+ if (refresh)
+ webkit::npapi::PluginList::Singleton()->RefreshPlugins();
+ webkit::npapi::PluginList::Singleton()->GetPlugins(plugins);
+ // Don't load the forked npapi_layout_test_plugin in DRT, we only want to
+ // use the upstream version TestNetscapePlugIn.
+ const FilePath::StringType kPluginBlackList[] = {
+ FILE_PATH_LITERAL("npapi_layout_test_plugin.dll"),
+ FILE_PATH_LITERAL("WebKitTestNetscapePlugIn.plugin"),
+ FILE_PATH_LITERAL("libnpapi_layout_test_plugin.so"),
+ };
+ for (int i = plugins->size() - 1; i >= 0; --i) {
+ webkit::WebPluginInfo plugin_info = plugins->at(i);
+ for (size_t j = 0; j < arraysize(kPluginBlackList); ++j) {
+ if (plugin_info.path.BaseName() == FilePath(kPluginBlackList[j])) {
+ plugins->erase(plugins->begin() + i);
+ }
+ }
+ }
+}
+
+webkit_glue::ResourceLoaderBridge*
+TestWebKitPlatformSupport::CreateResourceLoader(
+ const webkit_glue::ResourceLoaderBridge::RequestInfo& request_info) {
+ return SimpleResourceLoaderBridge::Create(request_info);
+}
+
+webkit_glue::WebSocketStreamHandleBridge*
+TestWebKitPlatformSupport::CreateWebSocketBridge(
+ WebKit::WebSocketStreamHandle* handle,
+ webkit_glue::WebSocketStreamHandleDelegate* delegate) {
+ return SimpleSocketStreamBridge::Create(handle, delegate);
+}

Powered by Google App Engine
This is Rietveld 408576698