OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/shared_worker/shared_worker_host.h" | 5 #include "content/browser/shared_worker/shared_worker_host.h" |
6 | 6 |
7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
8 #include "content/browser/devtools/embedded_worker_devtools_manager.h" | 8 #include "content/browser/devtools/embedded_worker_devtools_manager.h" |
9 #include "content/browser/frame_host/render_frame_host_delegate.h" | 9 #include "content/browser/frame_host/render_frame_host_delegate.h" |
10 #include "content/browser/frame_host/render_frame_host_impl.h" | 10 #include "content/browser/frame_host/render_frame_host_impl.h" |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 return; | 213 return; |
214 *result = GetContentClient()->browser()->AllowWorkerDatabase( | 214 *result = GetContentClient()->browser()->AllowWorkerDatabase( |
215 url, | 215 url, |
216 name, | 216 name, |
217 display_name, | 217 display_name, |
218 estimated_size, | 218 estimated_size, |
219 instance_->resource_context(), | 219 instance_->resource_context(), |
220 GetRenderFrameIDsForWorker()); | 220 GetRenderFrameIDsForWorker()); |
221 } | 221 } |
222 | 222 |
223 void SharedWorkerHost::AllowFileSystem(const GURL& url, | 223 void SharedWorkerHost::RequestFileSystemAccessSync(const GURL& url, |
224 bool* result) { | 224 IPC::Message* reply_msg) { |
225 if (!instance_) | 225 if (!instance_) |
226 return; | 226 return; |
227 *result = GetContentClient()->browser()->AllowWorkerFileSystem( | 227 GetContentClient()->browser()->RequestWorkerFileSystemAccessSync( |
228 url, instance_->resource_context(), GetRenderFrameIDsForWorker()); | 228 url, |
| 229 instance_->resource_context(), |
| 230 GetRenderFrameIDsForWorker(), |
| 231 base::Bind(&SharedWorkerHost::RequestFileSystemAccessSyncResponse, |
| 232 base::Unretained(this), |
| 233 reply_msg)); |
| 234 } |
| 235 |
| 236 void SharedWorkerHost::RequestFileSystemAccessSyncResponse( |
| 237 IPC::Message* reply_msg, |
| 238 bool allowed) { |
| 239 WorkerProcessHostMsg_RequestFileSystemAccessSync::WriteReplyParams(reply_msg, |
| 240 allowed); |
| 241 Send(reply_msg); |
229 } | 242 } |
230 | 243 |
231 void SharedWorkerHost::AllowIndexedDB(const GURL& url, | 244 void SharedWorkerHost::AllowIndexedDB(const GURL& url, |
232 const base::string16& name, | 245 const base::string16& name, |
233 bool* result) { | 246 bool* result) { |
234 if (!instance_) | 247 if (!instance_) |
235 return; | 248 return; |
236 *result = GetContentClient()->browser()->AllowWorkerIndexedDB( | 249 *result = GetContentClient()->browser()->AllowWorkerIndexedDB( |
237 url, name, instance_->resource_context(), GetRenderFrameIDsForWorker()); | 250 url, name, instance_->resource_context(), GetRenderFrameIDsForWorker()); |
238 } | 251 } |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 int message_port_id) { | 340 int message_port_id) { |
328 for (FilterList::iterator i = filters_.begin(); i != filters_.end(); ++i) { | 341 for (FilterList::iterator i = filters_.begin(); i != filters_.end(); ++i) { |
329 if (i->filter() == filter && i->route_id() == route_id) { | 342 if (i->filter() == filter && i->route_id() == route_id) { |
330 i->set_message_port_id(message_port_id); | 343 i->set_message_port_id(message_port_id); |
331 return; | 344 return; |
332 } | 345 } |
333 } | 346 } |
334 } | 347 } |
335 | 348 |
336 } // namespace content | 349 } // namespace content |
OLD | NEW |