diff options
author | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-25 08:51:59 +0000 |
---|---|---|
committer | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-25 08:51:59 +0000 |
commit | f215b6947acb9d8ab9475b240187ccb1f31cfc3f (patch) | |
tree | 0991ac5937891c99316530ef9975721417c13a4a /chrome/worker | |
parent | 827d9876324c94e889fe7caffda7d32cb4b62f1f (diff) | |
download | chromium_src-f215b6947acb9d8ab9475b240187ccb1f31cfc3f.zip chromium_src-f215b6947acb9d8ab9475b240187ccb1f31cfc3f.tar.gz chromium_src-f215b6947acb9d8ab9475b240187ccb1f31cfc3f.tar.bz2 |
Check content settings when accessing web databases from workers.
BUG=40095
TEST=none
Review URL: http://codereview.chromium.org/3053007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@67395 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/worker')
-rw-r--r-- | chrome/worker/webworkerclient_proxy.cc | 21 | ||||
-rw-r--r-- | chrome/worker/webworkerclient_proxy.h | 6 |
2 files changed, 22 insertions, 5 deletions
diff --git a/chrome/worker/webworkerclient_proxy.cc b/chrome/worker/webworkerclient_proxy.cc index 9b56725..6df7341 100644 --- a/chrome/worker/webworkerclient_proxy.cc +++ b/chrome/worker/webworkerclient_proxy.cc @@ -17,13 +17,17 @@ #include "chrome/worker/worker_webapplicationcachehost_impl.h" #include "ipc/ipc_logging.h" #include "third_party/WebKit/WebKit/chromium/public/WebFileSystemCallbacks.h" +#include "third_party/WebKit/WebKit/chromium/public/WebFrame.h" +#include "third_party/WebKit/WebKit/chromium/public/WebSecurityOrigin.h" #include "third_party/WebKit/WebKit/chromium/public/WebString.h" #include "third_party/WebKit/WebKit/chromium/public/WebURL.h" #include "third_party/WebKit/WebKit/chromium/public/WebWorker.h" using WebKit::WebApplicationCacheHost; +using WebKit::WebFrame; using WebKit::WebMessagePortChannel; using WebKit::WebMessagePortChannelArray; +using WebKit::WebSecurityOrigin; using WebKit::WebString; using WebKit::WebWorker; using WebKit::WebWorkerClient; @@ -124,6 +128,23 @@ WebApplicationCacheHost* WebWorkerClientProxy::createApplicationCacheHost( return host; } +bool WebWorkerClientProxy::allowDatabase(WebFrame* frame, + const WebString& name, + const WebString& display_name, + unsigned long estimated_size) { + WebSecurityOrigin origin = frame->securityOrigin(); + if (origin.isEmpty()) + return false; + + bool result; + if (!Send(new WorkerProcessHostMsg_AllowDatabase(route_id_, + GURL(origin.toString().utf8()), name, display_name, estimated_size, + &result))) + return false; + + return result; +} + void WebWorkerClientProxy::openFileSystem( WebKit::WebFileSystem::Type type, long long size, diff --git a/chrome/worker/webworkerclient_proxy.h b/chrome/worker/webworkerclient_proxy.h index 8b19688..53f8c67 100644 --- a/chrome/worker/webworkerclient_proxy.h +++ b/chrome/worker/webworkerclient_proxy.h @@ -77,11 +77,7 @@ class WebWorkerClientProxy : public WebKit::WebWorkerClient { virtual bool allowDatabase(WebKit::WebFrame* frame, const WebKit::WebString& name, const WebKit::WebString& display_name, - unsigned long estimated_size) { - // TODO(jochen): Check content settings whether access to web databases is - // allowed. - return true; - } + unsigned long estimated_size); virtual void openFileSystem(WebKit::WebFileSystem::Type type, long long size, |