diff options
author | abarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-02 10:05:19 +0000 |
---|---|---|
committer | abarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-02 10:05:19 +0000 |
commit | 8d6cba4c551a773707f441d5f2955948ba6b2450 (patch) | |
tree | aaad1b50f3fb696c4f39a4dc078149b7560b8160 /webkit | |
parent | 927a672386c66a29f84f622e1d1fa2f42a45be3b (diff) | |
download | chromium_src-8d6cba4c551a773707f441d5f2955948ba6b2450.zip chromium_src-8d6cba4c551a773707f441d5f2955948ba6b2450.tar.gz chromium_src-8d6cba4c551a773707f441d5f2955948ba6b2450.tar.bz2 |
Update Chrome to use WebKitPlatformSupport instead of WebKitClient.
Review URL: http://codereview.chromium.org/7831035
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99349 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
21 files changed, 180 insertions, 159 deletions
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 ------------------------------------------------------------ |