OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 26 matching lines...) Expand all Loading... |
37 #include "core/workers/Worker.h" | 37 #include "core/workers/Worker.h" |
38 #include "core/workers/WorkerClients.h" | 38 #include "core/workers/WorkerClients.h" |
39 #include "core/workers/WorkerMessagingProxy.h" | 39 #include "core/workers/WorkerMessagingProxy.h" |
40 #include "wtf/OwnPtr.h" | 40 #include "wtf/OwnPtr.h" |
41 #include "wtf/Threading.h" | 41 #include "wtf/Threading.h" |
42 | 42 |
43 #include "WebFrameImpl.h" | 43 #include "WebFrameImpl.h" |
44 #include "WebPermissionClient.h" | 44 #include "WebPermissionClient.h" |
45 #include "WebViewImpl.h" | 45 #include "WebViewImpl.h" |
46 #include "WorkerFileSystemClient.h" | 46 #include "WorkerFileSystemClient.h" |
| 47 #include "WorkerPermissionClient.h" |
47 #include "public/platform/WebString.h" | 48 #include "public/platform/WebString.h" |
| 49 #include "public/web/WebFrameClient.h" |
48 #include "public/web/WebSecurityOrigin.h" | 50 #include "public/web/WebSecurityOrigin.h" |
| 51 #include "public/web/WebWorkerPermissionClientProxy.h" |
49 | 52 |
50 using namespace WebCore; | 53 using namespace WebCore; |
51 | 54 |
52 namespace WebKit { | 55 namespace WebKit { |
53 | 56 |
54 // Chromium-specific decorator of WorkerMessagingProxy. | 57 // Chromium-specific decorator of WorkerMessagingProxy. |
55 | 58 |
56 // static | 59 // static |
57 WorkerGlobalScopeProxy* WebWorkerClientImpl::createWorkerGlobalScopeProxy(Worker
* worker) | 60 WorkerGlobalScopeProxy* WebWorkerClientImpl::createWorkerGlobalScopeProxy(Worker
* worker) |
58 { | 61 { |
59 if (worker->executionContext()->isDocument()) { | 62 if (worker->executionContext()->isDocument()) { |
60 Document* document = toDocument(worker->executionContext()); | 63 Document* document = toDocument(worker->executionContext()); |
61 WebFrameImpl* webFrame = WebFrameImpl::fromFrame(document->frame()); | 64 WebFrameImpl* webFrame = WebFrameImpl::fromFrame(document->frame()); |
62 OwnPtr<WorkerClients> workerClients = WorkerClients::create(); | 65 OwnPtr<WorkerClients> workerClients = WorkerClients::create(); |
63 provideLocalFileSystemToWorker(workerClients.get(), WorkerFileSystemClie
nt::create()); | 66 provideLocalFileSystemToWorker(workerClients.get(), WorkerFileSystemClie
nt::create()); |
| 67 providePermissionClientToWorker(workerClients.get(), adoptPtr(webFrame->
client()->createWorkerPermissionClientProxy(webFrame))); |
64 WebWorkerClientImpl* proxy = new WebWorkerClientImpl(worker, webFrame, w
orkerClients.release()); | 68 WebWorkerClientImpl* proxy = new WebWorkerClientImpl(worker, webFrame, w
orkerClients.release()); |
65 return proxy; | 69 return proxy; |
66 } | 70 } |
67 ASSERT_NOT_REACHED(); | 71 ASSERT_NOT_REACHED(); |
68 return 0; | 72 return 0; |
69 } | 73 } |
70 | 74 |
71 void WebWorkerClientImpl::terminateWorkerGlobalScope() | 75 void WebWorkerClientImpl::terminateWorkerGlobalScope() |
72 { | 76 { |
73 m_webFrame = 0; | 77 m_webFrame = 0; |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 : WebCore::WorkerMessagingProxy(worker, workerClients) | 124 : WebCore::WorkerMessagingProxy(worker, workerClients) |
121 , m_webFrame(webFrame) | 125 , m_webFrame(webFrame) |
122 { | 126 { |
123 } | 127 } |
124 | 128 |
125 WebWorkerClientImpl::~WebWorkerClientImpl() | 129 WebWorkerClientImpl::~WebWorkerClientImpl() |
126 { | 130 { |
127 } | 131 } |
128 | 132 |
129 } // namespace WebKit | 133 } // namespace WebKit |
OLD | NEW |