diff options
57 files changed, 495 insertions, 438 deletions
diff --git a/chrome/PRESUBMIT.py b/chrome/PRESUBMIT.py index 86be7e9..e9f377b 100755 --- a/chrome/PRESUBMIT.py +++ b/chrome/PRESUBMIT.py @@ -35,7 +35,7 @@ EXCLUDE = ( # Too much math on one line? r'bloom_filter\.cc$', # Bogus ifdef tricks - r'renderer_webkitclient_impl\.cc$', + r'renderer_webkitplatformsupport_impl\.cc$', # Lines > 100 chars r'gcapi\.cc$', ) diff --git a/chrome/browser/autofill/credit_card.cc b/chrome/browser/autofill/credit_card.cc index 81f8e9d..61057f2 100644 --- a/chrome/browser/autofill/credit_card.cc +++ b/chrome/browser/autofill/credit_card.cc @@ -583,9 +583,9 @@ std::ostream& operator<<(std::ostream& os, const CreditCard& credit_card) { << UTF16ToUTF8(credit_card.GetInfo(CREDIT_CARD_EXP_4_DIGIT_YEAR)); } -// These values must match the values in WebKitClientImpl in webkit/glue. We -// send these strings to WK, which then asks WebKitClientImpl to load the image -// data. +// These values must match the values in WebKitPlatformSupportImpl in +// webkit/glue. We send these strings to WebKit, which then asks +// WebKitPlatformSupportImpl to load the image data. const char* const kAmericanExpressCard = "americanExpressCC"; const char* const kDinersCard = "dinersCC"; const char* const kDiscoverCard = "discoverCC"; diff --git a/chrome/browser/idbbindingutilities_browsertest.cc b/chrome/browser/idbbindingutilities_browsertest.cc index 327b723..ed126e7 100644 --- a/chrome/browser/idbbindingutilities_browsertest.cc +++ b/chrome/browser/idbbindingutilities_browsertest.cc @@ -17,7 +17,7 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/WebSerializedScriptValue.h" #include "webkit/glue/idb_bindings.h" #include "webkit/glue/web_io_operators.h" -#include "webkit/glue/webkitclient_impl.h" +#include "webkit/glue/webkitplatformsupport_impl.h" using WebKit::WebSerializedScriptValue; @@ -37,8 +37,8 @@ class ScopedShutdownWebKit { // Sanity test, check the function call directly outside the sandbox. TEST(IDBKeyPathWithoutSandbox, Value) { - webkit_glue::WebKitClientImpl webkit_client; - WebKit::initialize(&webkit_client); + webkit_glue::WebKitPlatformSupportImpl webkit_platform_support; + WebKit::initialize(&webkit_platform_support); ScopedShutdownWebKit shutdown_webkit; char16 data[] = {0x0353,0x6f66,0x536f,0x7a03,0x6f6f,0x017b}; diff --git a/chrome/browser/sessions/tab_restore_service_browsertest.cc b/chrome/browser/sessions/tab_restore_service_browsertest.cc index 1815375..ee4357c 100644 --- a/chrome/browser/sessions/tab_restore_service_browsertest.cc +++ b/chrome/browser/sessions/tab_restore_service_browsertest.cc @@ -49,7 +49,7 @@ class TabRestoreServiceTest : public RenderViewHostTestHarness { RenderViewHostTestHarness::SetUp(); time_factory_ = new TabRestoreTimeFactory(); service_.reset(new TabRestoreService(profile(), time_factory_)); - WebKit::initialize(&webkitclient_); + WebKit::initialize(&webkit_platform_support_); } virtual void TearDown() { @@ -119,7 +119,7 @@ class TabRestoreServiceTest : public RenderViewHostTestHarness { GURL url3_; scoped_ptr<TabRestoreService> service_; TabRestoreTimeFactory* time_factory_; - RenderViewTest::RendererWebKitClientImplNoSandbox webkitclient_; + RenderViewTest::RendererWebKitPlatformSupportImplNoSandbox webkit_platform_support_; }; TEST_F(TabRestoreServiceTest, Basic) { diff --git a/chrome/renderer/chrome_content_renderer_client.cc b/chrome/renderer/chrome_content_renderer_client.cc index 858d5ad..2057aa9 100644 --- a/chrome/renderer/chrome_content_renderer_client.cc +++ b/chrome/renderer/chrome_content_renderer_client.cc @@ -574,10 +574,11 @@ bool ChromeContentRendererClient::RunIdleHandlerWhenWidgetsHidden() { } bool ChromeContentRendererClient::AllowPopup(const GURL& creator) { + return true; // Extensions and apps always allowed to create unrequested popups. The second // check is necessary to include content scripts. - return extension_dispatcher_->extensions()->GetByURL(creator) || - bindings_utils::GetInfoForCurrentContext(); + // return extension_dispatcher_->extensions()->GetByURL(creator) || + // bindings_utils::GetInfoForCurrentContext(); } bool ChromeContentRendererClient::ShouldFork(WebFrame* frame, diff --git a/chrome/test/base/render_view_test.cc b/chrome/test/base/render_view_test.cc index f197e91..10f5b60 100644 --- a/chrome/test/base/render_view_test.cc +++ b/chrome/test/base/render_view_test.cc @@ -107,7 +107,7 @@ void RenderViewTest::SetUp() { // Setting flags and really doing anything with WebKit is fairly fragile and // hacky, but this is the world we live in... webkit_glue::SetJavaScriptFlags(" --expose-gc"); - WebKit::initialize(&webkitclient_); + WebKit::initialize(&webkit_platform_support_); WebScriptController::registerExtension(JsonSchemaJsV8Extension::Get()); WebScriptController::registerExtension(EventBindings::Get( extension_dispatcher_)); diff --git a/chrome/test/base/render_view_test.h b/chrome/test/base/render_view_test.h index a72afc0..50a3564 100644 --- a/chrome/test/base/render_view_test.h +++ b/chrome/test/base/render_view_test.h @@ -18,7 +18,7 @@ #include "content/common/native_web_keyboard_event.h" #include "content/common/sandbox_init_wrapper.h" #include "content/renderer/render_view.h" -#include "content/renderer/renderer_webkitclient_impl.h" +#include "content/renderer/renderer_webkitplatformsupport_impl.h" #include "chrome/renderer/chrome_content_renderer_client.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" @@ -34,9 +34,10 @@ class RendererMainPlatformDelegate; class RenderViewTest : public testing::Test { public: - // A special WebKitClientImpl class for getting rid off the dependency to the - // sandbox, which is not available in RenderViewTest. - class RendererWebKitClientImplNoSandbox : public RendererWebKitClientImpl { + // A special WebKitPlatformSupportImpl class for getting rid off the + // dependency to the sandbox, which is not available in RenderViewTest. + class RendererWebKitPlatformSupportImplNoSandbox : + public RendererWebKitPlatformSupportImpl { public: virtual WebKit::WebSandboxSupport* sandboxSupport() { return NULL; @@ -98,7 +99,7 @@ class RenderViewTest : public testing::Test { MockRenderThread render_thread_; scoped_ptr<MockRenderProcess> mock_process_; scoped_refptr<RenderView> view_; - RendererWebKitClientImplNoSandbox webkitclient_; + RendererWebKitPlatformSupportImplNoSandbox webkit_platform_support_; scoped_ptr<MockKeyboard> mock_keyboard_; // Used to setup the process so renderers can run. diff --git a/chrome/test/base/run_all_unittests.cc b/chrome/test/base/run_all_unittests.cc index 455ec28..a1b8746 100644 --- a/chrome/test/base/run_all_unittests.cc +++ b/chrome/test/base/run_all_unittests.cc @@ -4,14 +4,14 @@ #include "chrome/test/base/chrome_test_suite.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" -#include "third_party/WebKit/Source/WebKit/chromium/public/WebKitClient.h" +#include "third_party/WebKit/Source/WebKit/chromium/public/WebKitPlatformSupport.h" namespace { // A stubbed out webkit client impl. -class UnitTestWebKitClient : public WebKit::WebKitClient { +class UnitTestWebKitPlatformSupport : public WebKit::WebKitPlatformSupport { public: - UnitTestWebKitClient() { + UnitTestWebKitPlatformSupport() { } virtual void cryptographicallyRandomValues( @@ -33,7 +33,7 @@ class UnitTestTestSuite : public ChromeTestSuite { protected: virtual void Initialize() { - WebKit::initialize(&webkitclient_); + WebKit::initialize(&webkit_platform_support_); ChromeTestSuite::Initialize(); } virtual void Shutdown() { @@ -41,7 +41,7 @@ class UnitTestTestSuite : public ChromeTestSuite { WebKit::shutdown(); } - UnitTestWebKitClient webkitclient_; + UnitTestWebKitPlatformSupport webkit_platform_support_; }; } // namespace diff --git a/content/browser/in_process_webkit/browser_webkitclient_impl.cc b/content/browser/in_process_webkit/browser_webkitplatformsupport_impl.cc index 4506fc2..a10e0afd 100644 --- a/content/browser/in_process_webkit/browser_webkitclient_impl.cc +++ b/content/browser/in_process_webkit/browser_webkitplatformsupport_impl.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "content/browser/in_process_webkit/browser_webkitclient_impl.h" +#include "content/browser/in_process_webkit/browser_webkitplatformsupport_impl.h" #include "base/file_util.h" #include "base/logging.h" @@ -16,105 +16,107 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/WebURL.h" #include "webkit/glue/webkit_glue.h" -BrowserWebKitClientImpl::BrowserWebKitClientImpl() { +BrowserWebKitPlatformSupportImpl::BrowserWebKitPlatformSupportImpl() { file_utilities_.set_sandbox_enabled(false); } -BrowserWebKitClientImpl::~BrowserWebKitClientImpl() { +BrowserWebKitPlatformSupportImpl::~BrowserWebKitPlatformSupportImpl() { } -WebKit::WebClipboard* BrowserWebKitClientImpl::clipboard() { +WebKit::WebClipboard* BrowserWebKitPlatformSupportImpl::clipboard() { NOTREACHED(); return NULL; } -WebKit::WebMimeRegistry* BrowserWebKitClientImpl::mimeRegistry() { +WebKit::WebMimeRegistry* BrowserWebKitPlatformSupportImpl::mimeRegistry() { NOTREACHED(); return NULL; } -WebKit::WebFileUtilities* BrowserWebKitClientImpl::fileUtilities() { +WebKit::WebFileUtilities* BrowserWebKitPlatformSupportImpl::fileUtilities() { return &file_utilities_; } -WebKit::WebSandboxSupport* BrowserWebKitClientImpl::sandboxSupport() { +WebKit::WebSandboxSupport* BrowserWebKitPlatformSupportImpl::sandboxSupport() { NOTREACHED(); return NULL; } -bool BrowserWebKitClientImpl::sandboxEnabled() { +bool BrowserWebKitPlatformSupportImpl::sandboxEnabled() { return false; } -unsigned long long BrowserWebKitClientImpl::visitedLinkHash( +unsigned long long BrowserWebKitPlatformSupportImpl::visitedLinkHash( const char* canonical_url, size_t length) { NOTREACHED(); return 0; } -bool BrowserWebKitClientImpl::isLinkVisited(unsigned long long link_hash) { +bool BrowserWebKitPlatformSupportImpl::isLinkVisited(unsigned long long link_hash) { NOTREACHED(); return false; } WebKit::WebMessagePortChannel* -BrowserWebKitClientImpl::createMessagePortChannel() { +BrowserWebKitPlatformSupportImpl::createMessagePortChannel() { NOTREACHED(); return NULL; } -void BrowserWebKitClientImpl::setCookies( +void BrowserWebKitPlatformSupportImpl::setCookies( const WebKit::WebURL& url, const WebKit::WebURL& first_party_for_cookies, const WebKit::WebString& value) { NOTREACHED(); } -WebKit::WebString BrowserWebKitClientImpl::cookies( +WebKit::WebString BrowserWebKitPlatformSupportImpl::cookies( const WebKit::WebURL& url, const WebKit::WebURL& first_party_for_cookies) { NOTREACHED(); return WebKit::WebString(); } -void BrowserWebKitClientImpl::prefetchHostName(const WebKit::WebString&) { +void BrowserWebKitPlatformSupportImpl::prefetchHostName( + const WebKit::WebString&) { NOTREACHED(); } -WebKit::WebString BrowserWebKitClientImpl::defaultLocale() { +WebKit::WebString BrowserWebKitPlatformSupportImpl::defaultLocale() { NOTREACHED(); return WebKit::WebString(); } -WebKit::WebThemeEngine* BrowserWebKitClientImpl::themeEngine() { +WebKit::WebThemeEngine* BrowserWebKitPlatformSupportImpl::themeEngine() { NOTREACHED(); return NULL; } -WebKit::WebURLLoader* BrowserWebKitClientImpl::createURLLoader() { +WebKit::WebURLLoader* BrowserWebKitPlatformSupportImpl::createURLLoader() { NOTREACHED(); return NULL; } WebKit::WebSocketStreamHandle* - BrowserWebKitClientImpl::createSocketStreamHandle() { +BrowserWebKitPlatformSupportImpl::createSocketStreamHandle() { NOTREACHED(); return NULL; } -void BrowserWebKitClientImpl::getPluginList(bool refresh, +void BrowserWebKitPlatformSupportImpl::getPluginList(bool refresh, WebKit::WebPluginListBuilder* builder) { NOTREACHED(); } -WebKit::WebData BrowserWebKitClientImpl::loadResource(const char* name) { +WebKit::WebData BrowserWebKitPlatformSupportImpl::loadResource( + const char* name) { NOTREACHED(); return WebKit::WebData(); } WebKit::WebStorageNamespace* -BrowserWebKitClientImpl::createLocalStorageNamespace( +BrowserWebKitPlatformSupportImpl::createLocalStorageNamespace( const WebKit::WebString& path, unsigned quota) { // The "WebStorage" interface is used for renderer WebKit -> browser WebKit // communication only. "WebStorageClient" will be used for browser WebKit -> @@ -123,7 +125,7 @@ BrowserWebKitClientImpl::createLocalStorageNamespace( return 0; } -void BrowserWebKitClientImpl::dispatchStorageEvent( +void BrowserWebKitPlatformSupportImpl::dispatchStorageEvent( const WebKit::WebString& key, const WebKit::WebString& old_value, const WebKit::WebString& new_value, const WebKit::WebString& origin, const WebKit::WebURL& url, bool is_local_storage) { @@ -136,18 +138,19 @@ void BrowserWebKitClientImpl::dispatchStorageEvent( } WebKit::WebSharedWorkerRepository* -BrowserWebKitClientImpl::sharedWorkerRepository() { +BrowserWebKitPlatformSupportImpl::sharedWorkerRepository() { NOTREACHED(); return NULL; } -int BrowserWebKitClientImpl::databaseDeleteFile( +int BrowserWebKitPlatformSupportImpl::databaseDeleteFile( const WebKit::WebString& vfs_file_name, bool sync_dir) { const FilePath path = webkit_glue::WebStringToFilePath(vfs_file_name); return file_util::Delete(path, false) ? 0 : 1; } -void BrowserWebKitClientImpl::createIDBKeysFromSerializedValuesAndKeyPath( +void +BrowserWebKitPlatformSupportImpl::createIDBKeysFromSerializedValuesAndKeyPath( const WebKit::WebVector<WebKit::WebSerializedScriptValue>& values, const WebKit::WebString& keyPath, WebKit::WebVector<WebKit::WebIDBKey>& keys) { @@ -167,7 +170,7 @@ void BrowserWebKitClientImpl::createIDBKeysFromSerializedValuesAndKeyPath( } WebKit::WebSerializedScriptValue -BrowserWebKitClientImpl::injectIDBKeyIntoSerializedValue( +BrowserWebKitPlatformSupportImpl::injectIDBKeyIntoSerializedValue( const WebKit::WebIDBKey& key, const WebKit::WebSerializedScriptValue& value, const WebKit::WebString& keyPath) { return IndexedDBKeyUtilityClient::InjectIDBKeyIntoSerializedValue( diff --git a/content/browser/in_process_webkit/browser_webkitclient_impl.h b/content/browser/in_process_webkit/browser_webkitplatformsupport_impl.h index d18e06d..53575df 100644 --- a/content/browser/in_process_webkit/browser_webkitclient_impl.h +++ b/content/browser/in_process_webkit/browser_webkitplatformsupport_impl.h @@ -2,21 +2,22 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CONTENT_BROWSER_IN_PROCESS_WEBKIT_BROWSER_WEBKITCLIENT_IMPL_H_ -#define CONTENT_BROWSER_IN_PROCESS_WEBKIT_BROWSER_WEBKITCLIENT_IMPL_H_ +#ifndef CONTENT_BROWSER_IN_PROCESS_WEBKIT_BROWSER_WEBKITPLATFORMSUPPORT_IMPL_H_ +#define CONTENT_BROWSER_IN_PROCESS_WEBKIT_BROWSER_WEBKITPLATFORMSUPPORT_IMPL_H_ #pragma once #include "webkit/glue/webfileutilities_impl.h" -#include "webkit/glue/webkitclient_impl.h" +#include "webkit/glue/webkitplatformsupport_impl.h" class IndexedDBKeyUtilityClient; -class BrowserWebKitClientImpl : public webkit_glue::WebKitClientImpl { +class BrowserWebKitPlatformSupportImpl : + public webkit_glue::WebKitPlatformSupportImpl { public: - BrowserWebKitClientImpl(); - virtual ~BrowserWebKitClientImpl(); + BrowserWebKitPlatformSupportImpl(); + virtual ~BrowserWebKitPlatformSupportImpl(); - // WebKitClient methods: + // WebKitPlatformSupport methods: virtual WebKit::WebClipboard* clipboard(); virtual WebKit::WebMimeRegistry* mimeRegistry(); virtual WebKit::WebFileUtilities* fileUtilities(); @@ -61,4 +62,4 @@ class BrowserWebKitClientImpl : public webkit_glue::WebKitClientImpl { webkit_glue::WebFileUtilitiesImpl file_utilities_; }; -#endif // CONTENT_BROWSER_IN_PROCESS_WEBKIT_BROWSER_WEBKITCLIENT_IMPL_H_ +#endif // CONTENT_BROWSER_IN_PROCESS_WEBKIT_BROWSER_WEBKITPLATFORMSUPPORT_IMPL_H_ diff --git a/content/browser/in_process_webkit/webkit_thread.cc b/content/browser/in_process_webkit/webkit_thread.cc index 0613339..b9e1156 100644 --- a/content/browser/in_process_webkit/webkit_thread.cc +++ b/content/browser/in_process_webkit/webkit_thread.cc @@ -5,7 +5,7 @@ #include "content/browser/in_process_webkit/webkit_thread.h" #include "base/command_line.h" -#include "content/browser/in_process_webkit/browser_webkitclient_impl.h" +#include "content/browser/in_process_webkit/browser_webkitplatformsupport_impl.h" #include "content/common/content_switches.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h" @@ -45,9 +45,9 @@ WebKitThread::InternalWebKitThread::~InternalWebKitThread() { } void WebKitThread::InternalWebKitThread::Init() { - DCHECK(!webkit_client_.get()); - webkit_client_.reset(new BrowserWebKitClientImpl); - WebKit::initialize(webkit_client_.get()); + DCHECK(!webkit_platform_support_.get()); + webkit_platform_support_.reset(new BrowserWebKitPlatformSupportImpl); + WebKit::initialize(webkit_platform_support_.get()); webkit_glue::EnableWebCoreLogChannels( CommandLine::ForCurrentProcess()->GetSwitchValueASCII( switches::kWebCoreLogChannels)); @@ -61,6 +61,6 @@ void WebKitThread::InternalWebKitThread::Init() { } void WebKitThread::InternalWebKitThread::CleanUp() { - DCHECK(webkit_client_.get()); + DCHECK(webkit_platform_support_.get()); WebKit::shutdown(); } diff --git a/content/browser/in_process_webkit/webkit_thread.h b/content/browser/in_process_webkit/webkit_thread.h index fc97e21..3b2edd2 100644 --- a/content/browser/in_process_webkit/webkit_thread.h +++ b/content/browser/in_process_webkit/webkit_thread.h @@ -11,7 +11,7 @@ #include "base/threading/thread.h" #include "content/browser/browser_thread.h" -class BrowserWebKitClientImpl; +class BrowserWebKitPlatformSupportImpl; // This creates a WebKit main thread on instantiation (if not in // --single-process mode) on construction and kills it on deletion. @@ -34,8 +34,8 @@ class WebKitThread { virtual void CleanUp(); private: - // The WebKitClient implementation. Only access on WebKit thread. - scoped_ptr<BrowserWebKitClientImpl> webkit_client_; + // The WebKitPlatformSupport implementation. Only access on WebKit thread. + scoped_ptr<BrowserWebKitPlatformSupportImpl> webkit_platform_support_; }; // Pointer to the actual WebKitThread. diff --git a/content/browser/renderer_host/render_sandbox_host_linux.cc b/content/browser/renderer_host/render_sandbox_host_linux.cc index a1e49e1..3363a3b 100644 --- a/content/browser/renderer_host/render_sandbox_host_linux.cc +++ b/content/browser/renderer_host/render_sandbox_host_linux.cc @@ -33,7 +33,7 @@ #include "third_party/npapi/bindings/npapi_extensions.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" #include "third_party/WebKit/Source/WebKit/chromium/public/gtk/WebFontInfo.h" -#include "webkit/glue/webkitclient_impl.h" +#include "webkit/glue/webkitplatformsupport_impl.h" using WebKit::WebCString; using WebKit::WebFontInfo; @@ -645,19 +645,19 @@ class SandboxIPCProcess { const int browser_socket_; FontConfigDirect* const font_config_; std::vector<std::string> sandbox_cmd_; - scoped_ptr<webkit_glue::WebKitClientImpl> webkit_client_; + scoped_ptr<webkit_glue::WebKitPlatformSupportImpl> webkit_platform_support_; }; SandboxIPCProcess::~SandboxIPCProcess() { - if (webkit_client_.get()) + if (webkit_platform_support_.get()) WebKit::shutdown(); } void SandboxIPCProcess::EnsureWebKitInitialized() { - if (webkit_client_.get()) + if (webkit_platform_support_.get()) return; - webkit_client_.reset(new webkit_glue::WebKitClientImpl); - WebKit::initialize(webkit_client_.get()); + webkit_platform_support_.reset(new webkit_glue::WebKitPlatformSupportImpl); + WebKit::initialize(webkit_platform_support_.get()); } // ----------------------------------------------------------------------------- diff --git a/content/common/database_util.cc b/content/common/database_util.cc index fc40873..c58cca9 100644 --- a/content/common/database_util.cc +++ b/content/common/database_util.cc @@ -10,10 +10,10 @@ #include "third_party/sqlite/sqlite3.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" -using WebKit::WebKitClient; +using WebKit::WebKitPlatformSupport; using WebKit::WebString; -WebKitClient::FileHandle DatabaseUtil::DatabaseOpenFile( +WebKitPlatformSupport::FileHandle DatabaseUtil::DatabaseOpenFile( const WebString& vfs_file_name, int desired_flags) { IPC::PlatformFileForTransit file_handle = IPC::InvalidPlatformFileForTransit(); diff --git a/content/common/database_util.h b/content/common/database_util.h index cf2d706..ef9f219 100644 --- a/content/common/database_util.h +++ b/content/common/database_util.h @@ -6,13 +6,13 @@ #define CONTENT_COMMON_DATABASE_UTIL_H_ #pragma once -#include "webkit/glue/webkitclient_impl.h" +#include "webkit/glue/webkitplatformsupport_impl.h" -// A class of utility functions used by RendererWebKitClientImpl and -// WorkerWebKitClientImpl to handle database file accesses. +// A class of utility functions used by RendererWebKitPlatformSupportImpl and +// WorkerWebKitPlatformSupportImpl to handle database file accesses. class DatabaseUtil { public: - static WebKit::WebKitClient::FileHandle DatabaseOpenFile( + static WebKit::WebKitPlatformSupport::FileHandle DatabaseOpenFile( const WebKit::WebString& vfs_file_name, int desired_flags); static int DatabaseDeleteFile( const WebKit::WebString& vfs_file_name, bool sync_dir); diff --git a/content/content_browser.gypi b/content/content_browser.gypi index 713aded..a346ffe 100644 --- a/content/content_browser.gypi +++ b/content/content_browser.gypi @@ -230,8 +230,8 @@ 'browser/handle_enumerator_win.h', 'browser/host_zoom_map.cc', 'browser/host_zoom_map.h', - 'browser/in_process_webkit/browser_webkitclient_impl.cc', - 'browser/in_process_webkit/browser_webkitclient_impl.h', + 'browser/in_process_webkit/browser_webkitplatformsupport_impl.cc', + 'browser/in_process_webkit/browser_webkitplatformsupport_impl.h', 'browser/in_process_webkit/dom_storage_area.cc', 'browser/in_process_webkit/dom_storage_area.h', 'browser/in_process_webkit/dom_storage_context.cc', diff --git a/content/content_ppapi_plugin.gypi b/content/content_ppapi_plugin.gypi index 7040700..dfa320a 100644 --- a/content/content_ppapi_plugin.gypi +++ b/content/content_ppapi_plugin.gypi @@ -22,8 +22,8 @@ 'ppapi_plugin/ppapi_thread.h', 'ppapi_plugin/ppapi_webkit_thread.cc', 'ppapi_plugin/ppapi_webkit_thread.h', - 'ppapi_plugin/ppapi_webkitclient_impl.cc', - 'ppapi_plugin/ppapi_webkitclient_impl.h', + 'ppapi_plugin/ppapi_webkitplatformsupport_impl.cc', + 'ppapi_plugin/ppapi_webkitplatformsupport_impl.h', ], 'include_dirs': [ '..', diff --git a/content/content_renderer.gypi b/content/content_renderer.gypi index c1029d7..d14243a 100644 --- a/content/content_renderer.gypi +++ b/content/content_renderer.gypi @@ -156,8 +156,8 @@ 'renderer/renderer_webidbobjectstore_impl.h', 'renderer/renderer_webidbtransaction_impl.cc', 'renderer/renderer_webidbtransaction_impl.h', - 'renderer/renderer_webkitclient_impl.cc', - 'renderer/renderer_webkitclient_impl.h', + 'renderer/renderer_webkitplatformsupport_impl.cc', + 'renderer/renderer_webkitplatformsupport_impl.h', 'renderer/renderer_webstoragearea_impl.cc', 'renderer/renderer_webstoragearea_impl.h', 'renderer/renderer_webstoragenamespace_impl.cc', diff --git a/content/content_worker.gypi b/content/content_worker.gypi index be1a0ee..7ac57fe 100644 --- a/content/content_worker.gypi +++ b/content/content_worker.gypi @@ -29,8 +29,8 @@ 'worker/worker_thread.h', 'worker/worker_webapplicationcachehost_impl.cc', 'worker/worker_webapplicationcachehost_impl.h', - 'worker/worker_webkitclient_impl.cc', - 'worker/worker_webkitclient_impl.h', + 'worker/worker_webkitplatformsupport_impl.cc', + 'worker/worker_webkitplatformsupport_impl.h', ], 'include_dirs': [ '..', diff --git a/content/ppapi_plugin/ppapi_webkit_thread.cc b/content/ppapi_plugin/ppapi_webkit_thread.cc index 1320138..cb3d482 100644 --- a/content/ppapi_plugin/ppapi_webkit_thread.cc +++ b/content/ppapi_plugin/ppapi_webkit_thread.cc @@ -5,7 +5,7 @@ #include "content/ppapi_plugin/ppapi_webkit_thread.h" #include "base/logging.h" -#include "content/ppapi_plugin/ppapi_webkitclient_impl.h" +#include "content/ppapi_plugin/ppapi_webkitplatformsupport_impl.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" PpapiWebKitThread::PpapiWebKitThread() { @@ -33,12 +33,12 @@ PpapiWebKitThread::InternalWebKitThread::~InternalWebKitThread() { } void PpapiWebKitThread::InternalWebKitThread::Init() { - DCHECK(!webkit_client_.get()); - webkit_client_.reset(new PpapiWebKitClientImpl); - WebKit::initialize(webkit_client_.get()); + DCHECK(!webkit_platform_support_.get()); + webkit_platform_support_.reset(new PpapiWebKitPlatformSupportImpl); + WebKit::initialize(webkit_platform_support_.get()); } void PpapiWebKitThread::InternalWebKitThread::CleanUp() { - DCHECK(webkit_client_.get()); + DCHECK(webkit_platform_support_.get()); WebKit::shutdown(); } diff --git a/content/ppapi_plugin/ppapi_webkit_thread.h b/content/ppapi_plugin/ppapi_webkit_thread.h index a6f338e..dabee23 100644 --- a/content/ppapi_plugin/ppapi_webkit_thread.h +++ b/content/ppapi_plugin/ppapi_webkit_thread.h @@ -10,7 +10,7 @@ #include "base/memory/scoped_ptr.h" #include "base/threading/thread.h" -class PpapiWebKitClientImpl; +class PpapiWebKitPlatformSupportImpl; // This creates a WebKit main thread on instantiation on construction and kills // it on deletion. See also content/browser/in_process_webkit for the @@ -37,8 +37,8 @@ class PpapiWebKitThread { virtual void CleanUp(); private: - // The WebKitClient implementation. Only access on WebKit thread. - scoped_ptr<PpapiWebKitClientImpl> webkit_client_; + // The WebKitPlatformSupport implementation. Only access on WebKit thread. + scoped_ptr<PpapiWebKitPlatformSupportImpl> webkit_platform_support_; }; // Pointer to the actual WebKitThread. diff --git a/content/ppapi_plugin/ppapi_webkitclient_impl.cc b/content/ppapi_plugin/ppapi_webkitplatformsupport_impl.cc index d5f5de2..7a17787 100644 --- a/content/ppapi_plugin/ppapi_webkitclient_impl.cc +++ b/content/ppapi_plugin/ppapi_webkitplatformsupport_impl.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "content/ppapi_plugin/ppapi_webkitclient_impl.h" +#include "content/ppapi_plugin/ppapi_webkitplatformsupport_impl.h" #include <map> @@ -26,7 +26,7 @@ using WebKit::WebSandboxSupport; using WebKit::WebString; using WebKit::WebUChar; -class PpapiWebKitClientImpl::SandboxSupport : public WebSandboxSupport { +class PpapiWebKitPlatformSupportImpl::SandboxSupport : public WebSandboxSupport { public: virtual ~SandboxSupport() {} @@ -55,26 +55,30 @@ class PpapiWebKitClientImpl::SandboxSupport : public WebSandboxSupport { #if defined(OS_WIN) -bool PpapiWebKitClientImpl::SandboxSupport::ensureFontLoaded(HFONT font) { +bool PpapiWebKitPlatformSupportImpl::SandboxSupport::ensureFontLoaded( + HFONT font) { // TODO(brettw) this should do the something similar to what - // RendererWebKitClientImpl does and request that the browser load the font. + // RendererWebKitPlatformSupportImpl does and request that the browser load + // the font. NOTIMPLEMENTED(); return false; } #elif defined(OS_MACOSX) -bool PpapiWebKitClientImpl::SandboxSupport::loadFont(NSFont* srcFont, +bool PpapiWebKitPlatformSupportImpl::SandboxSupport::loadFont(NSFont* srcFont, ATSFontContainerRef* out, uint32_t* fontID) { // TODO(brettw) this should do the something similar to what - // RendererWebKitClientImpl does and request that the browser load the font. + // RendererWebKitPlatformSupportImpl does and request that the browser load + // the font. NOTIMPLEMENTED(); return false; } #elif defined(OS_POSIX) -WebString PpapiWebKitClientImpl::SandboxSupport::getFontFamilyForCharacters( +WebString +PpapiWebKitPlatformSupportImpl::SandboxSupport::getFontFamilyForCharacters( const WebUChar* characters, size_t num_characters, const char* preferred_locale) { @@ -94,7 +98,7 @@ WebString PpapiWebKitClientImpl::SandboxSupport::getFontFamilyForCharacters( return WebString::fromUTF8(family_name); } -void PpapiWebKitClientImpl::SandboxSupport::getRenderStyleForStrike( +void PpapiWebKitPlatformSupportImpl::SandboxSupport::getRenderStyleForStrike( const char* family, int sizeAndStyle, WebKit::WebFontRenderStyle* out) { child_process_sandbox_support::getRenderStyleForStrike(family, sizeAndStyle, out); @@ -102,111 +106,111 @@ void PpapiWebKitClientImpl::SandboxSupport::getRenderStyleForStrike( #endif -PpapiWebKitClientImpl::PpapiWebKitClientImpl() - : sandbox_support_(new PpapiWebKitClientImpl::SandboxSupport()) { +PpapiWebKitPlatformSupportImpl::PpapiWebKitPlatformSupportImpl() + : sandbox_support_(new PpapiWebKitPlatformSupportImpl::SandboxSupport()) { } -PpapiWebKitClientImpl::~PpapiWebKitClientImpl() { +PpapiWebKitPlatformSupportImpl::~PpapiWebKitPlatformSupportImpl() { } -WebKit::WebClipboard* PpapiWebKitClientImpl::clipboard() { +WebKit::WebClipboard* PpapiWebKitPlatformSupportImpl::clipboard() { NOTREACHED(); return NULL; } -WebKit::WebMimeRegistry* PpapiWebKitClientImpl::mimeRegistry() { +WebKit::WebMimeRegistry* PpapiWebKitPlatformSupportImpl::mimeRegistry() { NOTREACHED(); return NULL; } -WebKit::WebFileUtilities* PpapiWebKitClientImpl::fileUtilities() { +WebKit::WebFileUtilities* PpapiWebKitPlatformSupportImpl::fileUtilities() { NOTREACHED(); return NULL; } -WebKit::WebSandboxSupport* PpapiWebKitClientImpl::sandboxSupport() { +WebKit::WebSandboxSupport* PpapiWebKitPlatformSupportImpl::sandboxSupport() { return sandbox_support_.get(); } -bool PpapiWebKitClientImpl::sandboxEnabled() { +bool PpapiWebKitPlatformSupportImpl::sandboxEnabled() { return true; // Assume PPAPI is always sandboxed. } -unsigned long long PpapiWebKitClientImpl::visitedLinkHash( +unsigned long long PpapiWebKitPlatformSupportImpl::visitedLinkHash( const char* canonical_url, size_t length) { NOTREACHED(); return 0; } -bool PpapiWebKitClientImpl::isLinkVisited(unsigned long long link_hash) { +bool PpapiWebKitPlatformSupportImpl::isLinkVisited(unsigned long long link_hash) { NOTREACHED(); return false; } WebKit::WebMessagePortChannel* -PpapiWebKitClientImpl::createMessagePortChannel() { +PpapiWebKitPlatformSupportImpl::createMessagePortChannel() { NOTREACHED(); return NULL; } -void PpapiWebKitClientImpl::setCookies( +void PpapiWebKitPlatformSupportImpl::setCookies( const WebKit::WebURL& url, const WebKit::WebURL& first_party_for_cookies, const WebKit::WebString& value) { NOTREACHED(); } -WebKit::WebString PpapiWebKitClientImpl::cookies( +WebKit::WebString PpapiWebKitPlatformSupportImpl::cookies( const WebKit::WebURL& url, const WebKit::WebURL& first_party_for_cookies) { NOTREACHED(); return WebKit::WebString(); } -void PpapiWebKitClientImpl::prefetchHostName(const WebKit::WebString&) { +void PpapiWebKitPlatformSupportImpl::prefetchHostName(const WebKit::WebString&) { NOTREACHED(); } -WebKit::WebString PpapiWebKitClientImpl::defaultLocale() { +WebKit::WebString PpapiWebKitPlatformSupportImpl::defaultLocale() { NOTREACHED(); return WebKit::WebString(); } -WebKit::WebThemeEngine* PpapiWebKitClientImpl::themeEngine() { +WebKit::WebThemeEngine* PpapiWebKitPlatformSupportImpl::themeEngine() { NOTREACHED(); return NULL; } -WebKit::WebURLLoader* PpapiWebKitClientImpl::createURLLoader() { +WebKit::WebURLLoader* PpapiWebKitPlatformSupportImpl::createURLLoader() { NOTREACHED(); return NULL; } WebKit::WebSocketStreamHandle* - PpapiWebKitClientImpl::createSocketStreamHandle() { + PpapiWebKitPlatformSupportImpl::createSocketStreamHandle() { NOTREACHED(); return NULL; } -void PpapiWebKitClientImpl::getPluginList(bool refresh, +void PpapiWebKitPlatformSupportImpl::getPluginList(bool refresh, WebKit::WebPluginListBuilder* builder) { NOTREACHED(); } -WebKit::WebData PpapiWebKitClientImpl::loadResource(const char* name) { +WebKit::WebData PpapiWebKitPlatformSupportImpl::loadResource(const char* name) { NOTREACHED(); return WebKit::WebData(); } WebKit::WebStorageNamespace* -PpapiWebKitClientImpl::createLocalStorageNamespace( +PpapiWebKitPlatformSupportImpl::createLocalStorageNamespace( const WebKit::WebString& path, unsigned quota) { NOTREACHED(); return 0; } -void PpapiWebKitClientImpl::dispatchStorageEvent( +void PpapiWebKitPlatformSupportImpl::dispatchStorageEvent( const WebKit::WebString& key, const WebKit::WebString& old_value, const WebKit::WebString& new_value, const WebKit::WebString& origin, const WebKit::WebURL& url, bool is_local_storage) { @@ -214,18 +218,18 @@ void PpapiWebKitClientImpl::dispatchStorageEvent( } WebKit::WebSharedWorkerRepository* -PpapiWebKitClientImpl::sharedWorkerRepository() { +PpapiWebKitPlatformSupportImpl::sharedWorkerRepository() { NOTREACHED(); return NULL; } -int PpapiWebKitClientImpl::databaseDeleteFile( +int PpapiWebKitPlatformSupportImpl::databaseDeleteFile( const WebKit::WebString& vfs_file_name, bool sync_dir) { NOTREACHED(); return 0; } -void PpapiWebKitClientImpl::createIDBKeysFromSerializedValuesAndKeyPath( +void PpapiWebKitPlatformSupportImpl::createIDBKeysFromSerializedValuesAndKeyPath( const WebKit::WebVector<WebKit::WebSerializedScriptValue>& values, const WebKit::WebString& keyPath, WebKit::WebVector<WebKit::WebIDBKey>& keys) { @@ -233,7 +237,7 @@ void PpapiWebKitClientImpl::createIDBKeysFromSerializedValuesAndKeyPath( } WebKit::WebSerializedScriptValue -PpapiWebKitClientImpl::injectIDBKeyIntoSerializedValue( +PpapiWebKitPlatformSupportImpl::injectIDBKeyIntoSerializedValue( const WebKit::WebIDBKey& key, const WebKit::WebSerializedScriptValue& value, const WebKit::WebString& keyPath) { diff --git a/content/ppapi_plugin/ppapi_webkitclient_impl.h b/content/ppapi_plugin/ppapi_webkitplatformsupport_impl.h index d2d8c17..00d6735 100644 --- a/content/ppapi_plugin/ppapi_webkitclient_impl.h +++ b/content/ppapi_plugin/ppapi_webkitplatformsupport_impl.h @@ -2,20 +2,21 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CONTENT_PPAPI_PLUGIN_PPAPI_WEBKITCLIENT_IMPL_H_ -#define CONTENT_PPAPI_PLUGIN_PPAPI_WEBKITCLIENT_IMPL_H_ +#ifndef CONTENT_PPAPI_PLUGIN_PPAPI_WEBKITPLATFORMSUPPORT_IMPL_H_ +#define CONTENT_PPAPI_PLUGIN_PPAPI_WEBKITPLATFORMSUPPORT_IMPL_H_ #pragma once #include "base/basictypes.h" #include "base/memory/scoped_ptr.h" -#include "webkit/glue/webkitclient_impl.h" +#include "webkit/glue/webkitplatformsupport_impl.h" -class PpapiWebKitClientImpl : public webkit_glue::WebKitClientImpl { +class PpapiWebKitPlatformSupportImpl : + public webkit_glue::WebKitPlatformSupportImpl { public: - PpapiWebKitClientImpl(); - virtual ~PpapiWebKitClientImpl(); + PpapiWebKitPlatformSupportImpl(); + virtual ~PpapiWebKitPlatformSupportImpl(); - // WebKitClient methods: + // WebKitPlatformSupport methods: virtual WebKit::WebClipboard* clipboard(); virtual WebKit::WebMimeRegistry* mimeRegistry(); virtual WebKit::WebFileUtilities* fileUtilities(); @@ -60,7 +61,7 @@ class PpapiWebKitClientImpl : public webkit_glue::WebKitClientImpl { class SandboxSupport; scoped_ptr<SandboxSupport> sandbox_support_; - DISALLOW_COPY_AND_ASSIGN(PpapiWebKitClientImpl); + DISALLOW_COPY_AND_ASSIGN(PpapiWebKitPlatformSupportImpl); }; -#endif // CONTENT_PPAPI_PLUGIN_PPAPI_WEBKITCLIENT_IMPL_H_ +#endif // CONTENT_PPAPI_PLUGIN_PPAPI_WEBKITPLATFORMSUPPORT_IMPL_H_ diff --git a/content/renderer/content_renderer_client.h b/content/renderer/content_renderer_client.h index 33387e8..7c43e9b 100644 --- a/content/renderer/content_renderer_client.h +++ b/content/renderer/content_renderer_client.h @@ -102,7 +102,7 @@ class ContentRendererClient { int world_id, v8::Handle<v8::Context> context) = 0; - // See WebKit::WebKitClient. + // See WebKit::WebKitPlatformSupport. virtual unsigned long long VisitedLinkHash(const char* canonical_url, size_t length) = 0; virtual bool IsLinkVisited(unsigned long long link_hash) = 0; diff --git a/content/renderer/render_thread.cc b/content/renderer/render_thread.cc index bda81425..5dd064b 100644 --- a/content/renderer/render_thread.cc +++ b/content/renderer/render_thread.cc @@ -47,7 +47,7 @@ #include "content/renderer/render_view.h" #include "content/renderer/render_view_visitor.h" #include "content/renderer/renderer_webidbfactory_impl.h" -#include "content/renderer/renderer_webkitclient_impl.h" +#include "content/renderer/renderer_webkitplatformsupport_impl.h" #include "ipc/ipc_channel_handle.h" #include "ipc/ipc_platform_file.h" #include "net/base/net_errors.h" @@ -238,7 +238,7 @@ RenderThread::~RenderThread() { if (file_thread_.get()) file_thread_->Stop(); - if (webkit_client_.get()) + if (webkit_platform_support_.get()) WebKit::shutdown(); lazy_tls.Pointer()->Set(NULL); @@ -308,7 +308,7 @@ bool RenderThread::Send(IPC::Message* msg) { if (pumping_events) { if (suspend_webkit_shared_timer) - webkit_client_->SuspendSharedTimer(); + webkit_platform_support_->SuspendSharedTimer(); if (notify_webkit_of_modal_loop) WebView::willEnterModalLoop(); @@ -334,7 +334,7 @@ bool RenderThread::Send(IPC::Message* msg) { WebView::didExitModalLoop(); if (suspend_webkit_shared_timer) - webkit_client_->ResumeSharedTimer(); + webkit_platform_support_->ResumeSharedTimer(); } return rv; @@ -415,15 +415,15 @@ void RenderThread::OnDOMStorageEvent( } void RenderThread::EnsureWebKitInitialized() { - if (webkit_client_.get()) + if (webkit_platform_support_.get()) return; v8::V8::SetCounterFunction(base::StatsTable::FindLocation); v8::V8::SetCreateHistogramFunction(CreateHistogram); v8::V8::SetAddHistogramSampleFunction(AddHistogramSample); - webkit_client_.reset(new RendererWebKitClientImpl); - WebKit::initialize(webkit_client_.get()); + webkit_platform_support_.reset(new RendererWebKitPlatformSupportImpl); + WebKit::initialize(webkit_platform_support_.get()); WebScriptController::enableV8SingleThreadMode(); diff --git a/content/renderer/render_thread.h b/content/renderer/render_thread.h index c0b8e4b..893e4ce 100644 --- a/content/renderer/render_thread.h +++ b/content/renderer/render_thread.h @@ -33,7 +33,7 @@ class RendererHistogram; class RendererHistogramSnapshots; class RenderProcessObserver; class RendererNetPredictor; -class RendererWebKitClientImpl; +class RendererWebKitPlatformSupportImpl; class SkBitmap; class VideoCaptureImplManager; class WebDatabaseObserverImpl; @@ -258,7 +258,7 @@ class RenderThread : public RenderThreadBase, scoped_ptr<ScopedRunnableMethodFactory<RenderThread> > task_factory_; scoped_ptr<AppCacheDispatcher> appcache_dispatcher_; scoped_ptr<IndexedDBDispatcher> indexed_db_dispatcher_; - scoped_ptr<RendererWebKitClientImpl> webkit_client_; + scoped_ptr<RendererWebKitPlatformSupportImpl> webkit_platform_support_; scoped_ptr<WebKit::WebStorageEventDispatcher> dom_storage_event_dispatcher_; // Used on the renderer and IPC threads. diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc index 761a993..d4ebc12 100644 --- a/content/renderer/render_widget.cc +++ b/content/renderer/render_widget.cc @@ -17,7 +17,7 @@ #include "content/common/view_messages.h" #include "content/renderer/render_process.h" #include "content/renderer/render_thread.h" -#include "content/renderer/renderer_webkitclient_impl.h" +#include "content/renderer/renderer_webkitplatformsupport_impl.h" #include "ipc/ipc_sync_message.h" #include "skia/ext/platform_canvas.h" #include "third_party/skia/include/core/SkShader.h" diff --git a/content/renderer/renderer_glue.cc b/content/renderer/renderer_glue.cc index 07b7646..93db367 100644 --- a/content/renderer/renderer_glue.cc +++ b/content/renderer/renderer_glue.cc @@ -26,7 +26,7 @@ #include "content/renderer/render_thread.h" #include "googleurl/src/url_util.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" -#include "third_party/WebKit/Source/WebKit/chromium/public/WebKitClient.h" +#include "third_party/WebKit/Source/WebKit/chromium/public/WebKitPlatformSupport.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" #include "third_party/skia/include/core/SkBitmap.h" #include "ui/base/clipboard/clipboard.h" diff --git a/content/renderer/renderer_webkitclient_impl.cc b/content/renderer/renderer_webkitplatformsupport_impl.cc index 162e2a21..8c56c00 100644 --- a/content/renderer/renderer_webkitclient_impl.cc +++ b/content/renderer/renderer_webkitplatformsupport_impl.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "content/renderer/renderer_webkitclient_impl.h" +#include "content/renderer/renderer_webkitplatformsupport_impl.h" #include "base/command_line.h" #include "base/file_path.h" @@ -76,7 +76,7 @@ using WebKit::WebFrame; using WebKit::WebIDBFactory; using WebKit::WebIDBKey; using WebKit::WebIDBKeyPath; -using WebKit::WebKitClient; +using WebKit::WebKitPlatformSupport; using WebKit::WebSerializedScriptValue; using WebKit::WebStorageArea; using WebKit::WebStorageEventDispatcher; @@ -87,7 +87,7 @@ using WebKit::WebVector; //------------------------------------------------------------------------------ -class RendererWebKitClientImpl::MimeRegistry +class RendererWebKitPlatformSupportImpl::MimeRegistry : public webkit_glue::SimpleWebMimeRegistryImpl { public: virtual WebKit::WebString mimeTypeForExtension(const WebKit::WebString&); @@ -96,7 +96,7 @@ class RendererWebKitClientImpl::MimeRegistry const WebKit::WebString&); }; -class RendererWebKitClientImpl::FileUtilities +class RendererWebKitPlatformSupportImpl::FileUtilities : public webkit_glue::WebFileUtilitiesImpl { public: virtual void revealFolderInOS(const WebKit::WebString& path); @@ -107,7 +107,7 @@ class RendererWebKitClientImpl::FileUtilities int mode); }; -class RendererWebKitClientImpl::SandboxSupport +class RendererWebKitPlatformSupportImpl::SandboxSupport : public WebKit::WebSandboxSupport { public: virtual ~SandboxSupport() {} @@ -137,28 +137,29 @@ class RendererWebKitClientImpl::SandboxSupport //------------------------------------------------------------------------------ -RendererWebKitClientImpl::RendererWebKitClientImpl() +RendererWebKitPlatformSupportImpl::RendererWebKitPlatformSupportImpl() : clipboard_(new webkit_glue::WebClipboardImpl), - mime_registry_(new RendererWebKitClientImpl::MimeRegistry), - sandbox_support_(new RendererWebKitClientImpl::SandboxSupport), + mime_registry_(new RendererWebKitPlatformSupportImpl::MimeRegistry), + sandbox_support_(new RendererWebKitPlatformSupportImpl::SandboxSupport), sudden_termination_disables_(0), shared_worker_repository_(new WebSharedWorkerRepositoryImpl) { } -RendererWebKitClientImpl::~RendererWebKitClientImpl() { +RendererWebKitPlatformSupportImpl::~RendererWebKitPlatformSupportImpl() { } //------------------------------------------------------------------------------ -WebKit::WebClipboard* RendererWebKitClientImpl::clipboard() { +WebKit::WebClipboard* RendererWebKitPlatformSupportImpl::clipboard() { return clipboard_.get(); } -WebKit::WebMimeRegistry* RendererWebKitClientImpl::mimeRegistry() { +WebKit::WebMimeRegistry* RendererWebKitPlatformSupportImpl::mimeRegistry() { return mime_registry_.get(); } -WebKit::WebFileUtilities* RendererWebKitClientImpl::fileUtilities() { +WebKit::WebFileUtilities* +RendererWebKitPlatformSupportImpl::fileUtilities() { if (!file_utilities_.get()) { file_utilities_.reset(new FileUtilities); file_utilities_->set_sandbox_enabled(sandboxEnabled()); @@ -166,27 +167,27 @@ WebKit::WebFileUtilities* RendererWebKitClientImpl::fileUtilities() { return file_utilities_.get(); } -WebKit::WebSandboxSupport* RendererWebKitClientImpl::sandboxSupport() { +WebKit::WebSandboxSupport* RendererWebKitPlatformSupportImpl::sandboxSupport() { return sandbox_support_.get(); } -WebKit::WebCookieJar* RendererWebKitClientImpl::cookieJar() { +WebKit::WebCookieJar* RendererWebKitPlatformSupportImpl::cookieJar() { NOTREACHED() << "Use WebFrameClient::cookieJar() instead!"; return NULL; } -bool RendererWebKitClientImpl::sandboxEnabled() { - // As explained in WebKitClient.h, this function is used to decide whether to - // allow file system operations to come out of WebKit or not. Even if the - // sandbox is disabled, there's no reason why the code should act any - // differently...unless we're in single process mode. In which case, we have - // no other choice. WebKitClient.h discourages using this switch unless - // absolutely necessary, so hopefully we won't end up with too many code paths - // being different in single-process mode. +bool RendererWebKitPlatformSupportImpl::sandboxEnabled() { + // As explained in WebKitPlatformSupport.h, this function is used to decide + // whether to allow file system operations to come out of WebKit or not. + // Even if the sandbox is disabled, there's no reason why the code should + // act any differently...unless we're in single process mode. In which + // case, we have no other choice. WebKitPlatformSupport.h discourages using + // this switch unless absolutely necessary, so hopefully we won't end up + // with too many code paths being different in single-process mode. return !CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess); } -bool RendererWebKitClientImpl::SendSyncMessageFromAnyThread( +bool RendererWebKitPlatformSupportImpl::SendSyncMessageFromAnyThread( IPC::SyncMessage* msg) { RenderThread* render_thread = RenderThread::current(); if (render_thread) @@ -197,23 +198,25 @@ bool RendererWebKitClientImpl::SendSyncMessageFromAnyThread( return sync_msg_filter->Send(msg); } -unsigned long long RendererWebKitClientImpl::visitedLinkHash( +unsigned long long RendererWebKitPlatformSupportImpl::visitedLinkHash( const char* canonical_url, size_t length) { return content::GetContentClient()->renderer()->VisitedLinkHash( canonical_url, length); } -bool RendererWebKitClientImpl::isLinkVisited(unsigned long long link_hash) { +bool RendererWebKitPlatformSupportImpl::isLinkVisited( + unsigned long long link_hash) { return content::GetContentClient()->renderer()->IsLinkVisited(link_hash); } WebKit::WebMessagePortChannel* -RendererWebKitClientImpl::createMessagePortChannel() { +RendererWebKitPlatformSupportImpl::createMessagePortChannel() { return new WebMessagePortChannelImpl(); } -void RendererWebKitClientImpl::prefetchHostName(const WebString& hostname) { +void RendererWebKitPlatformSupportImpl::prefetchHostName( + const WebString& hostname) { if (hostname.isEmpty()) return; @@ -223,7 +226,8 @@ void RendererWebKitClientImpl::prefetchHostName(const WebString& hostname) { hostname_utf8.data(), hostname_utf8.length()); } -bool RendererWebKitClientImpl::CheckPreparsedJsCachingEnabled() const { +bool +RendererWebKitPlatformSupportImpl::CheckPreparsedJsCachingEnabled() const { static bool checked = false; static bool result = false; if (!checked) { @@ -234,7 +238,7 @@ bool RendererWebKitClientImpl::CheckPreparsedJsCachingEnabled() const { return result; } -void RendererWebKitClientImpl::cacheMetadata( +void RendererWebKitPlatformSupportImpl::cacheMetadata( const WebKit::WebURL& url, double response_time, const char* data, @@ -250,12 +254,12 @@ void RendererWebKitClientImpl::cacheMetadata( url, response_time, copy)); } -WebString RendererWebKitClientImpl::defaultLocale() { +WebString RendererWebKitPlatformSupportImpl::defaultLocale() { // TODO(darin): Eliminate this webkit_glue call. return ASCIIToUTF16(webkit_glue::GetWebKitLocale()); } -void RendererWebKitClientImpl::suddenTerminationChanged(bool enabled) { +void RendererWebKitPlatformSupportImpl::suddenTerminationChanged(bool enabled) { if (enabled) { // We should not get more enables than disables, but we want it to be a // non-fatal error if it does happen. @@ -275,14 +279,15 @@ void RendererWebKitClientImpl::suddenTerminationChanged(bool enabled) { thread->Send(new ViewHostMsg_SuddenTerminationChanged(enabled)); } -WebStorageNamespace* RendererWebKitClientImpl::createLocalStorageNamespace( +WebStorageNamespace* +RendererWebKitPlatformSupportImpl::createLocalStorageNamespace( const WebString& path, unsigned quota) { if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess)) return WebStorageNamespace::createLocalStorageNamespace(path, quota); return new RendererWebStorageNamespaceImpl(DOM_STORAGE_LOCAL); } -void RendererWebKitClientImpl::dispatchStorageEvent( +void RendererWebKitPlatformSupportImpl::dispatchStorageEvent( const WebString& key, const WebString& old_value, const WebString& new_value, const WebString& origin, const WebKit::WebURL& url, bool is_local_storage) { @@ -296,7 +301,7 @@ void RendererWebKitClientImpl::dispatchStorageEvent( //------------------------------------------------------------------------------ -WebIDBFactory* RendererWebKitClientImpl::idbFactory() { +WebIDBFactory* RendererWebKitPlatformSupportImpl::idbFactory() { if (!web_idb_factory_.get()) { if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess)) web_idb_factory_.reset(WebIDBFactory::create()); @@ -306,7 +311,7 @@ WebIDBFactory* RendererWebKitClientImpl::idbFactory() { return web_idb_factory_.get(); } -void RendererWebKitClientImpl::createIDBKeysFromSerializedValuesAndKeyPath( +void RendererWebKitPlatformSupportImpl::createIDBKeysFromSerializedValuesAndKeyPath( const WebVector<WebSerializedScriptValue>& values, const WebString& keyPath, WebVector<WebIDBKey>& keys_out) { @@ -320,7 +325,8 @@ void RendererWebKitClientImpl::createIDBKeysFromSerializedValuesAndKeyPath( } WebSerializedScriptValue -RendererWebKitClientImpl::injectIDBKeyIntoSerializedValue(const WebIDBKey& key, +RendererWebKitPlatformSupportImpl::injectIDBKeyIntoSerializedValue( + const WebIDBKey& key, const WebSerializedScriptValue& value, const WebString& keyPath) { DCHECK(CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess)); @@ -330,7 +336,7 @@ RendererWebKitClientImpl::injectIDBKeyIntoSerializedValue(const WebIDBKey& key, //------------------------------------------------------------------------------ -WebFileSystem* RendererWebKitClientImpl::fileSystem() { +WebFileSystem* RendererWebKitPlatformSupportImpl::fileSystem() { if (!web_file_system_.get()) web_file_system_.reset(new WebFileSystemImpl()); return web_file_system_.get(); @@ -338,7 +344,8 @@ WebFileSystem* RendererWebKitClientImpl::fileSystem() { //------------------------------------------------------------------------------ -WebString RendererWebKitClientImpl::MimeRegistry::mimeTypeForExtension( +WebString +RendererWebKitPlatformSupportImpl::MimeRegistry::mimeTypeForExtension( const WebString& file_extension) { if (IsPluginProcess()) return SimpleWebMimeRegistryImpl::mimeTypeForExtension(file_extension); @@ -353,7 +360,7 @@ WebString RendererWebKitClientImpl::MimeRegistry::mimeTypeForExtension( } -WebString RendererWebKitClientImpl::MimeRegistry::mimeTypeFromFile( +WebString RendererWebKitPlatformSupportImpl::MimeRegistry::mimeTypeFromFile( const WebString& file_path) { if (IsPluginProcess()) return SimpleWebMimeRegistryImpl::mimeTypeFromFile(file_path); @@ -368,7 +375,8 @@ WebString RendererWebKitClientImpl::MimeRegistry::mimeTypeFromFile( } -WebString RendererWebKitClientImpl::MimeRegistry::preferredExtensionForMIMEType( +WebString +RendererWebKitPlatformSupportImpl::MimeRegistry::preferredExtensionForMIMEType( const WebString& mime_type) { if (IsPluginProcess()) return SimpleWebMimeRegistryImpl::preferredExtensionForMIMEType(mime_type); @@ -384,8 +392,8 @@ WebString RendererWebKitClientImpl::MimeRegistry::preferredExtensionForMIMEType( //------------------------------------------------------------------------------ -bool RendererWebKitClientImpl::FileUtilities::getFileSize(const WebString& path, - long long& result) { +bool RendererWebKitPlatformSupportImpl::FileUtilities::getFileSize( + const WebString& path, long long& result) { if (SendSyncMessageFromAnyThread(new FileUtilitiesMsg_GetFileSize( webkit_glue::WebStringToFilePath(path), reinterpret_cast<int64*>(&result)))) { @@ -396,14 +404,14 @@ bool RendererWebKitClientImpl::FileUtilities::getFileSize(const WebString& path, return false; } -void RendererWebKitClientImpl::FileUtilities::revealFolderInOS( +void RendererWebKitPlatformSupportImpl::FileUtilities::revealFolderInOS( const WebString& path) { FilePath file_path(webkit_glue::WebStringToFilePath(path)); file_util::AbsolutePath(&file_path); RenderThread::current()->Send(new ViewHostMsg_RevealFolderInOS(file_path)); } -bool RendererWebKitClientImpl::FileUtilities::getFileModificationTime( +bool RendererWebKitPlatformSupportImpl::FileUtilities::getFileModificationTime( const WebString& path, double& result) { base::Time time; @@ -417,7 +425,7 @@ bool RendererWebKitClientImpl::FileUtilities::getFileModificationTime( return false; } -base::PlatformFile RendererWebKitClientImpl::FileUtilities::openFile( +base::PlatformFile RendererWebKitPlatformSupportImpl::FileUtilities::openFile( const WebString& path, int mode) { IPC::PlatformFileForTransit handle = IPC::InvalidPlatformFileForTransit(); @@ -430,7 +438,8 @@ base::PlatformFile RendererWebKitClientImpl::FileUtilities::openFile( #if defined(OS_WIN) -bool RendererWebKitClientImpl::SandboxSupport::ensureFontLoaded(HFONT font) { +bool RendererWebKitPlatformSupportImpl::SandboxSupport::ensureFontLoaded( + HFONT font) { LOGFONT logfont; GetObject(font, sizeof(LOGFONT), &logfont); return RenderThread::current()->Send(new ViewHostMsg_PreCacheFont(logfont)); @@ -438,7 +447,7 @@ bool RendererWebKitClientImpl::SandboxSupport::ensureFontLoaded(HFONT font) { #elif defined(OS_MACOSX) -bool RendererWebKitClientImpl::SandboxSupport::loadFont( +bool RendererWebKitPlatformSupportImpl::SandboxSupport::loadFont( NSFont* srcFont, ATSFontContainerRef* container, uint32* fontID) { DCHECK(srcFont); DCHECK(container); @@ -474,7 +483,8 @@ bool RendererWebKitClientImpl::SandboxSupport::loadFont( #elif defined(OS_POSIX) -WebString RendererWebKitClientImpl::SandboxSupport::getFontFamilyForCharacters( +WebString +RendererWebKitPlatformSupportImpl::SandboxSupport::getFontFamilyForCharacters( const WebKit::WebUChar* characters, size_t num_characters, const char* preferred_locale) { @@ -494,7 +504,8 @@ WebString RendererWebKitClientImpl::SandboxSupport::getFontFamilyForCharacters( return WebString::fromUTF8(family_name); } -void RendererWebKitClientImpl::SandboxSupport::getRenderStyleForStrike( +void +RendererWebKitPlatformSupportImpl::SandboxSupport::getRenderStyleForStrike( const char* family, int sizeAndStyle, WebKit::WebFontRenderStyle* out) { child_process_sandbox_support::getRenderStyleForStrike(family, sizeAndStyle, out); @@ -504,33 +515,34 @@ void RendererWebKitClientImpl::SandboxSupport::getRenderStyleForStrike( //------------------------------------------------------------------------------ -WebKitClient::FileHandle RendererWebKitClientImpl::databaseOpenFile( +WebKitPlatformSupport::FileHandle +RendererWebKitPlatformSupportImpl::databaseOpenFile( const WebString& vfs_file_name, int desired_flags) { return DatabaseUtil::DatabaseOpenFile(vfs_file_name, desired_flags); } -int RendererWebKitClientImpl::databaseDeleteFile( +int RendererWebKitPlatformSupportImpl::databaseDeleteFile( const WebString& vfs_file_name, bool sync_dir) { return DatabaseUtil::DatabaseDeleteFile(vfs_file_name, sync_dir); } -long RendererWebKitClientImpl::databaseGetFileAttributes( +long RendererWebKitPlatformSupportImpl::databaseGetFileAttributes( const WebString& vfs_file_name) { return DatabaseUtil::DatabaseGetFileAttributes(vfs_file_name); } -long long RendererWebKitClientImpl::databaseGetFileSize( +long long RendererWebKitPlatformSupportImpl::databaseGetFileSize( const WebString& vfs_file_name) { return DatabaseUtil::DatabaseGetFileSize(vfs_file_name); } -long long RendererWebKitClientImpl::databaseGetSpaceAvailableForOrigin( +long long RendererWebKitPlatformSupportImpl::databaseGetSpaceAvailableForOrigin( const WebString& origin_identifier) { return DatabaseUtil::DatabaseGetSpaceAvailable(origin_identifier); } WebKit::WebSharedWorkerRepository* -RendererWebKitClientImpl::sharedWorkerRepository() { +RendererWebKitPlatformSupportImpl::sharedWorkerRepository() { if (!CommandLine::ForCurrentProcess()->HasSwitch( switches::kDisableSharedWorkers)) { return shared_worker_repository_.get(); @@ -540,7 +552,7 @@ RendererWebKitClientImpl::sharedWorkerRepository() { } WebKit::WebGraphicsContext3D* -RendererWebKitClientImpl::createGraphicsContext3D() { +RendererWebKitPlatformSupportImpl::createGraphicsContext3D() { // The WebGraphicsContext3DInProcessImpl code path is used for // layout tests (though not through this code) as well as for // debugging and bringing up new ports. @@ -555,12 +567,12 @@ RendererWebKitClientImpl::createGraphicsContext3D() { } } -double RendererWebKitClientImpl::audioHardwareSampleRate() { +double RendererWebKitPlatformSupportImpl::audioHardwareSampleRate() { return AudioDevice::GetAudioHardwareSampleRate(); } WebAudioDevice* -RendererWebKitClientImpl::createAudioDevice( +RendererWebKitPlatformSupportImpl::createAudioDevice( size_t buffer_size, unsigned channels, double sample_rate, @@ -573,7 +585,8 @@ RendererWebKitClientImpl::createAudioDevice( //------------------------------------------------------------------------------ -WebKit::WebString RendererWebKitClientImpl::signedPublicKeyAndChallengeString( +WebKit::WebString +RendererWebKitPlatformSupportImpl::signedPublicKeyAndChallengeString( unsigned key_size_index, const WebKit::WebString& challenge, const WebKit::WebURL& url) { @@ -588,7 +601,7 @@ WebKit::WebString RendererWebKitClientImpl::signedPublicKeyAndChallengeString( //------------------------------------------------------------------------------ -WebBlobRegistry* RendererWebKitClientImpl::blobRegistry() { +WebBlobRegistry* RendererWebKitPlatformSupportImpl::blobRegistry() { // RenderThread::current can be NULL when running some tests. if (!blob_registry_.get() && RenderThread::current()) blob_registry_.reset(new WebBlobRegistryImpl(RenderThread::current())); diff --git a/content/renderer/renderer_webkitclient_impl.h b/content/renderer/renderer_webkitplatformsupport_impl.h index 9b61bc4..5b819e6 100644 --- a/content/renderer/renderer_webkitclient_impl.h +++ b/content/renderer/renderer_webkitplatformsupport_impl.h @@ -2,13 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CONTENT_RENDERER_RENDERER_WEBKITCLIENT_IMPL_H_ -#define CONTENT_RENDERER_RENDERER_WEBKITCLIENT_IMPL_H_ +#ifndef CONTENT_RENDERER_RENDERER_WEBKITPLATFORMSUPPORT_IMPL_H_ +#define CONTENT_RENDERER_RENDERER_WEBKITPLATFORMSUPPORT_IMPL_H_ #pragma once #include "base/memory/scoped_ptr.h" #include "base/platform_file.h" -#include "webkit/glue/webkitclient_impl.h" +#include "webkit/glue/webkitplatformsupport_impl.h" class WebSharedWorkerRepositoryImpl; class WebFileSystemImpl; @@ -21,12 +21,13 @@ namespace webkit_glue { class WebClipboardImpl; } -class RendererWebKitClientImpl : public webkit_glue::WebKitClientImpl { +class RendererWebKitPlatformSupportImpl : + public webkit_glue::WebKitPlatformSupportImpl { public: - RendererWebKitClientImpl(); - virtual ~RendererWebKitClientImpl(); + RendererWebKitPlatformSupportImpl(); + virtual ~RendererWebKitPlatformSupportImpl(); - // WebKitClient methods: + // WebKitPlatformSupport methods: virtual WebKit::WebClipboard* clipboard(); virtual WebKit::WebMimeRegistry* mimeRegistry(); virtual WebKit::WebFileUtilities* fileUtilities(); @@ -49,7 +50,7 @@ class RendererWebKitClientImpl : public webkit_glue::WebKitClientImpl { const WebKit::WebString& new_value, const WebKit::WebString& origin, const WebKit::WebURL& url, bool is_local_storage); - virtual WebKit::WebKitClient::FileHandle databaseOpenFile( + virtual WebKit::WebKitPlatformSupport::FileHandle databaseOpenFile( const WebKit::WebString& vfs_file_name, int desired_flags); virtual int databaseDeleteFile(const WebKit::WebString& vfs_file_name, bool sync_dir); @@ -117,4 +118,4 @@ class RendererWebKitClientImpl : public webkit_glue::WebKitClientImpl { scoped_ptr<WebKit::WebBlobRegistry> blob_registry_; }; -#endif // CONTENT_RENDERER_RENDERER_WEBKITCLIENT_IMPL_H_ +#endif // CONTENT_RENDERER_RENDERER_WEBKITPLATFORMSUPPORT_IMPL_H_ diff --git a/content/utility/utility_thread.cc b/content/utility/utility_thread.cc index 10d49cf..ac6c312 100644 --- a/content/utility/utility_thread.cc +++ b/content/utility/utility_thread.cc @@ -14,7 +14,7 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebSerializedScriptValue.h" #include "webkit/glue/idb_bindings.h" -#include "webkit/glue/webkitclient_impl.h" +#include "webkit/glue/webkitplatformsupport_impl.h" namespace { @@ -30,8 +30,8 @@ void ConvertVector(const SRC& src, DEST* dest) { UtilityThread::UtilityThread() : batch_mode_(false) { ChildProcess::current()->AddRefProcess(); - webkit_client_.reset(new webkit_glue::WebKitClientImpl); - WebKit::initialize(webkit_client_.get()); + webkit_platform_support_.reset(new webkit_glue::WebKitPlatformSupportImpl); + WebKit::initialize(webkit_platform_support_.get()); content::GetContentClient()->utility()->UtilityThreadStarted(); } diff --git a/content/utility/utility_thread.h b/content/utility/utility_thread.h index a6c0694..18605d8 100644 --- a/content/utility/utility_thread.h +++ b/content/utility/utility_thread.h @@ -18,7 +18,7 @@ class IndexedDBKey; class SerializedScriptValue; namespace webkit_glue { -class WebKitClientImpl; +class WebKitPlatformSupportImpl; } // This class represents the background thread where the utility task runs. @@ -53,7 +53,7 @@ class UtilityThread : public ChildThread { // True when we're running in batch mode. bool batch_mode_; - scoped_ptr<webkit_glue::WebKitClientImpl> webkit_client_; + scoped_ptr<webkit_glue::WebKitPlatformSupportImpl> webkit_platform_support_; DISALLOW_COPY_AND_ASSIGN(UtilityThread); }; diff --git a/content/worker/worker_thread.cc b/content/worker/worker_thread.cc index 03f11d3..1560e5b 100644 --- a/content/worker/worker_thread.cc +++ b/content/worker/worker_thread.cc @@ -14,7 +14,7 @@ #include "content/common/worker_messages.h" #include "content/worker/webworker_stub.h" #include "content/worker/websharedworker_stub.h" -#include "content/worker/worker_webkitclient_impl.h" +#include "content/worker/worker_webkitplatformsupport_impl.h" #include "ipc/ipc_sync_channel.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebBlobRegistry.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebDatabase.h" @@ -30,8 +30,8 @@ static base::LazyInstance<base::ThreadLocalPointer<WorkerThread> > lazy_tls( WorkerThread::WorkerThread() { lazy_tls.Pointer()->Set(this); - webkit_client_.reset(new WorkerWebKitClientImpl); - WebKit::initialize(webkit_client_.get()); + webkit_platform_support_.reset(new WorkerWebKitPlatformSupportImpl); + WebKit::initialize(webkit_platform_support_.get()); appcache_dispatcher_.reset(new AppCacheDispatcher(this)); diff --git a/content/worker/worker_thread.h b/content/worker/worker_thread.h index 4e0e487..b5d5b33 100644 --- a/content/worker/worker_thread.h +++ b/content/worker/worker_thread.h @@ -15,7 +15,7 @@ class AppCacheDispatcher; class DBMessageFilter; class WebDatabaseObserverImpl; class WebWorkerStubBase; -class WorkerWebKitClientImpl; +class WorkerWebKitPlatformSupportImpl; struct WorkerProcessMsg_CreateWorker_Params; class WorkerThread : public ChildThread { @@ -40,7 +40,7 @@ class WorkerThread : public ChildThread { void OnCreateWorker(const WorkerProcessMsg_CreateWorker_Params& params); - scoped_ptr<WorkerWebKitClientImpl> webkit_client_; + scoped_ptr<WorkerWebKitPlatformSupportImpl> webkit_platform_support_; scoped_ptr<AppCacheDispatcher> appcache_dispatcher_; scoped_ptr<WebDatabaseObserverImpl> web_database_observer_impl_; scoped_refptr<DBMessageFilter> db_message_filter_; diff --git a/content/worker/worker_webkitclient_impl.cc b/content/worker/worker_webkitplatformsupport_impl.cc index d4866d1..24ded4f 100644 --- a/content/worker/worker_webkitclient_impl.cc +++ b/content/worker/worker_webkitplatformsupport_impl.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "content/worker/worker_webkitclient_impl.h" +#include "content/worker/worker_webkitplatformsupport_impl.h" #include "base/logging.h" #include "base/utf_string_conversions.h" @@ -25,7 +25,7 @@ using WebKit::WebBlobRegistry; using WebKit::WebClipboard; using WebKit::WebFileSystem; using WebKit::WebFileUtilities; -using WebKit::WebKitClient; +using WebKit::WebKitPlatformSupport; using WebKit::WebMessagePortChannel; using WebKit::WebMimeRegistry; using WebKit::WebSandboxSupport; @@ -35,8 +35,8 @@ using WebKit::WebString; using WebKit::WebURL; // TODO(kinuko): Probably this could be consolidated into -// RendererWebKitClientImpl::FileUtilities. -class WorkerWebKitClientImpl::FileUtilities +// RendererWebKitPlatformSupportImpl::FileUtilities. +class WorkerWebKitPlatformSupportImpl::FileUtilities : public webkit_glue::WebFileUtilitiesImpl { public: virtual bool getFileSize(const WebKit::WebString& path, long long& result); @@ -54,8 +54,8 @@ static bool SendSyncMessageFromAnyThread(IPC::SyncMessage* msg) { return sync_msg_filter->Send(msg); } -bool WorkerWebKitClientImpl::FileUtilities::getFileSize(const WebString& path, - long long& result) { +bool WorkerWebKitPlatformSupportImpl::FileUtilities::getFileSize( + const WebString& path, long long& result) { if (SendSyncMessageFromAnyThread(new FileUtilitiesMsg_GetFileSize( webkit_glue::WebStringToFilePath(path), reinterpret_cast<int64*>(&result)))) { @@ -66,7 +66,7 @@ bool WorkerWebKitClientImpl::FileUtilities::getFileSize(const WebString& path, return false; } -bool WorkerWebKitClientImpl::FileUtilities::getFileModificationTime( +bool WorkerWebKitPlatformSupportImpl::FileUtilities::getFileModificationTime( const WebString& path, double& result) { base::Time time; @@ -82,28 +82,28 @@ bool WorkerWebKitClientImpl::FileUtilities::getFileModificationTime( //------------------------------------------------------------------------------ -WorkerWebKitClientImpl::WorkerWebKitClientImpl() { +WorkerWebKitPlatformSupportImpl::WorkerWebKitPlatformSupportImpl() { } -WorkerWebKitClientImpl::~WorkerWebKitClientImpl() { +WorkerWebKitPlatformSupportImpl::~WorkerWebKitPlatformSupportImpl() { } -WebClipboard* WorkerWebKitClientImpl::clipboard() { +WebClipboard* WorkerWebKitPlatformSupportImpl::clipboard() { NOTREACHED(); return NULL; } -WebMimeRegistry* WorkerWebKitClientImpl::mimeRegistry() { +WebMimeRegistry* WorkerWebKitPlatformSupportImpl::mimeRegistry() { return this; } -WebFileSystem* WorkerWebKitClientImpl::fileSystem() { +WebFileSystem* WorkerWebKitPlatformSupportImpl::fileSystem() { if (!web_file_system_.get()) web_file_system_.reset(new WebFileSystemImpl()); return web_file_system_.get(); } -WebFileUtilities* WorkerWebKitClientImpl::fileUtilities() { +WebFileUtilities* WorkerWebKitPlatformSupportImpl::fileUtilities() { if (!file_utilities_.get()) { file_utilities_.reset(new FileUtilities); file_utilities_->set_sandbox_enabled(sandboxEnabled()); @@ -111,127 +111,137 @@ WebFileUtilities* WorkerWebKitClientImpl::fileUtilities() { return file_utilities_.get(); } -WebSandboxSupport* WorkerWebKitClientImpl::sandboxSupport() { +WebSandboxSupport* WorkerWebKitPlatformSupportImpl::sandboxSupport() { NOTREACHED(); return NULL; } -bool WorkerWebKitClientImpl::sandboxEnabled() { +bool WorkerWebKitPlatformSupportImpl::sandboxEnabled() { // Always return true because WebKit should always act as though the Sandbox - // is enabled for workers. See the comment in WebKitClient for more info. + // is enabled for workers. See the comment in WebKitPlatformSupport for + // more info. return true; } -unsigned long long WorkerWebKitClientImpl::visitedLinkHash( +unsigned long long WorkerWebKitPlatformSupportImpl::visitedLinkHash( const char* canonical_url, size_t length) { NOTREACHED(); return 0; } -bool WorkerWebKitClientImpl::isLinkVisited(unsigned long long link_hash) { +bool WorkerWebKitPlatformSupportImpl::isLinkVisited( + unsigned long long link_hash) { NOTREACHED(); return false; } WebMessagePortChannel* -WorkerWebKitClientImpl::createMessagePortChannel() { +WorkerWebKitPlatformSupportImpl::createMessagePortChannel() { return new WebMessagePortChannelImpl(); } -void WorkerWebKitClientImpl::setCookies(const WebURL& url, - const WebURL& first_party_for_cookies, - const WebString& value) { +void WorkerWebKitPlatformSupportImpl::setCookies( + const WebURL& url, + const WebURL& first_party_for_cookies, + const WebString& value) { NOTREACHED(); } -WebString WorkerWebKitClientImpl::cookies( +WebString WorkerWebKitPlatformSupportImpl::cookies( const WebURL& url, const WebURL& first_party_for_cookies) { // WebSocketHandshake may access cookies in worker process. return WebString(); } -void WorkerWebKitClientImpl::prefetchHostName(const WebString&) { +void WorkerWebKitPlatformSupportImpl::prefetchHostName(const WebString&) { NOTREACHED(); } -WebString WorkerWebKitClientImpl::defaultLocale() { +WebString WorkerWebKitPlatformSupportImpl::defaultLocale() { NOTREACHED(); return WebString(); } -WebStorageNamespace* WorkerWebKitClientImpl::createLocalStorageNamespace( +WebStorageNamespace* +WorkerWebKitPlatformSupportImpl::createLocalStorageNamespace( const WebString& path, unsigned quota) { NOTREACHED(); return 0; } -void WorkerWebKitClientImpl::dispatchStorageEvent( +void WorkerWebKitPlatformSupportImpl::dispatchStorageEvent( const WebString& key, const WebString& old_value, const WebString& new_value, const WebString& origin, const WebKit::WebURL& url, bool is_local_storage) { NOTREACHED(); } -WebSharedWorkerRepository* WorkerWebKitClientImpl::sharedWorkerRepository() { +WebSharedWorkerRepository* +WorkerWebKitPlatformSupportImpl::sharedWorkerRepository() { return 0; } -WebKitClient::FileHandle WorkerWebKitClientImpl::databaseOpenFile( +WebKitPlatformSupport::FileHandle +WorkerWebKitPlatformSupportImpl::databaseOpenFile( const WebString& vfs_file_name, int desired_flags) { return DatabaseUtil::DatabaseOpenFile(vfs_file_name, desired_flags); } -int WorkerWebKitClientImpl::databaseDeleteFile( +int WorkerWebKitPlatformSupportImpl::databaseDeleteFile( const WebString& vfs_file_name, bool sync_dir) { return DatabaseUtil::DatabaseDeleteFile(vfs_file_name, sync_dir); } -long WorkerWebKitClientImpl::databaseGetFileAttributes( +long WorkerWebKitPlatformSupportImpl::databaseGetFileAttributes( const WebString& vfs_file_name) { return DatabaseUtil::DatabaseGetFileAttributes(vfs_file_name); } -long long WorkerWebKitClientImpl::databaseGetFileSize( +long long WorkerWebKitPlatformSupportImpl::databaseGetFileSize( const WebString& vfs_file_name) { return DatabaseUtil::DatabaseGetFileSize(vfs_file_name); } -long long WorkerWebKitClientImpl::databaseGetSpaceAvailableForOrigin( +long long WorkerWebKitPlatformSupportImpl::databaseGetSpaceAvailableForOrigin( const WebString& origin_identifier) { return DatabaseUtil::DatabaseGetSpaceAvailable(origin_identifier); } -WebMimeRegistry::SupportsType WorkerWebKitClientImpl::supportsMIMEType( +WebMimeRegistry::SupportsType +WorkerWebKitPlatformSupportImpl::supportsMIMEType( const WebString&) { return WebMimeRegistry::IsSupported; } -WebMimeRegistry::SupportsType WorkerWebKitClientImpl::supportsImageMIMEType( +WebMimeRegistry::SupportsType +WorkerWebKitPlatformSupportImpl::supportsImageMIMEType( const WebString&) { NOTREACHED(); return WebMimeRegistry::IsSupported; } WebMimeRegistry::SupportsType -WorkerWebKitClientImpl::supportsJavaScriptMIMEType(const WebString&) { +WorkerWebKitPlatformSupportImpl::supportsJavaScriptMIMEType(const WebString&) { NOTREACHED(); return WebMimeRegistry::IsSupported; } -WebMimeRegistry::SupportsType WorkerWebKitClientImpl::supportsMediaMIMEType( +WebMimeRegistry::SupportsType +WorkerWebKitPlatformSupportImpl::supportsMediaMIMEType( const WebString&, const WebString&) { NOTREACHED(); return WebMimeRegistry::IsSupported; } -WebMimeRegistry::SupportsType WorkerWebKitClientImpl::supportsNonImageMIMEType( +WebMimeRegistry::SupportsType +WorkerWebKitPlatformSupportImpl::supportsNonImageMIMEType( const WebString&) { NOTREACHED(); return WebMimeRegistry::IsSupported; } -WebString WorkerWebKitClientImpl::mimeTypeForExtension( +WebString WorkerWebKitPlatformSupportImpl::mimeTypeForExtension( const WebString& file_extension) { std::string mime_type; SendSyncMessageFromAnyThread(new MimeRegistryMsg_GetMimeTypeFromExtension( @@ -239,7 +249,7 @@ WebString WorkerWebKitClientImpl::mimeTypeForExtension( return ASCIIToUTF16(mime_type); } -WebString WorkerWebKitClientImpl::wellKnownMimeTypeForExtension( +WebString WorkerWebKitPlatformSupportImpl::wellKnownMimeTypeForExtension( const WebString& file_extension) { std::string mime_type; net::GetWellKnownMimeTypeFromExtension( @@ -247,7 +257,7 @@ WebString WorkerWebKitClientImpl::wellKnownMimeTypeForExtension( return ASCIIToUTF16(mime_type); } -WebString WorkerWebKitClientImpl::mimeTypeFromFile( +WebString WorkerWebKitPlatformSupportImpl::mimeTypeFromFile( const WebString& file_path) { std::string mime_type; SendSyncMessageFromAnyThread(new MimeRegistryMsg_GetMimeTypeFromFile( @@ -256,7 +266,7 @@ WebString WorkerWebKitClientImpl::mimeTypeFromFile( return ASCIIToUTF16(mime_type); } -WebString WorkerWebKitClientImpl::preferredExtensionForMIMEType( +WebString WorkerWebKitPlatformSupportImpl::preferredExtensionForMIMEType( const WebString& mime_type) { FilePath::StringType file_extension; SendSyncMessageFromAnyThread( @@ -265,7 +275,7 @@ WebString WorkerWebKitClientImpl::preferredExtensionForMIMEType( return webkit_glue::FilePathStringToWebString(file_extension); } -WebBlobRegistry* WorkerWebKitClientImpl::blobRegistry() { +WebBlobRegistry* WorkerWebKitPlatformSupportImpl::blobRegistry() { if (!blob_registry_.get()) blob_registry_.reset(new WebBlobRegistryImpl(WorkerThread::current())); return blob_registry_.get(); diff --git a/content/worker/worker_webkitclient_impl.h b/content/worker/worker_webkitplatformsupport_impl.h index 98df47a..e0ae7f9 100644 --- a/content/worker/worker_webkitclient_impl.h +++ b/content/worker/worker_webkitplatformsupport_impl.h @@ -2,13 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CONTENT_WORKER_WORKER_WEBKITCLIENT_IMPL_H_ -#define CONTENT_WORKER_WORKER_WEBKITCLIENT_IMPL_H_ +#ifndef CONTENT_WORKER_WORKER_WEBKITPLATFORMSUPPORT_IMPL_H_ +#define CONTENT_WORKER_WORKER_WEBKITPLATFORMSUPPORT_IMPL_H_ #pragma once #include "base/memory/scoped_ptr.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebMimeRegistry.h" -#include "webkit/glue/webkitclient_impl.h" +#include "webkit/glue/webkitplatformsupport_impl.h" class WebFileSystemImpl; @@ -16,13 +16,14 @@ namespace WebKit { class WebFileUtilities; } -class WorkerWebKitClientImpl : public webkit_glue::WebKitClientImpl, - public WebKit::WebMimeRegistry { +class WorkerWebKitPlatformSupportImpl : + public webkit_glue::WebKitPlatformSupportImpl, + public WebKit::WebMimeRegistry { public: - WorkerWebKitClientImpl(); - virtual ~WorkerWebKitClientImpl(); + WorkerWebKitPlatformSupportImpl(); + virtual ~WorkerWebKitPlatformSupportImpl(); - // WebKitClient methods: + // WebKitPlatformSupport methods: virtual WebKit::WebClipboard* clipboard(); virtual WebKit::WebMimeRegistry* mimeRegistry(); virtual WebKit::WebFileSystem* fileSystem(); @@ -49,7 +50,7 @@ class WorkerWebKitClientImpl : public webkit_glue::WebKitClientImpl, const WebKit::WebURL& url, bool is_local_storage); virtual WebKit::WebSharedWorkerRepository* sharedWorkerRepository(); - virtual WebKit::WebKitClient::FileHandle databaseOpenFile( + virtual WebKit::WebKitPlatformSupport::FileHandle databaseOpenFile( const WebKit::WebString& vfs_file_name, int desired_flags); virtual int databaseDeleteFile(const WebKit::WebString& vfs_file_name, bool sync_dir); @@ -90,4 +91,4 @@ class WorkerWebKitClientImpl : public webkit_glue::WebKitClientImpl, scoped_ptr<WebFileSystemImpl> web_file_system_; }; -#endif // CONTENT_WORKER_WORKER_WEBKITCLIENT_IMPL_H_ +#endif // CONTENT_WORKER_WORKER_WEBKITPLATFORMSUPPORT_IMPL_H_ diff --git a/webkit/glue/media/buffered_resource_loader.cc b/webkit/glue/media/buffered_resource_loader.cc index 7fbf181..8eaa5f8 100644 --- a/webkit/glue/media/buffered_resource_loader.cc +++ b/webkit/glue/media/buffered_resource_loader.cc @@ -11,7 +11,7 @@ #include "net/base/net_errors.h" #include "net/http/http_request_headers.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" -#include "third_party/WebKit/Source/WebKit/chromium/public/WebKitClient.h" +#include "third_party/WebKit/Source/WebKit/chromium/public/WebKitPlatformSupport.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLError.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLLoaderOptions.h" diff --git a/webkit/glue/media/simple_data_source.cc b/webkit/glue/media/simple_data_source.cc index 1c68363..9b051e5 100644 --- a/webkit/glue/media/simple_data_source.cc +++ b/webkit/glue/media/simple_data_source.cc @@ -13,7 +13,7 @@ #include "net/http/http_request_headers.h" #include "net/url_request/url_request_status.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" -#include "third_party/WebKit/Source/WebKit/chromium/public/WebKitClient.h" +#include "third_party/WebKit/Source/WebKit/chromium/public/WebKitPlatformSupport.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLLoaderOptions.h" #include "webkit/glue/media/web_data_source_factory.h" diff --git a/webkit/glue/resource_fetcher.cc b/webkit/glue/resource_fetcher.cc index 28885b4..a22af59 100644 --- a/webkit/glue/resource_fetcher.cc +++ b/webkit/glue/resource_fetcher.cc @@ -7,7 +7,7 @@ #include "base/logging.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" -#include "third_party/WebKit/Source/WebKit/chromium/public/WebKitClient.h" +#include "third_party/WebKit/Source/WebKit/chromium/public/WebKitPlatformSupport.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLError.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLLoader.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLRequest.h" @@ -52,7 +52,7 @@ void ResourceFetcher::Start(WebFrame* frame) { request.setTargetType(target_type_); frame->dispatchWillSendRequest(request); - loader_.reset(WebKit::webKitClient()->createURLLoader()); + loader_.reset(WebKit::webKitPlatformSupport()->createURLLoader()); loader_->loadAsynchronously(request, this); } diff --git a/webkit/glue/webkit_glue.gypi b/webkit/glue/webkit_glue.gypi index ce6000c..a74b081 100644 --- a/webkit/glue/webkit_glue.gypi +++ b/webkit/glue/webkit_glue.gypi @@ -401,8 +401,8 @@ 'webkit_constants.h', 'webkit_glue.cc', 'webkit_glue.h', - 'webkitclient_impl.cc', - 'webkitclient_impl.h', + 'webkitplatformsupport_impl.cc', + 'webkitplatformsupport_impl.h', 'webmediaplayer_impl.cc', 'webmediaplayer_impl.h', 'webmediaplayer_proxy.cc', diff --git a/webkit/glue/webkitclient_impl.cc b/webkit/glue/webkitplatformsupport_impl.cc index 792a700a..6405431 100644 --- a/webkit/glue/webkitclient_impl.cc +++ b/webkit/glue/webkitplatformsupport_impl.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/glue/webkitclient_impl.h" +#include "webkit/glue/webkitplatformsupport_impl.h" #if defined(OS_LINUX) #include <malloc.h> @@ -206,33 +206,33 @@ static int ToMessageID(WebLocalizedString::Name name) { return -1; } -WebKitClientImpl::WebKitClientImpl() +WebKitPlatformSupportImpl::WebKitPlatformSupportImpl() : main_loop_(MessageLoop::current()), shared_timer_func_(NULL), shared_timer_fire_time_(0.0), shared_timer_suspended_(0) { } -WebKitClientImpl::~WebKitClientImpl() { +WebKitPlatformSupportImpl::~WebKitPlatformSupportImpl() { } -WebThemeEngine* WebKitClientImpl::themeEngine() { +WebThemeEngine* WebKitPlatformSupportImpl::themeEngine() { return &theme_engine_; } -WebURLLoader* WebKitClientImpl::createURLLoader() { +WebURLLoader* WebKitPlatformSupportImpl::createURLLoader() { return new WebURLLoaderImpl(); } -WebSocketStreamHandle* WebKitClientImpl::createSocketStreamHandle() { +WebSocketStreamHandle* WebKitPlatformSupportImpl::createSocketStreamHandle() { return new WebSocketStreamHandleImpl(); } -WebString WebKitClientImpl::userAgent(const WebURL& url) { +WebString WebKitPlatformSupportImpl::userAgent(const WebURL& url) { return WebString::fromUTF8(webkit_glue::GetUserAgent(url)); } -void WebKitClientImpl::getPluginList(bool refresh, +void WebKitPlatformSupportImpl::getPluginList(bool refresh, WebPluginListBuilder* builder) { std::vector<webkit::WebPluginInfo> plugins; GetPlugins(refresh, &plugins); @@ -258,15 +258,15 @@ void WebKitClientImpl::getPluginList(bool refresh, } } -void WebKitClientImpl::decrementStatsCounter(const char* name) { +void WebKitPlatformSupportImpl::decrementStatsCounter(const char* name) { base::StatsCounter(name).Decrement(); } -void WebKitClientImpl::incrementStatsCounter(const char* name) { +void WebKitPlatformSupportImpl::incrementStatsCounter(const char* name) { base::StatsCounter(name).Increment(); } -void WebKitClientImpl::histogramCustomCounts( +void WebKitPlatformSupportImpl::histogramCustomCounts( const char* name, int sample, int min, int max, int bucket_count) { // Copied from histogram macro, but without the static variable caching // the histogram because name is dynamic. @@ -277,7 +277,7 @@ void WebKitClientImpl::histogramCustomCounts( counter->Add(sample); } -void WebKitClientImpl::histogramEnumeration( +void WebKitPlatformSupportImpl::histogramEnumeration( const char* name, int sample, int boundary_value) { // Copied from histogram macro, but without the static variable caching // the histogram because name is dynamic. @@ -288,13 +288,13 @@ void WebKitClientImpl::histogramEnumeration( counter->Add(sample); } -void WebKitClientImpl::traceEventBegin(const char* name, void* id, - const char* extra) { +void WebKitPlatformSupportImpl::traceEventBegin(const char* name, void* id, + const char* extra) { TRACE_EVENT_BEGIN_ETW(name, id, extra); } -void WebKitClientImpl::traceEventEnd(const char* name, void* id, - const char* extra) { +void WebKitPlatformSupportImpl::traceEventEnd(const char* name, void* id, + const char* extra) { TRACE_EVENT_END_ETW(name, id, extra); } @@ -419,7 +419,7 @@ const DataResource kDataResources[] = { } // namespace -WebData WebKitClientImpl::loadResource(const char* name) { +WebData WebKitPlatformSupportImpl::loadResource(const char* name) { // Some clients will call into this method with an empty |name| when they have // optional resources. For example, the PopupMenuChromium code can have icons // for some Autofill items but not for others. @@ -441,7 +441,7 @@ WebData WebKitClientImpl::loadResource(const char* name) { return WebData(); } -bool WebKitClientImpl::loadAudioResource( +bool WebKitPlatformSupportImpl::loadAudioResource( WebKit::WebAudioBus* destination_bus, const char* audio_file_data, size_t data_size, double sample_rate) { return DecodeAudioFileData(destination_bus, @@ -450,7 +450,7 @@ bool WebKitClientImpl::loadAudioResource( sample_rate); } -WebString WebKitClientImpl::queryLocalizedString( +WebString WebKitPlatformSupportImpl::queryLocalizedString( WebLocalizedString::Name name) { int message_id = ToMessageID(name); if (message_id < 0) @@ -458,12 +458,12 @@ WebString WebKitClientImpl::queryLocalizedString( return GetLocalizedString(message_id); } -WebString WebKitClientImpl::queryLocalizedString( +WebString WebKitPlatformSupportImpl::queryLocalizedString( WebLocalizedString::Name name, int numeric_value) { return queryLocalizedString(name, base::IntToString16(numeric_value)); } -WebString WebKitClientImpl::queryLocalizedString( +WebString WebKitPlatformSupportImpl::queryLocalizedString( WebLocalizedString::Name name, const WebString& value) { int message_id = ToMessageID(name); if (message_id < 0) @@ -471,7 +471,7 @@ WebString WebKitClientImpl::queryLocalizedString( return ReplaceStringPlaceholders(GetLocalizedString(message_id), value, NULL); } -WebString WebKitClientImpl::queryLocalizedString( +WebString WebKitPlatformSupportImpl::queryLocalizedString( WebLocalizedString::Name name, const WebString& value1, const WebString& value2) { @@ -486,25 +486,26 @@ WebString WebKitClientImpl::queryLocalizedString( GetLocalizedString(message_id), values, NULL); } -double WebKitClientImpl::currentTime() { +double WebKitPlatformSupportImpl::currentTime() { return base::Time::Now().ToDoubleT(); } -double WebKitClientImpl::monotonicallyIncreasingTime() { +double WebKitPlatformSupportImpl::monotonicallyIncreasingTime() { return base::TimeTicks::Now().ToInternalValue() / static_cast<double>(base::Time::kMicrosecondsPerSecond); } -void WebKitClientImpl::cryptographicallyRandomValues( +void WebKitPlatformSupportImpl::cryptographicallyRandomValues( unsigned char* buffer, size_t length) { base::RandBytes(buffer, length); } -void WebKitClientImpl::setSharedTimerFiredFunction(void (*func)()) { +void WebKitPlatformSupportImpl::setSharedTimerFiredFunction(void (*func)()) { shared_timer_func_ = func; } -void WebKitClientImpl::setSharedTimerFireInterval(double interval_seconds) { +void WebKitPlatformSupportImpl::setSharedTimerFireInterval( + double interval_seconds) { shared_timer_fire_time_ = interval_seconds + monotonicallyIncreasingTime(); if (shared_timer_suspended_) return; @@ -528,47 +529,48 @@ void WebKitClientImpl::setSharedTimerFireInterval(double interval_seconds) { shared_timer_.Stop(); shared_timer_.Start(base::TimeDelta::FromMicroseconds(interval), this, - &WebKitClientImpl::DoTimeout); + &WebKitPlatformSupportImpl::DoTimeout); } -void WebKitClientImpl::stopSharedTimer() { +void WebKitPlatformSupportImpl::stopSharedTimer() { shared_timer_.Stop(); } -void WebKitClientImpl::callOnMainThread(void (*func)(void*), void* context) { +void WebKitPlatformSupportImpl::callOnMainThread( + void (*func)(void*), void* context) { main_loop_->PostTask(FROM_HERE, NewRunnableFunction(func, context)); } -WebKit::WebThread* WebKitClientImpl::createThread(const char* name) { +WebKit::WebThread* WebKitPlatformSupportImpl::createThread(const char* name) { return new WebThreadImpl(name); } -base::PlatformFile WebKitClientImpl::databaseOpenFile( +base::PlatformFile WebKitPlatformSupportImpl::databaseOpenFile( const WebKit::WebString& vfs_file_name, int desired_flags) { return base::kInvalidPlatformFileValue; } -int WebKitClientImpl::databaseDeleteFile( +int WebKitPlatformSupportImpl::databaseDeleteFile( const WebKit::WebString& vfs_file_name, bool sync_dir) { return -1; } -long WebKitClientImpl::databaseGetFileAttributes( +long WebKitPlatformSupportImpl::databaseGetFileAttributes( const WebKit::WebString& vfs_file_name) { return 0; } -long long WebKitClientImpl::databaseGetFileSize( +long long WebKitPlatformSupportImpl::databaseGetFileSize( const WebKit::WebString& vfs_file_name) { return 0; } -long long WebKitClientImpl::databaseGetSpaceAvailableForOrigin( +long long WebKitPlatformSupportImpl::databaseGetSpaceAvailableForOrigin( const WebKit::WebString& origin_identifier) { return 0; } -WebKit::WebString WebKitClientImpl::signedPublicKeyAndChallengeString( +WebKit::WebString WebKitPlatformSupportImpl::signedPublicKeyAndChallengeString( unsigned key_size_index, const WebKit::WebString& challenge, const WebKit::WebURL& url) { @@ -635,19 +637,19 @@ static size_t getMemoryUsageMB(bool bypass_cache) { return current_mem_usage; } -size_t WebKitClientImpl::memoryUsageMB() { +size_t WebKitPlatformSupportImpl::memoryUsageMB() { return getMemoryUsageMB(false); } -size_t WebKitClientImpl::actualMemoryUsageMB() { +size_t WebKitPlatformSupportImpl::actualMemoryUsageMB() { return getMemoryUsageMB(true); } -void WebKitClientImpl::SuspendSharedTimer() { +void WebKitPlatformSupportImpl::SuspendSharedTimer() { ++shared_timer_suspended_; } -void WebKitClientImpl::ResumeSharedTimer() { +void WebKitPlatformSupportImpl::ResumeSharedTimer() { // The shared timer may have fired or been adjusted while we were suspended. if (--shared_timer_suspended_ == 0 && !shared_timer_.IsRunning()) { setSharedTimerFireInterval( diff --git a/webkit/glue/webkitclient_impl.h b/webkit/glue/webkitplatformsupport_impl.h index 8684731..c429087 100644 --- a/webkit/glue/webkitclient_impl.h +++ b/webkit/glue/webkitplatformsupport_impl.h @@ -2,12 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_CLIENT_IMPL_H_ -#define WEBKIT_CLIENT_IMPL_H_ +#ifndef WEBKIT_PLATFORM_SUPPORT_IMPL_H_ +#define WEBKIT_PLATFORM_SUPPORT_IMPL_H_ #include "base/platform_file.h" #include "base/timer.h" -#include "third_party/WebKit/Source/WebKit/chromium/public/WebKitClient.h" +#include "third_party/WebKit/Source/WebKit/chromium/public/WebKitPlatformSupport.h" #if defined(OS_WIN) #include "webkit/glue/webthemeengine_impl_win.h" #elif defined(OS_MACOSX) @@ -21,12 +21,12 @@ class MessageLoop; namespace webkit_glue { -class WebKitClientImpl : public WebKit::WebKitClient { +class WebKitPlatformSupportImpl : public WebKit::WebKitPlatformSupport { public: - WebKitClientImpl(); - virtual ~WebKitClientImpl(); + WebKitPlatformSupportImpl(); + virtual ~WebKitPlatformSupportImpl(); - // WebKitClient methods (partial implementation): + // WebKitPlatformSupport methods (partial implementation): virtual WebKit::WebThemeEngine* themeEngine(); virtual base::PlatformFile databaseOpenFile( @@ -89,7 +89,7 @@ class WebKitClientImpl : public WebKit::WebKitClient { } MessageLoop* main_loop_; - base::OneShotTimer<WebKitClientImpl> shared_timer_; + base::OneShotTimer<WebKitPlatformSupportImpl> shared_timer_; void (*shared_timer_func_)(); double shared_timer_fire_time_; int shared_timer_suspended_; // counter @@ -98,4 +98,4 @@ class WebKitClientImpl : public WebKit::WebKitClient { } // namespace webkit_glue -#endif // WEBKIT_CLIENT_IMPL_H_ +#endif // WEBKIT_PLATFORM_SUPPORT_IMPL_H_ diff --git a/webkit/plugins/npapi/webplugin_impl.cc b/webkit/plugins/npapi/webplugin_impl.cc index efabcb7..89919c8 100644 --- a/webkit/plugins/npapi/webplugin_impl.cc +++ b/webkit/plugins/npapi/webplugin_impl.cc @@ -28,7 +28,7 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/WebHTTPHeaderVisitor.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" -#include "third_party/WebKit/Source/WebKit/chromium/public/WebKitClient.h" +#include "third_party/WebKit/Source/WebKit/chromium/public/WebKitPlatformSupport.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginContainer.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginParams.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebURL.h" diff --git a/webkit/plugins/ppapi/ppb_flash_clipboard_impl.cc b/webkit/plugins/ppapi/ppb_flash_clipboard_impl.cc index 4d4647c..7b1358c 100644 --- a/webkit/plugins/ppapi/ppb_flash_clipboard_impl.cc +++ b/webkit/plugins/ppapi/ppb_flash_clipboard_impl.cc @@ -15,7 +15,7 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/WebClipboard.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebCString.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" -#include "third_party/WebKit/Source/WebKit/chromium/public/WebKitClient.h" +#include "third_party/WebKit/Source/WebKit/chromium/public/WebKitPlatformSupport.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" #include "webkit/plugins/ppapi/common.h" #include "webkit/plugins/ppapi/plugin_module.h" @@ -68,7 +68,8 @@ PP_Bool IsFormatAvailable(PP_Instance instance_id, if (!instance) return PP_FALSE; - WebKit::WebClipboard* web_clipboard = WebKit::webKitClient()->clipboard(); + WebKit::WebClipboard* web_clipboard = + WebKit::webKitPlatformSupport()->clipboard(); if (!web_clipboard) { NOTREACHED(); return PP_FALSE; @@ -85,7 +86,8 @@ PP_Var ReadPlainText(PP_Instance instance_id, if (!instance) return PP_MakeNull(); - WebKit::WebClipboard* web_clipboard = WebKit::webKitClient()->clipboard(); + WebKit::WebClipboard* web_clipboard = + WebKit::webKitPlatformSupport()->clipboard(); if (!web_clipboard) { NOTREACHED(); return PP_MakeNull(); @@ -111,7 +113,8 @@ int32_t WritePlainText(PP_Instance instance_id, return PP_ERROR_FAILED; } - WebKit::WebClipboard* web_clipboard = WebKit::webKitClient()->clipboard(); + WebKit::WebClipboard* web_clipboard = + WebKit::webKitPlatformSupport()->clipboard(); if (!web_clipboard) { NOTREACHED(); return PP_ERROR_FAILED; diff --git a/webkit/plugins/ppapi/ppb_url_loader_impl.cc b/webkit/plugins/ppapi/ppb_url_loader_impl.cc index d0fb535..8edba62 100644 --- a/webkit/plugins/ppapi/ppb_url_loader_impl.cc +++ b/webkit/plugins/ppapi/ppb_url_loader_impl.cc @@ -15,7 +15,7 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/WebElement.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" -#include "third_party/WebKit/Source/WebKit/chromium/public/WebKitClient.h" +#include "third_party/WebKit/Source/WebKit/chromium/public/WebKitPlatformSupport.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginContainer.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLError.h" diff --git a/webkit/support/simple_database_system.h b/webkit/support/simple_database_system.h index 79b7493..14c9014 100644 --- a/webkit/support/simple_database_system.h +++ b/webkit/support/simple_database_system.h @@ -39,7 +39,7 @@ class SimpleDatabaseSystem : public webkit_database::DatabaseTracker::Observer, virtual void databaseClosed(const WebKit::WebDatabase& database); // SQLite VFS related methods, these are called on webcore's - // background database threads via the WebKitClient impl. + // background database threads via the WebKitPlatformSupport impl. base::PlatformFile OpenFile(const string16& vfs_file_name, int desired_flags); int DeleteFile(const string16& vfs_file_name, bool sync_dir); uint32 GetFileAttributes(const string16& vfs_file_name); diff --git a/webkit/support/test_webkit_client.cc b/webkit/support/test_webkit_platform_support.cc index 14cd833..88a1307 100644 --- a/webkit/support/test_webkit_client.cc +++ b/webkit/support/test_webkit_platform_support.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/support/test_webkit_client.h" +#include "webkit/support/test_webkit_platform_support.h" #include "base/file_util.h" #include "base/metrics/stats_counters.h" @@ -39,7 +39,7 @@ #include "webkit/glue/simple_webmimeregistry_impl.h" #include "webkit/glue/webclipboard_impl.h" #include "webkit/glue/webkit_glue.h" -#include "webkit/glue/webkitclient_impl.h" +#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/support/simple_database_system.h" @@ -65,7 +65,7 @@ using WebKit::WebScriptController; -TestWebKitClient::TestWebKitClient(bool unit_test_mode) +TestWebKitPlatformSupport::TestWebKitPlatformSupport(bool unit_test_mode) : unit_test_mode_(unit_test_mode) { v8::V8::SetCounterFunction(base::StatsTable::FindLocation); @@ -143,99 +143,101 @@ TestWebKitClient::TestWebKitClient(bool unit_test_mode) WebScriptController::registerExtension(extensions_v8::GCExtension::Get()); } -TestWebKitClient::~TestWebKitClient() { +TestWebKitPlatformSupport::~TestWebKitPlatformSupport() { if (RunningOnValgrind()) WebKit::WebCache::clear(); WebKit::shutdown(); } -WebKit::WebMimeRegistry* TestWebKitClient::mimeRegistry() { +WebKit::WebMimeRegistry* TestWebKitPlatformSupport::mimeRegistry() { return &mime_registry_; } -WebKit::WebClipboard* TestWebKitClient::clipboard() { +WebKit::WebClipboard* TestWebKitPlatformSupport::clipboard() { // Mock out clipboard calls so that tests don't mess // with each other's copies/pastes when running in parallel. return &mock_clipboard_; } -WebKit::WebFileUtilities* TestWebKitClient::fileUtilities() { +WebKit::WebFileUtilities* TestWebKitPlatformSupport::fileUtilities() { return &file_utilities_; } -WebKit::WebSandboxSupport* TestWebKitClient::sandboxSupport() { +WebKit::WebSandboxSupport* TestWebKitPlatformSupport::sandboxSupport() { return NULL; } -WebKit::WebCookieJar* TestWebKitClient::cookieJar() { +WebKit::WebCookieJar* TestWebKitPlatformSupport::cookieJar() { return &cookie_jar_; } -WebKit::WebBlobRegistry* TestWebKitClient::blobRegistry() { +WebKit::WebBlobRegistry* TestWebKitPlatformSupport::blobRegistry() { return blob_registry_.get(); } -WebKit::WebFileSystem* TestWebKitClient::fileSystem() { +WebKit::WebFileSystem* TestWebKitPlatformSupport::fileSystem() { return &file_system_; } -bool TestWebKitClient::sandboxEnabled() { +bool TestWebKitPlatformSupport::sandboxEnabled() { return true; } -WebKit::WebKitClient::FileHandle TestWebKitClient::databaseOpenFile( +WebKit::WebKitPlatformSupport::FileHandle +TestWebKitPlatformSupport::databaseOpenFile( const WebKit::WebString& vfs_file_name, int desired_flags) { return SimpleDatabaseSystem::GetInstance()->OpenFile( vfs_file_name, desired_flags); } -int TestWebKitClient::databaseDeleteFile(const WebKit::WebString& vfs_file_name, - bool sync_dir) { +int TestWebKitPlatformSupport::databaseDeleteFile( + const WebKit::WebString& vfs_file_name, bool sync_dir) { return SimpleDatabaseSystem::GetInstance()->DeleteFile( vfs_file_name, sync_dir); } -long TestWebKitClient::databaseGetFileAttributes( +long TestWebKitPlatformSupport::databaseGetFileAttributes( const WebKit::WebString& vfs_file_name) { return SimpleDatabaseSystem::GetInstance()->GetFileAttributes( vfs_file_name); } -long long TestWebKitClient::databaseGetFileSize( +long long TestWebKitPlatformSupport::databaseGetFileSize( const WebKit::WebString& vfs_file_name) { return SimpleDatabaseSystem::GetInstance()->GetFileSize(vfs_file_name); } -long long TestWebKitClient::databaseGetSpaceAvailableForOrigin( +long long TestWebKitPlatformSupport::databaseGetSpaceAvailableForOrigin( const WebKit::WebString& origin_identifier) { return SimpleDatabaseSystem::GetInstance()->GetSpaceAvailable( origin_identifier); } -unsigned long long TestWebKitClient::visitedLinkHash(const char* canonicalURL, - size_t length) { +unsigned long long TestWebKitPlatformSupport::visitedLinkHash( + const char* canonicalURL, size_t length) { return 0; } -bool TestWebKitClient::isLinkVisited(unsigned long long linkHash) { +bool TestWebKitPlatformSupport::isLinkVisited(unsigned long long linkHash) { return false; } -WebKit::WebMessagePortChannel* TestWebKitClient::createMessagePortChannel() { +WebKit::WebMessagePortChannel* +TestWebKitPlatformSupport::createMessagePortChannel() { return NULL; } -void TestWebKitClient::prefetchHostName(const WebKit::WebString&) { +void TestWebKitPlatformSupport::prefetchHostName(const WebKit::WebString&) { } -WebKit::WebURLLoader* TestWebKitClient::createURLLoader() { +WebKit::WebURLLoader* TestWebKitPlatformSupport::createURLLoader() { if (!unit_test_mode_) - return webkit_glue::WebKitClientImpl::createURLLoader(); + return webkit_glue::WebKitPlatformSupportImpl::createURLLoader(); return url_loader_factory_.CreateURLLoader( - webkit_glue::WebKitClientImpl::createURLLoader()); + webkit_glue::WebKitPlatformSupportImpl::createURLLoader()); } -WebKit::WebData TestWebKitClient::loadResource(const char* name) { +WebKit::WebData TestWebKitPlatformSupport::loadResource(const char* name) { if (!strcmp(name, "deleteButton")) { // Create a red 30x30 square. const char red_square[] = @@ -252,10 +254,10 @@ WebKit::WebData TestWebKitClient::loadResource(const char* name) { "\x82"; return WebKit::WebData(red_square, arraysize(red_square)); } - return webkit_glue::WebKitClientImpl::loadResource(name); + return webkit_glue::WebKitPlatformSupportImpl::loadResource(name); } -WebKit::WebString TestWebKitClient::queryLocalizedString( +WebKit::WebString TestWebKitPlatformSupport::queryLocalizedString( WebKit::WebLocalizedString::Name name) { // Returns messages same as WebKit's in DRT. // We use different strings for form validation messages. @@ -283,20 +285,20 @@ WebKit::WebString TestWebKitClient::queryLocalizedString( case WebKit::WebLocalizedString::ValidationStepMismatch: return ASCIIToUTF16("step mismatch"); default: - return WebKitClientImpl::queryLocalizedString(name); + return WebKitPlatformSupportImpl::queryLocalizedString(name); } } -WebKit::WebString TestWebKitClient::queryLocalizedString( +WebKit::WebString TestWebKitPlatformSupport::queryLocalizedString( WebKit::WebLocalizedString::Name name, const WebKit::WebString& value) { if (name == WebKit::WebLocalizedString::ValidationRangeUnderflow) return ASCIIToUTF16("range underflow"); if (name == WebKit::WebLocalizedString::ValidationRangeOverflow) return ASCIIToUTF16("range overflow"); - return WebKitClientImpl::queryLocalizedString(name, value); + return WebKitPlatformSupportImpl::queryLocalizedString(name, value); } -WebKit::WebString TestWebKitClient::queryLocalizedString( +WebKit::WebString TestWebKitPlatformSupport::queryLocalizedString( WebKit::WebLocalizedString::Name name, const WebKit::WebString& value1, const WebKit::WebString& value2) { @@ -304,30 +306,32 @@ WebKit::WebString TestWebKitClient::queryLocalizedString( return ASCIIToUTF16("too long"); if (name == WebKit::WebLocalizedString::ValidationStepMismatch) return ASCIIToUTF16("step mismatch"); - return WebKitClientImpl::queryLocalizedString(name, value1, value2); + return WebKitPlatformSupportImpl::queryLocalizedString(name, value1, value2); } -WebKit::WebString TestWebKitClient::defaultLocale() { +WebKit::WebString TestWebKitPlatformSupport::defaultLocale() { return ASCIIToUTF16("en-US"); } -WebKit::WebStorageNamespace* TestWebKitClient::createLocalStorageNamespace( +WebKit::WebStorageNamespace* +TestWebKitPlatformSupport::createLocalStorageNamespace( const WebKit::WebString& path, unsigned quota) { return WebKit::WebStorageNamespace::createLocalStorageNamespace(path, quota); } -void TestWebKitClient::dispatchStorageEvent(const WebKit::WebString& key, +void TestWebKitPlatformSupport::dispatchStorageEvent( + const WebKit::WebString& key, const WebKit::WebString& old_value, const WebKit::WebString& new_value, const WebKit::WebString& origin, const WebKit::WebURL& url, bool is_local_storage) { // The event is dispatched by the proxy. } -WebKit::WebIDBFactory* TestWebKitClient::idbFactory() { +WebKit::WebIDBFactory* TestWebKitPlatformSupport::idbFactory() { return WebKit::WebIDBFactory::create(); } -void TestWebKitClient::createIDBKeysFromSerializedValuesAndKeyPath( +void TestWebKitPlatformSupport::createIDBKeysFromSerializedValuesAndKeyPath( const WebKit::WebVector<WebKit::WebSerializedScriptValue>& values, const WebKit::WebString& keyPath, WebKit::WebVector<WebKit::WebIDBKey>& keys_out) { @@ -340,7 +344,8 @@ void TestWebKitClient::createIDBKeysFromSerializedValuesAndKeyPath( } WebKit::WebSerializedScriptValue -TestWebKitClient::injectIDBKeyIntoSerializedValue(const WebKit::WebIDBKey& key, +TestWebKitPlatformSupport::injectIDBKeyIntoSerializedValue( + const WebKit::WebIDBKey& key, const WebKit::WebSerializedScriptValue& value, const WebKit::WebString& keyPath) { return WebKit::WebIDBKey::injectIDBKeyIntoSerializedValue( @@ -348,20 +353,23 @@ TestWebKitClient::injectIDBKeyIntoSerializedValue(const WebKit::WebIDBKey& key, } #if defined(OS_WIN) || defined(OS_MACOSX) -void TestWebKitClient::SetThemeEngine(WebKit::WebThemeEngine* engine) { - active_theme_engine_ = engine ? engine : WebKitClientImpl::themeEngine(); +void TestWebKitPlatformSupport::SetThemeEngine(WebKit::WebThemeEngine* engine) { + active_theme_engine_ = engine ? + engine : WebKitPlatformSupportImpl::themeEngine(); } -WebKit::WebThemeEngine* TestWebKitClient::themeEngine() { +WebKit::WebThemeEngine* TestWebKitPlatformSupport::themeEngine() { return active_theme_engine_; } #endif -WebKit::WebSharedWorkerRepository* TestWebKitClient::sharedWorkerRepository() { +WebKit::WebSharedWorkerRepository* +TestWebKitPlatformSupport::sharedWorkerRepository() { return NULL; } -WebKit::WebGraphicsContext3D* TestWebKitClient::createGraphicsContext3D() { +WebKit::WebGraphicsContext3D* +TestWebKitPlatformSupport::createGraphicsContext3D() { switch (webkit_support::GetGraphicsContext3DImplementation()) { case webkit_support::IN_PROCESS: return new webkit::gpu::WebGraphicsContext3DInProcessImpl(); @@ -373,11 +381,11 @@ WebKit::WebGraphicsContext3D* TestWebKitClient::createGraphicsContext3D() { } } -double TestWebKitClient::audioHardwareSampleRate() { +double TestWebKitPlatformSupport::audioHardwareSampleRate() { return 44100.0; } -WebKit::WebAudioDevice* TestWebKitClient::createAudioDevice( +WebKit::WebAudioDevice* TestWebKitPlatformSupport::createAudioDevice( size_t bufferSize, unsigned numberOfChannels, double sampleRate, WebKit::WebAudioDevice::RenderCallback*) { return new WebAudioDeviceMock(sampleRate); diff --git a/webkit/support/test_webkit_client.h b/webkit/support/test_webkit_platform_support.h index ba3d9a1..560c9a4 100644 --- a/webkit/support/test_webkit_client.h +++ b/webkit/support/test_webkit_platform_support.h @@ -2,11 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_SUPPORT_TEST_WEBKIT_CLIENT_H_ -#define WEBKIT_SUPPORT_TEST_WEBKIT_CLIENT_H_ +#ifndef WEBKIT_SUPPORT_TEST_WEBKIT_PLATFORM_SUPPORT_H_ +#define WEBKIT_SUPPORT_TEST_WEBKIT_PLATFORM_SUPPORT_H_ #include "webkit/glue/webfileutilities_impl.h" -#include "webkit/glue/webkitclient_impl.h" +#include "webkit/glue/webkitplatformsupport_impl.h" #include "webkit/support/simple_database_system.h" #include "webkit/support/weburl_loader_mock_factory.h" #include "webkit/tools/test_shell/mock_webclipboard_impl.h" @@ -21,11 +21,12 @@ namespace WebKit { class WebAudioDevice; } -// An implementation of WebKitClient for tests. -class TestWebKitClient : public webkit_glue::WebKitClientImpl { +// An implementation of WebKitPlatformSupport for tests. +class TestWebKitPlatformSupport : + public webkit_glue::WebKitPlatformSupportImpl { public: - explicit TestWebKitClient(bool unit_test_mode); - virtual ~TestWebKitClient(); + explicit TestWebKitPlatformSupport(bool unit_test_mode); + virtual ~TestWebKitPlatformSupport(); virtual WebKit::WebMimeRegistry* mimeRegistry(); virtual WebKit::WebClipboard* clipboard(); @@ -36,7 +37,7 @@ class TestWebKitClient : public webkit_glue::WebKitClientImpl { virtual WebKit::WebFileSystem* fileSystem(); virtual bool sandboxEnabled(); - virtual WebKit::WebKitClient::FileHandle databaseOpenFile( + virtual WebKit::WebKitPlatformSupport::FileHandle databaseOpenFile( const WebKit::WebString& vfs_file_name, int desired_flags); virtual int databaseDeleteFile(const WebKit::WebString& vfs_file_name, bool sync_dir); @@ -118,7 +119,7 @@ class TestWebKitClient : public webkit_glue::WebKitClientImpl { #if defined(OS_WIN) || defined(OS_MACOSX) WebKit::WebThemeEngine* active_theme_engine_; #endif - DISALLOW_COPY_AND_ASSIGN(TestWebKitClient); + DISALLOW_COPY_AND_ASSIGN(TestWebKitPlatformSupport); }; -#endif // WEBKIT_SUPPORT_TEST_WEBKIT_CLIENT_H_ +#endif // WEBKIT_SUPPORT_TEST_WEBKIT_PLATFORM_SUPPORT_H_ diff --git a/webkit/support/test_webplugin_page_delegate.cc b/webkit/support/test_webplugin_page_delegate.cc index 3725430..ce74d57 100644 --- a/webkit/support/test_webplugin_page_delegate.cc +++ b/webkit/support/test_webplugin_page_delegate.cc @@ -5,7 +5,7 @@ #include "webkit/support/test_webplugin_page_delegate.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" -#include "third_party/WebKit/Source/WebKit/chromium/public/WebKitClient.h" +#include "third_party/WebKit/Source/WebKit/chromium/public/WebKitPlatformSupport.h" namespace webkit_support { @@ -20,7 +20,7 @@ TestWebPluginPageDelegate::CreatePluginDelegate( } WebKit::WebCookieJar* TestWebPluginPageDelegate::GetCookieJar() { - return WebKit::webKitClient()->cookieJar(); + return WebKit::webKitPlatformSupport()->cookieJar(); } } // namespace webkit_support diff --git a/webkit/support/webkit_support.cc b/webkit/support/webkit_support.cc index d877325..34b83c9 100644 --- a/webkit/support/webkit_support.cc +++ b/webkit/support/webkit_support.cc @@ -47,7 +47,7 @@ #include "webkit/glue/media/video_renderer_impl.h" #include "webkit/glue/webkit_constants.h" #include "webkit/glue/webkit_glue.h" -#include "webkit/glue/webkitclient_impl.h" +#include "webkit/glue/webkitplatformsupport_impl.h" #include "webkit/glue/webmediaplayer_impl.h" #include "webkit/plugins/npapi/plugin_list.h" #include "webkit/plugins/npapi/webplugin_impl.h" @@ -56,7 +56,7 @@ #include "webkit/support/platform_support.h" #include "webkit/support/simple_database_system.h" #include "webkit/support/test_webplugin_page_delegate.h" -#include "webkit/support/test_webkit_client.h" +#include "webkit/support/test_webkit_platform_support.h" #include "webkit/tools/test_shell/simple_file_system.h" #include "webkit/tools/test_shell/simple_resource_loader_bridge.h" @@ -123,31 +123,34 @@ class TestEnvironment { InitLogging(false); } main_message_loop_.reset(new MessageLoopForUI); - // TestWebKitClient must be instantiated after the MessageLoopForUI. - webkit_client_.reset(new TestWebKitClient(unit_test_mode)); + // TestWebKitPlatformSupport must be instantiated after MessageLoopForUI. + webkit_platform_support_.reset( + new TestWebKitPlatformSupport(unit_test_mode)); } ~TestEnvironment() { SimpleResourceLoaderBridge::Shutdown(); } - TestWebKitClient* webkit_client() const { return webkit_client_.get(); } + TestWebKitPlatformSupport* webkit_platform_support() const { + return webkit_platform_support_.get(); + } #if defined(OS_WIN) || defined(OS_MACOSX) void set_theme_engine(WebKit::WebThemeEngine* engine) { - DCHECK(webkit_client_ != 0); - webkit_client_->SetThemeEngine(engine); + DCHECK(webkit_platform_support_ != 0); + webkit_platform_support_->SetThemeEngine(engine); } WebKit::WebThemeEngine* theme_engine() const { - return webkit_client_->themeEngine(); + return webkit_platform_support_->themeEngine(); } #endif private: scoped_ptr<base::AtExitManager> at_exit_manager_; scoped_ptr<MessageLoopForUI> main_message_loop_; - scoped_ptr<TestWebKitClient> webkit_client_; + scoped_ptr<TestWebKitPlatformSupport> webkit_platform_support_; }; class WebPluginImplWithPageDelegate @@ -277,9 +280,9 @@ void TearDownTestEnvironment() { logging::CloseLogFile(); } -WebKit::WebKitClient* GetWebKitClient() { +WebKit::WebKitPlatformSupport* GetWebKitPlatformSupport() { DCHECK(test_environment); - return test_environment->webkit_client(); + return test_environment->webkit_platform_support(); } WebPlugin* CreateWebPlugin(WebFrame* frame, @@ -357,20 +360,22 @@ GraphicsContext3DImplementation GetGraphicsContext3DImplementation() { void RegisterMockedURL(const WebKit::WebURL& url, const WebKit::WebURLResponse& response, const WebKit::WebString& file_path) { - test_environment->webkit_client()->url_loader_factory()-> + test_environment->webkit_platform_support()->url_loader_factory()-> RegisterURL(url, response, file_path); } void UnregisterMockedURL(const WebKit::WebURL& url) { - test_environment->webkit_client()->url_loader_factory()->UnregisterURL(url); + test_environment->webkit_platform_support()->url_loader_factory()-> + UnregisterURL(url); } void UnregisterAllMockedURLs() { - test_environment->webkit_client()->url_loader_factory()->UnregisterAllURLs(); + test_environment->webkit_platform_support()->url_loader_factory()-> + UnregisterAllURLs(); } void ServeAsynchronousMockedRequests() { - test_environment->webkit_client()->url_loader_factory()-> + test_environment->webkit_platform_support()->url_loader_factory()-> ServeAsynchronousRequests(); } @@ -611,7 +616,7 @@ WebURL GetDevToolsPathAsURL() { void OpenFileSystem(WebFrame* frame, WebFileSystem::Type type, long long size, bool create, WebFileSystemCallbacks* callbacks) { SimpleFileSystem* fileSystem = static_cast<SimpleFileSystem*>( - test_environment->webkit_client()->fileSystem()); + test_environment->webkit_platform_support()->fileSystem()); fileSystem->OpenFileSystem(frame, type, size, create, callbacks); } diff --git a/webkit/support/webkit_support.gypi b/webkit/support/webkit_support.gypi index bfa4774..00bea43 100644 --- a/webkit/support/webkit_support.gypi +++ b/webkit/support/webkit_support.gypi @@ -40,8 +40,8 @@ 'platform_support_gtk.cc', 'platform_support_mac.mm', 'platform_support_win.cc', - 'test_webkit_client.cc', - 'test_webkit_client.h', + 'test_webkit_platform_support.cc', + 'test_webkit_platform_support.h', 'test_webplugin_page_delegate.cc', 'test_webplugin_page_delegate.h', 'webkit_support.cc', diff --git a/webkit/support/webkit_support.h b/webkit/support/webkit_support.h index 1a9e768..9186bd5 100644 --- a/webkit/support/webkit_support.h +++ b/webkit/support/webkit_support.h @@ -12,7 +12,6 @@ #include "base/string16.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebDevToolsAgentClient.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileSystem.h" -#include "third_party/WebKit/Source/WebKit/chromium/public/WebKitClient.h" #include "ui/base/keycodes/keyboard_codes.h" class WebURLLoaderMockFactory; @@ -22,6 +21,7 @@ class WebApplicationCacheHostClient; class WebCString; class WebFileSystemCallbacks; class WebFrame; +class WebKitPlatformSupport; class WebMediaPlayer; class WebMediaPlayerClient; class WebPlugin; @@ -55,10 +55,10 @@ void SetUpTestEnvironment(); void SetUpTestEnvironmentForUnitTests(); void TearDownTestEnvironment(); -// Returns a pointer to a WebKitClient implementation for DumpRenderTree. -// Needs to call SetUpTestEnvironment() before this. +// Returns a pointer to a WebKitPlatformSupport implementation for +// DumpRenderTree. Needs to call SetUpTestEnvironment() before this. // This returns a pointer to a static instance. Don't delete it. -WebKit::WebKitClient* GetWebKitClient(); +WebKit::WebKitPlatformSupport* GetWebKitPlatformSupport(); // This is used by WebFrameClient::createPlugin(). WebKit::WebPlugin* CreateWebPlugin(WebKit::WebFrame* frame, diff --git a/webkit/support/weburl_loader_mock_factory.h b/webkit/support/weburl_loader_mock_factory.h index 51e238d..cd10012 100644 --- a/webkit/support/weburl_loader_mock_factory.h +++ b/webkit/support/weburl_loader_mock_factory.h @@ -31,7 +31,7 @@ class WebURLLoaderMockFactory { WebURLLoaderMockFactory(); virtual ~WebURLLoaderMockFactory(); - // Called by TestWebKitClient to create a WebURLLoader. + // Called by TestWebKitPlatformSupport to create a WebURLLoader. // Non-mocked request are forwarded to |default_loader| which should not be // NULL. virtual WebKit::WebURLLoader* CreateURLLoader( diff --git a/webkit/tools/test_shell/test_shell_request_context.cc b/webkit/tools/test_shell/test_shell_request_context.cc index 3202045..82495b6 100644 --- a/webkit/tools/test_shell/test_shell_request_context.cc +++ b/webkit/tools/test_shell/test_shell_request_context.cc @@ -21,7 +21,7 @@ #include "net/proxy/proxy_service.h" #include "net/url_request/url_request_job_factory.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" -#include "third_party/WebKit/Source/WebKit/chromium/public/WebKitClient.h" +#include "third_party/WebKit/Source/WebKit/chromium/public/WebKitPlatformSupport.h" #include "webkit/blob/blob_storage_controller.h" #include "webkit/blob/blob_url_request_job_factory.h" #include "webkit/fileapi/file_system_context.h" @@ -103,7 +103,7 @@ void TestShellRequestContext::Init( blob_storage_controller_.reset(new webkit_blob::BlobStorageController()); file_system_context_ = static_cast<SimpleFileSystem*>( - WebKit::webKitClient()->fileSystem())->file_system_context(); + WebKit::webKitPlatformSupport()->fileSystem())->file_system_context(); net::URLRequestJobFactory* job_factory = new net::URLRequestJobFactory; job_factory->SetProtocolHandler( diff --git a/webkit/tools/test_shell/test_shell_webkit_init.cc b/webkit/tools/test_shell/test_shell_webkit_init.cc index bdaa231..0d2e448 100644 --- a/webkit/tools/test_shell/test_shell_webkit_init.cc +++ b/webkit/tools/test_shell/test_shell_webkit_init.cc @@ -129,7 +129,8 @@ bool TestShellWebKitInit::sandboxEnabled() { return true; } -WebKit::WebKitClient::FileHandle TestShellWebKitInit::databaseOpenFile( +WebKit::WebKitPlatformSupport::FileHandle +TestShellWebKitInit::databaseOpenFile( const WebKit::WebString& vfs_file_name, int desired_flags) { return SimpleDatabaseSystem::GetInstance()->OpenFile( vfs_file_name, desired_flags); @@ -193,7 +194,7 @@ WebKit::WebData TestShellWebKitInit::loadResource(const char* name) { "\x82"; return WebKit::WebData(red_square, arraysize(red_square)); } - return webkit_glue::WebKitClientImpl::loadResource(name); + return webkit_glue::WebKitPlatformSupportImpl::loadResource(name); } WebKit::WebString TestShellWebKitInit::queryLocalizedString( @@ -222,7 +223,7 @@ WebKit::WebString TestShellWebKitInit::queryLocalizedString( case WebKit::WebLocalizedString::ValidationStepMismatch: return ASCIIToUTF16("step mismatch"); default: - return WebKitClientImpl::queryLocalizedString(name); + return WebKitPlatformSupportImpl::queryLocalizedString(name); } } @@ -232,7 +233,7 @@ WebKit::WebString TestShellWebKitInit::queryLocalizedString( return ASCIIToUTF16("range underflow"); if (name == WebKit::WebLocalizedString::ValidationRangeOverflow) return ASCIIToUTF16("range overflow"); - return WebKitClientImpl::queryLocalizedString(name, value); + return WebKitPlatformSupportImpl::queryLocalizedString(name, value); } WebKit::WebString TestShellWebKitInit::queryLocalizedString( @@ -243,7 +244,7 @@ WebKit::WebString TestShellWebKitInit::queryLocalizedString( return ASCIIToUTF16("too long"); if (name == WebKit::WebLocalizedString::ValidationStepMismatch) return ASCIIToUTF16("step mismatch"); - return WebKitClientImpl::queryLocalizedString(name, value1, value2); + return WebKitPlatformSupportImpl::queryLocalizedString(name, value1, value2); } WebKit::WebString TestShellWebKitInit::defaultLocale() { diff --git a/webkit/tools/test_shell/test_shell_webkit_init.h b/webkit/tools/test_shell/test_shell_webkit_init.h index a4e8f27..2cf1209 100644 --- a/webkit/tools/test_shell/test_shell_webkit_init.h +++ b/webkit/tools/test_shell/test_shell_webkit_init.h @@ -14,7 +14,7 @@ #include "webkit/glue/webclipboard_impl.h" #include "webkit/glue/webfileutilities_impl.h" #include "webkit/glue/webkit_glue.h" -#include "webkit/glue/webkitclient_impl.h" +#include "webkit/glue/webkitplatformsupport_impl.h" #include "webkit/gpu/webgraphicscontext3d_in_process_impl.h" #include "webkit/support/simple_database_system.h" #include "webkit/tools/test_shell/mock_webclipboard_impl.h" @@ -29,7 +29,7 @@ #include "webkit/tools/test_shell/test_shell_webthemeengine.h" #endif -class TestShellWebKitInit : public webkit_glue::WebKitClientImpl { +class TestShellWebKitInit : public webkit_glue::WebKitPlatformSupportImpl { public: explicit TestShellWebKitInit(bool layout_test_mode); virtual ~TestShellWebKitInit(); @@ -42,7 +42,7 @@ class TestShellWebKitInit : public webkit_glue::WebKitClientImpl { virtual WebKit::WebBlobRegistry* blobRegistry(); virtual WebKit::WebFileSystem* fileSystem(); virtual bool sandboxEnabled(); - virtual WebKit::WebKitClient::FileHandle databaseOpenFile( + virtual WebKit::WebKitPlatformSupport::FileHandle databaseOpenFile( const WebKit::WebString& vfs_file_name, int desired_flags); virtual int databaseDeleteFile(const WebKit::WebString& vfs_file_name, bool sync_dir); @@ -92,7 +92,8 @@ class TestShellWebKitInit : public webkit_glue::WebKitClientImpl { #if defined(OS_WIN) void SetThemeEngine(WebKit::WebThemeEngine* engine) { - active_theme_engine_ = engine ? engine : WebKitClientImpl::themeEngine(); + active_theme_engine_ = engine ? + engine : WebKitPlatformSupportImpl::themeEngine(); } virtual WebKit::WebThemeEngine *themeEngine() { diff --git a/webkit/tools/test_shell/test_webview_delegate.cc b/webkit/tools/test_shell/test_webview_delegate.cc index 6427ab6..0b9d70f 100644 --- a/webkit/tools/test_shell/test_webview_delegate.cc +++ b/webkit/tools/test_shell/test_webview_delegate.cc @@ -36,7 +36,7 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebGeolocationClientMock.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" -#include "third_party/WebKit/Source/WebKit/chromium/public/WebKitClient.h" +#include "third_party/WebKit/Source/WebKit/chromium/public/WebKitPlatformSupport.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebNode.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebNotificationPresenter.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginParams.h" @@ -951,14 +951,14 @@ void TestWebViewDelegate::openFileSystem( WebFrame* frame, WebFileSystem::Type type, long long size, bool create, WebFileSystemCallbacks* callbacks) { SimpleFileSystem* fileSystem = static_cast<SimpleFileSystem*>( - WebKit::webKitClient()->fileSystem()); + WebKit::webKitPlatformSupport()->fileSystem()); fileSystem->OpenFileSystem(frame, type, size, create, callbacks); } // WebPluginPageDelegate ----------------------------------------------------- WebCookieJar* TestWebViewDelegate::GetCookieJar() { - return WebKit::webKitClient()->cookieJar(); + return WebKit::webKitPlatformSupport()->cookieJar(); } // Public methods ------------------------------------------------------------ |