diff options
author | tkent@google.com <tkent@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-05 08:46:20 +0000 |
---|---|---|
committer | tkent@google.com <tkent@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-05 08:46:20 +0000 |
commit | 831d36b259bb29400123b7c186d67276cbbb9eb8 (patch) | |
tree | aac014b4fd8a7c0581887dc90533f85fbb25b223 /webkit/support/webkit_support.h | |
parent | 70aa5b3f170b0f0edbaae0dfcf079740b39a2d68 (diff) | |
download | chromium_src-831d36b259bb29400123b7c186d67276cbbb9eb8.zip chromium_src-831d36b259bb29400123b7c186d67276cbbb9eb8.tar.gz chromium_src-831d36b259bb29400123b7c186d67276cbbb9eb8.tar.bz2 |
Add more wrapper functions to webkit_support to avoid dependency to
debug_util.h, message_loop.h, file_path.h, file_util.h, path_service.h.
platform_support contains hook functions called before/after
initialization/shutdown.
TEST=none
BUG=none
Review URL: http://codereview.chromium.org/1331001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43604 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/support/webkit_support.h')
-rw-r--r-- | webkit/support/webkit_support.h | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/webkit/support/webkit_support.h b/webkit/support/webkit_support.h index a6af463..485c931 100644 --- a/webkit/support/webkit_support.h +++ b/webkit/support/webkit_support.h @@ -5,6 +5,11 @@ #ifndef WEBKIT_SUPPORT_WEBIT_SUPPORT_H_ #define WEBKIT_SUPPORT_WEBIT_SUPPORT_H_ +#include <string> + +#include "base/basictypes.h" + +class Task; namespace WebKit { class WebFrame; class WebKitClient; @@ -12,6 +17,8 @@ class WebMediaPlayer; class WebMediaPlayerClient; class WebPlugin; struct WebPluginParams; +class WebString; +class WebURL; } // This package provides functions used by DumpRenderTree/chromium. @@ -22,6 +29,8 @@ struct WebPluginParams; namespace webkit_support { // Initializes or terminates a test environment. +// SetUpTestEnvironment() calls WebKit::initialize(). +// TearDownTestEnvironment() calls WebKit::shutdown(). void SetUpTestEnvironment(); void TearDownTestEnvironment(); @@ -38,9 +47,39 @@ WebKit::WebPlugin* CreateWebPlugin(WebKit::WebFrame* frame, WebKit::WebMediaPlayer* CreateMediaPlayer(WebKit::WebFrame* frame, WebKit::WebMediaPlayerClient* client); -// The following functions are used by LayoutTestController. +// Wrappers to minimize dependecy. + +// -------- Debugging +bool BeingDebugged(); + +// -------- Message loop and task +void RunMessageLoop(); +void QuitMessageLoop(); +void RunAllPendingMessages(); +void DispatchMessageLoop(); +void PostTaskFromHere(Task* task); // TODO(tkent): Eliminate Task. +void PostDelayedTaskFromHere(Task* task, int64 delay_ms); // ditto. + +// -------- File path and PathService +// Converts the specified path string to an absolute path in WebString. +// |utf8_path| is in UTF-8 encoding, not native multibyte string. +WebKit::WebString GetAbsoluteWebStringFromUTF8Path( + const std::string& utf8_path); + +// Create a WebURL from the specified string. +// If |path_or_url_in_nativemb| is a URL starting with scheme, this simply +// returns a WebURL for it. Otherwise, this returns a file:// URL. +WebKit::WebURL CreateURLForPathOrURL( + const std::string& path_or_url_in_nativemb); + +// Converts file:///tmp/LayoutTests URLs to the actual location on disk. +WebKit::WebURL RewriteLayoutTestsURL(const std::string& utf8_url); + +// - Database void SetDatabaseQuota(int quota); void ClearAllDatabases(); + +// - Resource loader void SetAcceptAllCookies(bool accept); } // namespace webkit_support |