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

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

Issue 338353007: Implementation of shared worker code path for WebView file system permission. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master_sharedworker
Patch Set: Small changes are made. Created 6 years, 5 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/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 9fc9d67ec3af8af663c2b3d2ec769767fb18c384..844f60b2734b8418dc248505ac4e298f847db282 100644
--- a/content/browser/shared_worker/shared_worker_host.cc
+++ b/content/browser/shared_worker/shared_worker_host.cc
@@ -63,6 +63,7 @@ SharedWorkerHost::SharedWorkerHost(SharedWorkerInstance* instance,
int worker_route_id)
: instance_(instance),
worker_document_set_(new WorkerDocumentSet()),
+ weak_factory_(this),
container_render_filter_(filter),
worker_process_id_(filter->render_process_id()),
worker_route_id_(worker_route_id),
@@ -221,11 +222,25 @@ void SharedWorkerHost::AllowDatabase(const GURL& url,
}
void SharedWorkerHost::AllowFileSystem(const GURL& url,
- bool* result) {
+ scoped_ptr<IPC::Message> reply_msg) {
if (!instance_)
return;
- *result = GetContentClient()->browser()->AllowWorkerFileSystem(
- url, instance_->resource_context(), GetRenderFrameIDsForWorker());
+ GetContentClient()->browser()->AllowWorkerFileSystem(
+ url,
+ instance_->resource_context(),
+ GetRenderFrameIDsForWorker(),
+ base::Bind(&SharedWorkerHost::AllowFileSystemResponse,
+ weak_factory_.GetWeakPtr(),
+ base::Passed(&reply_msg)));
+}
+
+void SharedWorkerHost::AllowFileSystemResponse(
+ scoped_ptr<IPC::Message> reply_msg,
+ bool allowed) {
+ WorkerProcessHostMsg_RequestFileSystemAccessSync::WriteReplyParams(
+ reply_msg.get(),
+ allowed);
+ Send(reply_msg.release());
}
void SharedWorkerHost::AllowIndexedDB(const GURL& url,
« no previous file with comments | « content/browser/shared_worker/shared_worker_host.h ('k') | content/browser/shared_worker/shared_worker_message_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698