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

Unified Diff: content/worker/shared_worker_permission_client_proxy.cc

Issue 55433006: Explicitly reject storage access if requesting security origin is unique (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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/shared_worker_permission_client_proxy.cc
diff --git a/content/worker/shared_worker_permission_client_proxy.cc b/content/worker/shared_worker_permission_client_proxy.cc
index dae30ffdab64b556ce62853f53455534550c6fe5..eb5c1d5a3ebf99ac5152ddebb5d2418a6a9281a0 100644
--- a/content/worker/shared_worker_permission_client_proxy.cc
+++ b/content/worker/shared_worker_permission_client_proxy.cc
@@ -13,9 +13,11 @@ namespace content {
SharedWorkerPermissionClientProxy::SharedWorkerPermissionClientProxy(
const GURL& origin_url,
+ bool is_unique_origin,
int routing_id,
ThreadSafeSender* thread_safe_sender)
: origin_url_(origin_url),
+ is_unique_origin_(is_unique_origin),
routing_id_(routing_id),
thread_safe_sender_(thread_safe_sender) {
}
@@ -27,6 +29,8 @@ bool SharedWorkerPermissionClientProxy::allowDatabase(
const WebKit::WebString& name,
const WebKit::WebString& display_name,
unsigned long estimated_size) {
+ if (is_unique_origin_)
+ return false;
bool result = false;
thread_safe_sender_->Send(new WorkerProcessHostMsg_AllowDatabase(
routing_id_, origin_url_, name, display_name,
@@ -35,6 +39,8 @@ bool SharedWorkerPermissionClientProxy::allowDatabase(
}
bool SharedWorkerPermissionClientProxy::allowFileSystem() {
+ if (is_unique_origin_)
+ return false;
bool result = false;
thread_safe_sender_->Send(new WorkerProcessHostMsg_AllowFileSystem(
routing_id_, origin_url_, &result));
@@ -43,6 +49,8 @@ bool SharedWorkerPermissionClientProxy::allowFileSystem() {
bool SharedWorkerPermissionClientProxy::allowIndexedDB(
const WebKit::WebString& name) {
+ if (is_unique_origin_)
+ return false;
bool result = false;
thread_safe_sender_->Send(new WorkerProcessHostMsg_AllowIndexedDB(
routing_id_, origin_url_, name, &result));

Powered by Google App Engine
This is Rietveld 408576698