summaryrefslogtreecommitdiffstats
path: root/chrome/renderer
diff options
context:
space:
mode:
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);