summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/in_process_webkit/browser_webkitclient_impl.cc10
-rw-r--r--chrome/browser/in_process_webkit/browser_webkitclient_impl.h2
-rw-r--r--chrome/browser/in_process_webkit/dom_storage_dispatcher_host.cc14
-rw-r--r--chrome/browser/in_process_webkit/dom_storage_dispatcher_host.h3
-rw-r--r--chrome/browser/renderer_host/render_sandbox_host_linux.cc25
-rw-r--r--chrome/renderer/renderer_webkitclient_impl.cc11
-rw-r--r--chrome/renderer/renderer_webkitclient_impl.h1
-rw-r--r--chrome/worker/worker_webkitclient_impl.cc6
-rw-r--r--chrome/worker/worker_webkitclient_impl.h1
-rw-r--r--webkit/api/public/WebKitClient.h63
-rw-r--r--webkit/api/src/ChromiumBridge.cpp72
-rw-r--r--webkit/api/src/WebKit.cpp10
-rw-r--r--webkit/glue/webkitclient_impl.cc59
-rw-r--r--webkit/glue/webkitclient_impl.h13
-rw-r--r--webkit/tools/test_shell/test_shell_webkit_init.h4
-rw-r--r--webkit/tools/test_shell/test_worker/test_worker_main.cc4
16 files changed, 215 insertions, 83 deletions
diff --git a/chrome/browser/in_process_webkit/browser_webkitclient_impl.cc b/chrome/browser/in_process_webkit/browser_webkitclient_impl.cc
index e1052db..33fc0de 100644
--- a/chrome/browser/in_process_webkit/browser_webkitclient_impl.cc
+++ b/chrome/browser/in_process_webkit/browser_webkitclient_impl.cc
@@ -24,6 +24,10 @@ WebKit::WebSandboxSupport* BrowserWebKitClientImpl::sandboxSupport() {
return NULL;
}
+bool BrowserWebKitClientImpl::sandboxEnabled() {
+ return false;
+}
+
unsigned long long BrowserWebKitClientImpl::visitedLinkHash(
const char* canonical_url,
size_t length) {
@@ -58,12 +62,6 @@ void BrowserWebKitClientImpl::prefetchHostName(const WebKit::WebString&) {
NOTREACHED();
}
-bool BrowserWebKitClientImpl::getFileSize(const WebKit::WebString& path,
- long long& result) {
- NOTREACHED();
- return false;
-}
-
WebKit::WebString BrowserWebKitClientImpl::defaultLocale() {
NOTREACHED();
return WebKit::WebString();
diff --git a/chrome/browser/in_process_webkit/browser_webkitclient_impl.h b/chrome/browser/in_process_webkit/browser_webkitclient_impl.h
index 61dffa6..546100d 100644
--- a/chrome/browser/in_process_webkit/browser_webkitclient_impl.h
+++ b/chrome/browser/in_process_webkit/browser_webkitclient_impl.h
@@ -13,6 +13,7 @@ class BrowserWebKitClientImpl : public webkit_glue::WebKitClientImpl {
virtual WebKit::WebClipboard* clipboard();
virtual WebKit::WebMimeRegistry* mimeRegistry();
virtual WebKit::WebSandboxSupport* sandboxSupport();
+ virtual bool sandboxEnabled();
virtual unsigned long long visitedLinkHash(const char* canonicalURL,
size_t length);
virtual bool isLinkVisited(unsigned long long linkHash);
@@ -23,7 +24,6 @@ class BrowserWebKitClientImpl : public webkit_glue::WebKitClientImpl {
virtual WebKit::WebString cookies(const WebKit::WebURL& url,
const WebKit::WebURL& policy_url);
virtual void prefetchHostName(const WebKit::WebString&);
- virtual bool getFileSize(const WebKit::WebString& path, long long& result);
virtual WebKit::WebString defaultLocale();
virtual WebKit::WebThemeEngine* themeEngine();
virtual WebKit::WebURLLoader* createURLLoader();
diff --git a/chrome/browser/in_process_webkit/dom_storage_dispatcher_host.cc b/chrome/browser/in_process_webkit/dom_storage_dispatcher_host.cc
index 8ef7ca4..0bc4df0 100644
--- a/chrome/browser/in_process_webkit/dom_storage_dispatcher_host.cc
+++ b/chrome/browser/in_process_webkit/dom_storage_dispatcher_host.cc
@@ -14,9 +14,11 @@
#include "webkit/api/public/WebStorageArea.h"
#include "webkit/api/public/WebStorageNamespace.h"
#include "webkit/api/public/WebString.h"
+#include "webkit/glue/webkit_glue.h"
using WebKit::WebStorageArea;
using WebKit::WebStorageNamespace;
+using WebKit::WebString;
DOMStorageDispatcherHost::DOMStorageDispatcherHost(
IPC::Message::Sender* message_sender,
@@ -281,7 +283,7 @@ void DOMStorageDispatcherHost::OnGetItem(int64 storage_area_id,
DCHECK(ChromeThread::CurrentlyOn(ChromeThread::WEBKIT));
WebStorageArea* storage_area = GetStorageArea(storage_area_id);
CHECK(storage_area); // TODO(jorlow): Do better than this.
- WebKit::WebString value = storage_area->getItem(key);
+ WebString value = storage_area->getItem(key);
ViewHostMsg_DOMStorageGetItem::WriteReplyParams(reply_msg, (string16)value,
value.isNull());
Send(reply_msg);
@@ -375,8 +377,10 @@ int64 DOMStorageDispatcherHost::AddStorageNamespace(
return new_namespace_id;
}
-string16 DOMStorageDispatcherHost::GetLocalStoragePath() {
- // TODO(jorlow): Create a path based on the WebKitContext.
- string16 path;
- return path;
+WebString DOMStorageDispatcherHost::GetLocalStoragePath() {
+ const FilePath& path = webkit_context_->data_path();
+ if (path.empty())
+ return WebString();
+ FilePath::StringType path_string = path.AppendASCII("localStorage").value();
+ return webkit_glue::FilePathStringToWebString(path_string);
}
diff --git a/chrome/browser/in_process_webkit/dom_storage_dispatcher_host.h b/chrome/browser/in_process_webkit/dom_storage_dispatcher_host.h
index 8e7e12f..38fee15 100644
--- a/chrome/browser/in_process_webkit/dom_storage_dispatcher_host.h
+++ b/chrome/browser/in_process_webkit/dom_storage_dispatcher_host.h
@@ -16,6 +16,7 @@ class WebKitThread;
namespace WebKit {
class WebStorageArea;
class WebStorageNamespace;
+class WebString;
}
// This class handles the logistics of DOM Storage within the browser process.
@@ -69,7 +70,7 @@ class DOMStorageDispatcherHost :
// Get the path to the LocalStorage directory. Calculate it if we haven't
// already. Only call on the WebKit thread.
- string16 GetLocalStoragePath();
+ WebKit::WebString GetLocalStoragePath();
// Data shared between renderer processes with the same profile.
scoped_refptr<WebKitContext> webkit_context_;
diff --git a/chrome/browser/renderer_host/render_sandbox_host_linux.cc b/chrome/browser/renderer_host/render_sandbox_host_linux.cc
index 7611df0..460f1cb 100644
--- a/chrome/browser/renderer_host/render_sandbox_host_linux.cc
+++ b/chrome/browser/renderer_host/render_sandbox_host_linux.cc
@@ -111,16 +111,13 @@ class SandboxIPCProcess : public WebKitClient {
virtual WebClipboard* clipboard() { return NULL; }
virtual WebMimeRegistry* mimeRegistry() { return NULL; }
virtual WebSandboxSupport* sandboxSupport() { return NULL; }
+ virtual bool sandboxEnabled() { return true; }
virtual WebThemeEngine* themeEngine() { return NULL; }
virtual WebStorageNamespace* createLocalStorageNamespace(
const WebString& path) { return 0; }
virtual WebStorageNamespace* createSessionStorageNamespace() { return 0; }
- virtual bool getFileSize(const WebString& path, long long& result) {
- return false;
- }
-
virtual unsigned long long visitedLinkHash(const char*, size_t) { return 0; }
virtual bool isLinkVisited(unsigned long long) { return false; }
@@ -129,7 +126,9 @@ class SandboxIPCProcess : public WebKitClient {
}
virtual void setCookies(const WebURL&, const WebURL&, const WebString&) { }
- virtual WebString cookies(const WebURL&, const WebURL&) { return WebString(); }
+ virtual WebString cookies(const WebURL&, const WebURL&) {
+ return WebString();
+ }
virtual void prefetchHostName(const WebString&) { }
@@ -177,6 +176,22 @@ class SandboxIPCProcess : public WebKitClient {
return 0;
}
+ bool fileExists(const WebString& path) { return false; }
+ bool deleteFile(const WebString& path) { return false; }
+ bool deleteEmptyDirectory(const WebString& path) { return false; }
+ bool getFileSize(const WebString& path, long long& result) {
+ return false;
+ }
+ bool getFileModificationTime(const WebString& path, time_t& result) {
+ return false;
+ }
+ WebString directoryName(const WebString& path) { return WebString(); }
+ WebString pathByAppendingComponent(const WebString& path,
+ const WebString& component) {
+ return WebString();
+ }
+ bool makeAllDirectories(const WebString& path) { return false; }
+
private:
// ---------------------------------------------------------------------------
// Requests from the renderer...
diff --git a/chrome/renderer/renderer_webkitclient_impl.cc b/chrome/renderer/renderer_webkitclient_impl.cc
index e19487b..93662af 100644
--- a/chrome/renderer/renderer_webkitclient_impl.cc
+++ b/chrome/renderer/renderer_webkitclient_impl.cc
@@ -48,6 +48,17 @@ WebKit::WebSandboxSupport* RendererWebKitClientImpl::sandboxSupport() {
#endif
}
+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.
+ return !CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess);
+}
+
bool RendererWebKitClientImpl::getFileSize(const WebString& path,
long long& result) {
if (RenderThread::current()->Send(new ViewHostMsg_GetFileSize(
diff --git a/chrome/renderer/renderer_webkitclient_impl.h b/chrome/renderer/renderer_webkitclient_impl.h
index 3d5828c..c9bd464 100644
--- a/chrome/renderer/renderer_webkitclient_impl.h
+++ b/chrome/renderer/renderer_webkitclient_impl.h
@@ -25,6 +25,7 @@ class RendererWebKitClientImpl : public webkit_glue::WebKitClientImpl {
virtual WebKit::WebClipboard* clipboard();
virtual WebKit::WebMimeRegistry* mimeRegistry();
virtual WebKit::WebSandboxSupport* sandboxSupport();
+ virtual bool sandboxEnabled();
virtual bool getFileSize(const WebKit::WebString& path, long long& result);
virtual unsigned long long visitedLinkHash(
const char* canonicalURL, size_t length);
diff --git a/chrome/worker/worker_webkitclient_impl.cc b/chrome/worker/worker_webkitclient_impl.cc
index 4923542..aa2fb57 100644
--- a/chrome/worker/worker_webkitclient_impl.cc
+++ b/chrome/worker/worker_webkitclient_impl.cc
@@ -25,6 +25,12 @@ WebKit::WebSandboxSupport* WorkerWebKitClientImpl::sandboxSupport() {
return NULL;
}
+bool WorkerWebKitClientImpl::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.
+ return true;
+}
+
unsigned long long WorkerWebKitClientImpl::visitedLinkHash(
const char* canonical_url,
size_t length) {
diff --git a/chrome/worker/worker_webkitclient_impl.h b/chrome/worker/worker_webkitclient_impl.h
index 69a28e4..673bfc6 100644
--- a/chrome/worker/worker_webkitclient_impl.h
+++ b/chrome/worker/worker_webkitclient_impl.h
@@ -13,6 +13,7 @@ class WorkerWebKitClientImpl : public webkit_glue::WebKitClientImpl {
virtual WebKit::WebClipboard* clipboard();
virtual WebKit::WebMimeRegistry* mimeRegistry();
virtual WebKit::WebSandboxSupport* sandboxSupport();
+ virtual bool sandboxEnabled();
virtual unsigned long long visitedLinkHash(const char* canonicalURL,
size_t length);
virtual bool isLinkVisited(unsigned long long linkHash);
diff --git a/webkit/api/public/WebKitClient.h b/webkit/api/public/WebKitClient.h
index 026caf5..2757a96 100644
--- a/webkit/api/public/WebKitClient.h
+++ b/webkit/api/public/WebKitClient.h
@@ -31,6 +31,8 @@
#ifndef WebKitClient_h
#define WebKitClient_h
+#include <time.h>
+
#include "WebCommon.h"
#include "WebLocalizedString.h"
@@ -81,7 +83,16 @@ namespace WebKit {
// File ----------------------------------------------------------------
+ // Various file/directory related functions. These map 1:1 with
+ // functions in WebCore's FileSystem.h.
+ virtual bool fileExists(const WebString& path) = 0;
+ virtual bool deleteFile(const WebString& path) = 0;
+ virtual bool deleteEmptyDirectory(const WebString& path) = 0;
virtual bool getFileSize(const WebString& path, long long& result) = 0;
+ virtual bool getFileModificationTime(const WebString& path, time_t& result) = 0;
+ virtual WebString directoryName(const WebString& path) = 0;
+ virtual WebString pathByAppendingComponent(const WebString& path, const WebString& component) = 0;
+ virtual bool makeAllDirectories(const WebString& path) = 0;
// History -------------------------------------------------------------
@@ -95,6 +106,26 @@ namespace WebKit {
// hash must have been generated by calling VisitedLinkHash().
virtual bool isLinkVisited(unsigned long long linkHash) = 0;
+ // HTML5 DB ------------------------------------------------------------
+
+#if defined(OS_WIN)
+ typedef HANDLE FileType;
+#else
+ typedef int FileType;
+#endif
+
+ // Opens a database file
+ virtual FileType databaseOpenFile(const WebString& fileName, int desiredFlags) = 0;
+
+ // Deletes a database file and returns the error code
+ virtual bool databaseDeleteFile(const WebString& fileName) = 0;
+
+ // Returns the attributes of the given database file
+ virtual long databaseGetFileAttributes(const WebString& fileName) = 0;
+
+ // Returns the size of the given database file
+ virtual long long databaseGetFileSize(const WebString& fileName) = 0;
+
// Message Ports -------------------------------------------------------
@@ -145,6 +176,18 @@ namespace WebKit {
virtual WebString queryLocalizedString(WebLocalizedString::Name, int numericValue) = 0;
+ // Sandbox ------------------------------------------------------------
+
+ // In some browsers, a "sandbox" restricts what operations a program
+ // is allowed to preform. Such operations are typically abstracted out
+ // via this API, but sometimes (like in HTML 5 database opening) WebKit
+ // needs to behave differently based on whether it's restricted or not.
+ // In these cases (and these cases only) you can call this function.
+ // It's OK for this value to be conservitive (i.e. true even if the
+ // sandbox isn't active).
+ virtual bool sandboxEnabled() = 0;
+
+
// Sudden Termination --------------------------------------------------
// Disable/Enable sudden termination.
@@ -166,26 +209,6 @@ namespace WebKit {
// Callable from a background WebKit thread.
virtual void callOnMainThread(void (*func)()) = 0;
-
- // HTML5 DB ------------------------------------------------------------
-
-#if defined(OS_WIN)
-typedef HANDLE FileType;
-#else
-typedef int FileType;
-#endif
-
- // Opens a database file
- virtual FileType databaseOpenFile(const WebString& fileName, int desiredFlags) = 0;
-
- // Deletes a database file and returns the error code
- virtual bool databaseDeleteFile(const WebString& fileName) = 0;
-
- // Returns the attributes of the given database file
- virtual long databaseGetFileAttributes(const WebString& fileName) = 0;
-
- // Returns the size of the given database file
- virtual long long databaseGetFileSize(const WebString& fileName) = 0;
};
} // namespace WebKit
diff --git a/webkit/api/src/ChromiumBridge.cpp b/webkit/api/src/ChromiumBridge.cpp
index 53e6487..e48b4b7 100644
--- a/webkit/api/src/ChromiumBridge.cpp
+++ b/webkit/api/src/ChromiumBridge.cpp
@@ -152,20 +152,17 @@ void ChromiumBridge::prefetchDNS(const String& hostname)
bool ChromiumBridge::fileExists(const String& path)
{
- ASSERT_NOT_REACHED();
- return false;
+ return webKitClient()->fileExists(path);
}
bool ChromiumBridge::deleteFile(const String& path)
{
- ASSERT_NOT_REACHED();
- return false;
+ return webKitClient()->deleteFile(path);
}
bool ChromiumBridge::deleteEmptyDirectory(const String& path)
{
- ASSERT_NOT_REACHED();
- return false;
+ return webKitClient()->deleteEmptyDirectory(path);
}
bool ChromiumBridge::getFileSize(const String& path, long long& result)
@@ -175,26 +172,22 @@ bool ChromiumBridge::getFileSize(const String& path, long long& result)
bool ChromiumBridge::getFileModificationTime(const String& path, time_t& result)
{
- ASSERT_NOT_REACHED();
- return false;
+ return webKitClient()->getFileModificationTime(path, result);
}
String ChromiumBridge::directoryName(const String& path)
{
- ASSERT_NOT_REACHED();
- return String();
+ return webKitClient()->directoryName(path);
}
String ChromiumBridge::pathByAppendingComponent(const String& path, const String& component)
{
- ASSERT_NOT_REACHED();
- return String();
+ return webKitClient()->pathByAppendingComponent(path, component);
}
bool ChromiumBridge::makeAllDirectories(const String& path)
{
- ASSERT_NOT_REACHED();
- return false;
+ return webKitClient()->makeAllDirectories(path);
}
// Font -----------------------------------------------------------------------
@@ -220,6 +213,30 @@ String ChromiumBridge::getFontFamilyForCharacters(const UChar* characters, size_
}
#endif
+// HTML5 DB -------------------------------------------------------------------
+
+#if ENABLE(DATABASE)
+PlatformFileHandle ChromiumBridge::databaseOpenFile(const String& fileName, int desiredFlags)
+{
+ return webKitClient()->databaseOpenFile(WebString(fileName), desiredFlags);
+}
+
+bool ChromiumBridge::databaseDeleteFile(const String& fileName)
+{
+ return webKitClient()->databaseDeleteFile(WebString(fileName));
+}
+
+long ChromiumBridge::databaseGetFileAttributes(const String& fileName)
+{
+ return webKitClient()->databaseGetFileAttributes(WebString(fileName));
+}
+
+long long ChromiumBridge::databaseGetFileSize(const String& fileName)
+{
+ return webKitClient()->databaseGetFileSize(WebString(fileName));
+}
+#endif
+
// Language -------------------------------------------------------------------
String ChromiumBridge::computedDefaultLanguage()
@@ -295,7 +312,7 @@ PassRefPtr<Image> ChromiumBridge::loadPlatformImageResource(const char* name)
bool ChromiumBridge::sandboxEnabled()
{
- return true;
+ return webKitClient()->sandboxEnabled();
}
// SharedTimers ---------------------------------------------------------------
@@ -472,29 +489,4 @@ bool ChromiumBridge::isLinkVisited(WebCore::LinkHash visitedLinkHash)
return webKitClient()->isLinkVisited(visitedLinkHash);
}
-// HTML5 DB -------------------------------------------------------------------
-
-#if ENABLE(DATABASE)
-PlatformFileHandle ChromiumBridge::databaseOpenFile(const String& fileName,
- int desiredFlags)
-{
- return webKitClient()->databaseOpenFile(WebString(fileName), desiredFlags);
-}
-
-bool ChromiumBridge::databaseDeleteFile(const String& fileName)
-{
- return webKitClient()->databaseDeleteFile(WebString(fileName));
-}
-
-long ChromiumBridge::databaseGetFileAttributes(const String& fileName)
-{
- return webKitClient()->databaseGetFileAttributes(WebString(fileName));
-}
-
-long long ChromiumBridge::databaseGetFileSize(const String& fileName)
-{
- return webKitClient()->databaseGetFileSize(WebString(fileName));
-}
-#endif
-
} // namespace WebCore
diff --git a/webkit/api/src/WebKit.cpp b/webkit/api/src/WebKit.cpp
index 8fa42bb..93ddc72 100644
--- a/webkit/api/src/WebKit.cpp
+++ b/webkit/api/src/WebKit.cpp
@@ -38,6 +38,7 @@
#include "DOMTimer.h"
#include "FrameLoader.h"
#include "Page.h"
+#include "TextEncoding.h"
#include "V8Binding.h"
#include "V8Proxy.h"
#include "WorkerContextExecutionProxy.h"
@@ -65,6 +66,15 @@ void initialize(WebKitClient* webKitClient)
// 4ms prevents the CPU from spinning too busily and provides a balance
// between CPU spinning and the smallest possible interval timer.
WebCore::DOMTimer::setMinTimerInterval(0.004);
+
+ // There are some code paths (for example, running WebKit in the browser
+ // process and calling into LocalStorage before anything else) where the
+ // UTF8 string encoding tables are used on a background thread before
+ // they're set up. This is a problem because their set up routines assert
+ // they're running on the main WebKitThread. It might be possible to make
+ // the initialization thread-safe, but given that so many code paths use
+ // this, initializing this lazily probably doesn't buy us much.
+ WebCore::UTF8Encoding();
}
void shutdown()
diff --git a/webkit/glue/webkitclient_impl.cc b/webkit/glue/webkitclient_impl.cc
index 9a19bf5..7233a1f 100644
--- a/webkit/glue/webkitclient_impl.cc
+++ b/webkit/glue/webkitclient_impl.cc
@@ -4,6 +4,8 @@
#include "webkit/glue/webkitclient_impl.h"
+#include "base/file_path.h"
+#include "base/file_util.h"
#include "base/message_loop.h"
#include "base/platform_file.h"
#include "base/stats_counters.h"
@@ -227,23 +229,72 @@ void WebKitClientImpl::callOnMainThread(void (*func)()) {
}
base::PlatformFile WebKitClientImpl::databaseOpenFile(
- const WebKit::WebString& file_name, int desired_flags) {
+ const WebKit::WebString& file_name, int desired_flags) {
return base::kInvalidPlatformFileValue;
}
bool WebKitClientImpl::databaseDeleteFile(
- const WebKit::WebString& file_name) {
+ const WebKit::WebString& file_name) {
return false;
}
long WebKitClientImpl::databaseGetFileAttributes(
- const WebKit::WebString& file_name) {
+ const WebKit::WebString& file_name) {
return 0;
}
long long WebKitClientImpl::databaseGetFileSize(
- const WebKit::WebString& file_name) {
+ const WebKit::WebString& file_name) {
return 0;
}
+bool WebKitClientImpl::fileExists(const WebKit::WebString& path) {
+ NOTREACHED();
+ return false;
+}
+
+bool WebKitClientImpl::deleteFile(const WebKit::WebString& path) {
+ NOTREACHED();
+ return false;
+}
+
+bool WebKitClientImpl::deleteEmptyDirectory(const WebKit::WebString& path) {
+ NOTREACHED();
+ return false;
+}
+
+bool WebKitClientImpl::getFileSize(const WebKit::WebString& path,
+ long long& result) {
+ NOTREACHED();
+ return false;
+}
+
+bool WebKitClientImpl::getFileModificationTime(const WebKit::WebString& path,
+ time_t& result) {
+ NOTREACHED();
+ return false;
+}
+
+WebKit::WebString WebKitClientImpl::directoryName(
+ const WebKit::WebString& path) {
+ NOTREACHED();
+ return WebKit::WebString();
+}
+
+WebKit::WebString WebKitClientImpl::pathByAppendingComponent(
+ const WebKit::WebString& webkit_path,
+ const WebKit::WebString& webkit_component) {
+ FilePath path(webkit_glue::WebStringToFilePathString(webkit_path));
+ FilePath component(webkit_glue::WebStringToFilePathString(webkit_component));
+ FilePath combined_path = path.Append(component);
+ return webkit_glue::FilePathStringToWebString(combined_path.value());
+}
+
+bool WebKitClientImpl::makeAllDirectories(
+ const WebKit::WebString& path) {
+ DCHECK(!sandboxEnabled());
+ FilePath::StringType file_path = webkit_glue::WebStringToFilePathString(path);
+ return file_util::CreateDirectory(FilePath(file_path));
+}
+
} // namespace webkit_glue
diff --git a/webkit/glue/webkitclient_impl.h b/webkit/glue/webkitclient_impl.h
index e3035ae..8b6574e 100644
--- a/webkit/glue/webkitclient_impl.h
+++ b/webkit/glue/webkitclient_impl.h
@@ -41,11 +41,22 @@ class WebKitClientImpl : public WebKit::WebKitClient {
virtual void suddenTerminationChanged(bool enabled) { }
virtual base::PlatformFile databaseOpenFile(
- const WebKit::WebString& file_name, int desired_flags);
+ const WebKit::WebString& file_name, int desired_flags);
virtual bool databaseDeleteFile(const WebKit::WebString& file_name);
virtual long databaseGetFileAttributes(const WebKit::WebString& file_name);
virtual long long databaseGetFileSize(const WebKit::WebString& file_name);
+ virtual bool fileExists(const WebKit::WebString& path);
+ virtual bool deleteFile(const WebKit::WebString& path);
+ virtual bool deleteEmptyDirectory(const WebKit::WebString& path);
+ virtual bool getFileSize(const WebKit::WebString& path, long long& result);
+ virtual bool getFileModificationTime(const WebKit::WebString& path,
+ time_t& result);
+ virtual WebKit::WebString directoryName(const WebKit::WebString& path);
+ virtual WebKit::WebString pathByAppendingComponent(
+ const WebKit::WebString& path, const WebKit::WebString& component);
+ virtual bool makeAllDirectories(const WebKit::WebString& path);
+
private:
void DoTimeout() {
if (shared_timer_func_)
diff --git a/webkit/tools/test_shell/test_shell_webkit_init.h b/webkit/tools/test_shell/test_shell_webkit_init.h
index dbb8e81..6db295c 100644
--- a/webkit/tools/test_shell/test_shell_webkit_init.h
+++ b/webkit/tools/test_shell/test_shell_webkit_init.h
@@ -74,6 +74,10 @@ class TestShellWebKitInit : public webkit_glue::WebKitClientImpl {
return NULL;
}
+ virtual bool sandboxEnabled() {
+ return false;
+ }
+
virtual bool getFileSize(const WebKit::WebString& path, long long& result) {
return file_util::GetFileSize(
FilePath(webkit_glue::WebStringToFilePathString(path)),
diff --git a/webkit/tools/test_shell/test_worker/test_worker_main.cc b/webkit/tools/test_shell/test_worker/test_worker_main.cc
index 2739640..9a5912d 100644
--- a/webkit/tools/test_shell/test_worker/test_worker_main.cc
+++ b/webkit/tools/test_shell/test_worker/test_worker_main.cc
@@ -48,6 +48,10 @@ class WorkerWebKitClientImpl : public webkit_glue::WebKitClientImpl {
return NULL;
}
+ virtual bool sandboxEnabled() {
+ return true;
+ }
+
virtual unsigned long long visitedLinkHash(const char* canonicalURL,
size_t length) {
NOTREACHED();