| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "web/WorkerContentSettingsClient.h" | 31 #include "web/WorkerContentSettingsClient.h" |
| 32 | 32 |
| 33 #include "core/workers/WorkerGlobalScope.h" | 33 #include "core/workers/WorkerGlobalScope.h" |
| 34 #include "public/platform/WebString.h" | 34 #include "public/platform/WebString.h" |
| 35 #include "public/web/WebWorkerContentSettingsClientProxy.h" | 35 #include "public/web/WebWorkerContentSettingsClientProxy.h" |
| 36 #include <memory> | 36 #include "wtf/PassOwnPtr.h" |
| 37 | 37 |
| 38 namespace blink { | 38 namespace blink { |
| 39 | 39 |
| 40 WorkerContentSettingsClient* WorkerContentSettingsClient::create(std::unique_ptr
<WebWorkerContentSettingsClientProxy> proxy) | 40 WorkerContentSettingsClient* WorkerContentSettingsClient::create(PassOwnPtr<WebW
orkerContentSettingsClientProxy> proxy) |
| 41 { | 41 { |
| 42 return new WorkerContentSettingsClient(std::move(proxy)); | 42 return new WorkerContentSettingsClient(std::move(proxy)); |
| 43 } | 43 } |
| 44 | 44 |
| 45 WorkerContentSettingsClient::~WorkerContentSettingsClient() | 45 WorkerContentSettingsClient::~WorkerContentSettingsClient() |
| 46 { | 46 { |
| 47 } | 47 } |
| 48 | 48 |
| 49 bool WorkerContentSettingsClient::requestFileSystemAccessSync() | 49 bool WorkerContentSettingsClient::requestFileSystemAccessSync() |
| 50 { | 50 { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 65 return "WorkerContentSettingsClient"; | 65 return "WorkerContentSettingsClient"; |
| 66 } | 66 } |
| 67 | 67 |
| 68 WorkerContentSettingsClient* WorkerContentSettingsClient::from(ExecutionContext&
context) | 68 WorkerContentSettingsClient* WorkerContentSettingsClient::from(ExecutionContext&
context) |
| 69 { | 69 { |
| 70 WorkerClients* clients = toWorkerGlobalScope(context).clients(); | 70 WorkerClients* clients = toWorkerGlobalScope(context).clients(); |
| 71 DCHECK(clients); | 71 DCHECK(clients); |
| 72 return static_cast<WorkerContentSettingsClient*>(Supplement<WorkerClients>::
from(*clients, supplementName())); | 72 return static_cast<WorkerContentSettingsClient*>(Supplement<WorkerClients>::
from(*clients, supplementName())); |
| 73 } | 73 } |
| 74 | 74 |
| 75 WorkerContentSettingsClient::WorkerContentSettingsClient(std::unique_ptr<WebWork
erContentSettingsClientProxy> proxy) | 75 WorkerContentSettingsClient::WorkerContentSettingsClient(PassOwnPtr<WebWorkerCon
tentSettingsClientProxy> proxy) |
| 76 : m_proxy(std::move(proxy)) | 76 : m_proxy(std::move(proxy)) |
| 77 { | 77 { |
| 78 } | 78 } |
| 79 | 79 |
| 80 void provideContentSettingsClientToWorker(WorkerClients* clients, std::unique_pt
r<WebWorkerContentSettingsClientProxy> proxy) | 80 void provideContentSettingsClientToWorker(WorkerClients* clients, PassOwnPtr<Web
WorkerContentSettingsClientProxy> proxy) |
| 81 { | 81 { |
| 82 DCHECK(clients); | 82 DCHECK(clients); |
| 83 WorkerContentSettingsClient::provideTo(*clients, WorkerContentSettingsClient
::supplementName(), WorkerContentSettingsClient::create(std::move(proxy))); | 83 WorkerContentSettingsClient::provideTo(*clients, WorkerContentSettingsClient
::supplementName(), WorkerContentSettingsClient::create(std::move(proxy))); |
| 84 } | 84 } |
| 85 | 85 |
| 86 } // namespace blink | 86 } // namespace blink |
| OLD | NEW |