summaryrefslogtreecommitdiffstats
path: root/chrome/renderer
diff options
context:
space:
mode:
authorjorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-05 01:15:54 +0000
committerjorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-05 01:15:54 +0000
commit1f8b34120905d0cb89f8a35c2a9e38ee1747c878 (patch)
tree63687e8e964bacf3491ad111d4aad28fc17dad25 /chrome/renderer
parent97880fa256d45accb61d1c9887bb7e28724286cd (diff)
downloadchromium_src-1f8b34120905d0cb89f8a35c2a9e38ee1747c878.zip
chromium_src-1f8b34120905d0cb89f8a35c2a9e38ee1747c878.tar.gz
chromium_src-1f8b34120905d0cb89f8a35c2a9e38ee1747c878.tar.bz2
This CL is doing a bunch of Misc work to make LocalStorage data persist.
First of all, this allows WebKit clients to specify whether or not the VFS should be used. In the browser process, we never want it to be. Next, this allows WebKit clients to specify the behavior of WebKit's FileSystem code. By default, they should all be NOT_REACHED(). The browser process implements the two of these I need for LocalStorage, but it'll be really easy for the rest to be implemented as needed. Next, this adds a function that storage routines can call to ensure that lazily initialized stuff that must be initialized on the main WebKit thread is initialized. Right now, this is just used to initialize the UTF8 conversion tables, but I'm sure there'll be more overt time. Lastly, this uses the profile directory stored by webkit_context_ to derive the path LocalStorage should use. This CL also cleans up a few minor style issues as it goes. TEST=none BUG=4360 Review URL: http://codereview.chromium.org/159778 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22452 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer')
-rw-r--r--chrome/renderer/renderer_webkitclient_impl.cc11
-rw-r--r--chrome/renderer/renderer_webkitclient_impl.h1
2 files changed, 12 insertions, 0 deletions
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);