Chromium Code Reviews| Index: content/browser/worker_host/worker_process_host.cc |
| diff --git a/content/browser/worker_host/worker_process_host.cc b/content/browser/worker_host/worker_process_host.cc |
| index 81645f66732281828328e43019b12793bc435751..fbcb41abdd15d6f951d6310cb0c5502267271456 100644 |
| --- a/content/browser/worker_host/worker_process_host.cc |
| +++ b/content/browser/worker_host/worker_process_host.cc |
| @@ -386,8 +386,9 @@ bool WorkerProcessHost::OnMessageReceived(const IPC::Message& message) { |
| IPC_MESSAGE_HANDLER(WorkerHostMsg_WorkerConnected, |
| OnWorkerConnected) |
| IPC_MESSAGE_HANDLER(WorkerProcessHostMsg_AllowDatabase, OnAllowDatabase) |
| - IPC_MESSAGE_HANDLER(WorkerProcessHostMsg_RequestFileSystemAccessSync, |
| - OnRequestFileSystemAccessSync) |
| + IPC_MESSAGE_HANDLER_DELAY_REPLY( |
| + WorkerProcessHostMsg_RequestFileSystemAccessSync, |
| + OnRequestFileSystemAccessSync) |
| IPC_MESSAGE_HANDLER(WorkerProcessHostMsg_AllowIndexedDB, OnAllowIndexedDB) |
| IPC_MESSAGE_HANDLER(WorkerProcessHostMsg_ForceKillWorker, |
| OnForceKillWorkerProcess) |
| @@ -475,9 +476,22 @@ void WorkerProcessHost::OnAllowDatabase(int worker_route_id, |
| void WorkerProcessHost::OnRequestFileSystemAccessSync(int worker_route_id, |
| const GURL& url, |
| - bool* result) { |
| - *result = GetContentClient()->browser()->AllowWorkerFileSystem( |
| - url, resource_context_, GetRenderFrameIDsForWorker(worker_route_id)); |
| + IPC::Message* reply_msg) { |
| + GetContentClient()->browser()->RequestWorkerFileSystemAccessSync( |
| + url, |
| + resource_context_, |
| + GetRenderFrameIDsForWorker(worker_route_id), |
| + base::Bind(&WorkerProcessHost::OnRequestFileSystemAccessSyncResponse, |
| + base::Unretained(this), |
|
jam
2014/06/23 07:02:00
what's the guarantee that the embedder will call t
Xi Han
2014/06/23 20:43:34
Done.
|
| + reply_msg)); |
| +} |
| + |
| +void WorkerProcessHost::OnRequestFileSystemAccessSyncResponse( |
| + IPC::Message* reply_msg, |
| + bool allowed) { |
| + WorkerProcessHostMsg_RequestFileSystemAccessSync::WriteReplyParams(reply_msg, |
| + allowed); |
| + Send(reply_msg); |
| } |
| void WorkerProcessHost::OnAllowIndexedDB(int worker_route_id, |