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

Side by Side Diff: webkit/tools/test_shell/test_shell_webkit_init.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: correct review items 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/tools/test_shell/test_shell_webkit_init.h" 5 #include "webkit/tools/test_shell/test_shell_webkit_init.h"
6 6
7 #include "base/metrics/stats_counters.h" 7 #include "base/metrics/stats_counters.h"
8 #include "base/path_service.h" 8 #include "base/path_service.h"
9 #include "media/base/media.h" 9 #include "media/base/media.h"
10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCache.h" 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCache.h"
11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDatabase.h" 11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDatabase.h"
12 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" 12 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h"
13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRuntimeFeatures.h" 13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRuntimeFeatures.h"
14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScriptController.h " 14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScriptController.h "
15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityPolicy.h" 15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityPolicy.h"
16 #include "ui/gfx/gl/gl_bindings_skia_in_process.h" 16 #include "ui/gfx/gl/gl_bindings_skia_in_process.h"
17 #include "v8/include/v8.h" 17 #include "v8/include/v8.h"
18 #include "webkit/plugins/npapi/plugin_list.h"
19 #include "webkit/plugins/webplugininfo.h"
20 #include "webkit/tools/test_shell/simple_socket_stream_bridge.h"
18 #include "webkit/tools/test_shell/test_shell.h" 21 #include "webkit/tools/test_shell/test_shell.h"
19 22
20 #if defined(OS_WIN) 23 #if defined(OS_WIN)
21 #include "webkit/tools/test_shell/test_shell_webthemeengine.h" 24 #include "webkit/tools/test_shell/test_shell_webthemeengine.h"
22 #endif 25 #endif
23 26
24 TestShellWebKitInit::TestShellWebKitInit(bool layout_test_mode) { 27 TestShellWebKitInit::TestShellWebKitInit(bool layout_test_mode) {
25 v8::V8::SetCounterFunction(base::StatsTable::FindLocation); 28 v8::V8::SetCounterFunction(base::StatsTable::FindLocation);
26 29
27 WebKit::initialize(this); 30 WebKit::initialize(this);
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 296
294 WebKit::WebSharedWorkerRepository* 297 WebKit::WebSharedWorkerRepository*
295 TestShellWebKitInit::sharedWorkerRepository() { 298 TestShellWebKitInit::sharedWorkerRepository() {
296 return NULL; 299 return NULL;
297 } 300 }
298 301
299 WebKit::WebGraphicsContext3D* TestShellWebKitInit::createGraphicsContext3D() { 302 WebKit::WebGraphicsContext3D* TestShellWebKitInit::createGraphicsContext3D() {
300 return new webkit::gpu::WebGraphicsContext3DInProcessImpl( 303 return new webkit::gpu::WebGraphicsContext3DInProcessImpl(
301 gfx::kNullPluginWindow, NULL); 304 gfx::kNullPluginWindow, NULL);
302 } 305 }
306
307 void TestShellWebKitInit::GetPlugins(
308 bool refresh, std::vector<webkit::WebPluginInfo>* plugins) {
309 if (refresh)
310 webkit::npapi::PluginList::Singleton()->RefreshPlugins();
311 webkit::npapi::PluginList::Singleton()->GetPlugins(plugins);
312 // Don't load the forked TestNetscapePlugIn in the chromium code, use
313 // the copy in webkit.org's repository instead.
314 const FilePath::StringType kPluginBlackList[] = {
315 FILE_PATH_LITERAL("npapi_layout_test_plugin.dll"),
316 FILE_PATH_LITERAL("WebKitTestNetscapePlugIn.plugin"),
317 FILE_PATH_LITERAL("libnpapi_layout_test_plugin.so"),
318 };
319 for (int i = plugins->size() - 1; i >= 0; --i) {
320 webkit::WebPluginInfo plugin_info = plugins->at(i);
321 for (size_t j = 0; j < arraysize(kPluginBlackList); ++j) {
322 if (plugin_info.path.BaseName() == FilePath(kPluginBlackList[j])) {
323 plugins->erase(plugins->begin() + i);
324 }
325 }
326 }
327 }
328
329 webkit_glue::ResourceLoaderBridge*
330 TestShellWebKitInit::CreateResourceLoader(
331 const webkit_glue::ResourceLoaderBridge::RequestInfo& request_info) {
332 return SimpleResourceLoaderBridge::Create(request_info);
333 }
334
335 webkit_glue::WebSocketStreamHandleBridge*
336 TestShellWebKitInit::CreateWebSocketBridge(
337 WebKit::WebSocketStreamHandle* handle,
338 webkit_glue::WebSocketStreamHandleDelegate* delegate) {
339 return SimpleSocketStreamBridge::Create(handle, delegate);
340 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698