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

Unified Diff: content/browser/shared_worker/shared_worker_host.cc

Issue 194183004: Implement AllowDatabase, AllowFileSystem, AllowIndexedDB in SharedWorkerHost. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 9 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
« no previous file with comments | « content/browser/shared_worker/shared_worker_host.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/shared_worker/shared_worker_host.cc
diff --git a/content/browser/shared_worker/shared_worker_host.cc b/content/browser/shared_worker/shared_worker_host.cc
index 9d926cd18dfded3271d78b58038edd373f6f9cdb..ac1d606a806913fbc301a0e201fc91f21cb5d09a 100644
--- a/content/browser/shared_worker/shared_worker_host.cc
+++ b/content/browser/shared_worker/shared_worker_host.cc
@@ -12,6 +12,8 @@
#include "content/common/view_messages.h"
#include "content/common/worker_messages.h"
#include "content/public/browser/browser_thread.h"
+#include "content/public/browser/content_browser_client.h"
+#include "content/public/common/content_client.h"
namespace content {
namespace {
@@ -167,21 +169,32 @@ void SharedWorkerHost::AllowDatabase(const GURL& url,
const base::string16& display_name,
unsigned long estimated_size,
bool* result) {
- // TODO(horo): implement this.
- NOTIMPLEMENTED();
+ if (!instance_)
+ return;
+ *result = GetContentClient()->browser()->AllowWorkerDatabase(
+ url,
+ name,
+ display_name,
+ estimated_size,
+ instance_->resource_context(),
+ GetRenderFrameIDsForWorker());
}
void SharedWorkerHost::AllowFileSystem(const GURL& url,
bool* result) {
- // TODO(horo): implement this.
- NOTIMPLEMENTED();
+ if (!instance_)
+ return;
+ *result = GetContentClient()->browser()->AllowWorkerFileSystem(
+ url, instance_->resource_context(), GetRenderFrameIDsForWorker());
}
void SharedWorkerHost::AllowIndexedDB(const GURL& url,
const base::string16& name,
bool* result) {
- // TODO(horo): implement this.
- NOTIMPLEMENTED();
+ if (!instance_)
+ return;
+ *result = GetContentClient()->browser()->AllowWorkerIndexedDB(
+ url, name, instance_->resource_context(), GetRenderFrameIDsForWorker());
}
void SharedWorkerHost::RelayMessage(
@@ -225,4 +238,21 @@ void SharedWorkerHost::TerminateWorker() {
Send(new WorkerMsg_TerminateWorkerContext(worker_route_id_));
}
+std::vector<std::pair<int, int> >
+SharedWorkerHost::GetRenderFrameIDsForWorker() {
+ std::vector<std::pair<int, int> > result;
+ if (!instance_)
+ return result;
+ const WorkerDocumentSet::DocumentInfoSet& documents =
+ instance_->worker_document_set()->documents();
+ for (WorkerDocumentSet::DocumentInfoSet::const_iterator doc =
+ documents.begin();
+ doc != documents.end();
+ ++doc) {
+ result.push_back(
+ std::make_pair(doc->render_process_id(), doc->render_frame_id()));
+ }
+ return result;
+}
+
} // namespace content
« no previous file with comments | « content/browser/shared_worker/shared_worker_host.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698