Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Unified Diff: content/worker/websharedworkerclient_proxy.cc

Issue 46583005: Send Allow{Database,FileSystem,IndexedDB} sync IPCs directly from worker thread (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/worker/websharedworkerclient_proxy.cc
diff --git a/content/worker/websharedworkerclient_proxy.cc b/content/worker/websharedworkerclient_proxy.cc
index 21182b00e3f3583d969770ff6caa5ec59bf010a3..d948f01a283189572b162c69dfc0568095d007c1 100644
--- a/content/worker/websharedworkerclient_proxy.cc
+++ b/content/worker/websharedworkerclient_proxy.cc
@@ -12,6 +12,7 @@
#include "content/public/common/content_switches.h"
#include "content/worker/shared_worker_devtools_agent.h"
#include "content/worker/websharedworker_stub.h"
+#include "content/worker/worker_permission_client_proxy.h"
#include "content/worker/worker_thread.h"
#include "content/worker/worker_webapplicationcachehost_impl.h"
#include "ipc/ipc_logging.h"
@@ -77,36 +78,30 @@ WebApplicationCacheHost* WebSharedWorkerClientProxy::createApplicationCacheHost(
return host;
}
-// TODO(abarth): Security checks should use WebDocument or WebSecurityOrigin,
-// not WebFrame as the context object because WebFrames can contain different
-// WebDocuments at different times.
+WebKit::WebWorkerPermissionClientProxy*
+WebSharedWorkerClientProxy::createWorkerPermissionClientProxy(
+ const WebKit::WebSecurityOrigin& origin) {
+ if (origin.isUnique())
+ return NULL;
+ return new WorkerPermissionClientProxy(
+ GURL(origin.toString()), route_id_,
+ ChildThread::current()->thread_safe_sender());
+}
+
+// TODO(kinuko): Deprecate these methods.
bool WebSharedWorkerClientProxy::allowDatabase(WebFrame* frame,
const WebString& name,
const WebString& display_name,
unsigned long estimated_size) {
- WebSecurityOrigin origin = frame->document().securityOrigin();
- if (origin.isUnique())
- return false;
-
- bool result = false;
- Send(new WorkerProcessHostMsg_AllowDatabase(
- route_id_, GURL(origin.toString().utf8()), name, display_name,
- estimated_size, &result));
- return result;
+ return false;
}
bool WebSharedWorkerClientProxy::allowFileSystem() {
- bool result = false;
- Send(new WorkerProcessHostMsg_AllowFileSystem(
- route_id_, stub_->url().GetOrigin(), &result));
- return result;
+ return false;
}
bool WebSharedWorkerClientProxy::allowIndexedDB(const WebKit::WebString& name) {
- bool result = false;
- Send(new WorkerProcessHostMsg_AllowIndexedDB(
- route_id_, stub_->url().GetOrigin(), name, &result));
- return result;
+ return false;
}
void WebSharedWorkerClientProxy::dispatchDevToolsMessage(

Powered by Google App Engine
This is Rietveld 408576698