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 29 matching lines...) Expand all Loading... |
40 #include "GenericWorkerTask.h" | 40 #include "GenericWorkerTask.h" |
41 #include "MessageEvent.h" | 41 #include "MessageEvent.h" |
42 #include "MessagePort.h" | 42 #include "MessagePort.h" |
43 #include "MessagePortChannel.h" | 43 #include "MessagePortChannel.h" |
44 #include "ScriptExecutionContext.h" | 44 #include "ScriptExecutionContext.h" |
45 #include "Worker.h" | 45 #include "Worker.h" |
46 #include "WorkerContext.h" | 46 #include "WorkerContext.h" |
47 #include "WorkerContextExecutionProxy.h" | 47 #include "WorkerContextExecutionProxy.h" |
48 #include "WorkerMessagingProxy.h" | 48 #include "WorkerMessagingProxy.h" |
49 #include <wtf/Threading.h> | 49 #include <wtf/Threading.h> |
50 #undef LOG | |
51 | 50 |
| 51 #include "FrameLoaderClientImpl.h" |
52 #include "PlatformMessagePortChannel.h" | 52 #include "PlatformMessagePortChannel.h" |
53 #include "WebFrameClient.h" | 53 #include "WebFrameClient.h" |
| 54 #include "WebFrameImpl.h" |
54 #include "WebKit.h" | 55 #include "WebKit.h" |
55 #include "WebKitClient.h" | 56 #include "WebKitClient.h" |
56 #include "WebMessagePortChannel.h" | 57 #include "WebMessagePortChannel.h" |
57 #include "WebString.h" | 58 #include "WebString.h" |
58 #include "WebURL.h" | 59 #include "WebURL.h" |
| 60 #include "WebViewImpl.h" |
59 #include "WebWorker.h" | 61 #include "WebWorker.h" |
60 #include "WebWorkerImpl.h" | 62 #include "WebWorkerImpl.h" |
61 // FIXME: remove the includes below | |
62 #include "webkit/glue/webframeloaderclient_impl.h" | |
63 #include "webkit/glue/webframe_impl.h" | |
64 #include "webkit/glue/webview_impl.h" | |
65 | 63 |
66 using namespace WebCore; | 64 using namespace WebCore; |
67 | 65 |
68 namespace WebKit { | 66 namespace WebKit { |
69 | 67 |
70 // When WebKit creates a WorkerContextProxy object, we check if we're in the | 68 // When WebKit creates a WorkerContextProxy object, we check if we're in the |
71 // renderer or worker process. If the latter, then we just use | 69 // renderer or worker process. If the latter, then we just use |
72 // WorkerMessagingProxy. | 70 // WorkerMessagingProxy. |
73 // | 71 // |
74 // If we're in the renderer process, then we need use the glue provided | 72 // If we're in the renderer process, then we need use the glue provided |
(...skipping 11 matching lines...) Expand all Loading... |
86 // FIXME: v8 doesn't support more than one workers per process. | 84 // FIXME: v8 doesn't support more than one workers per process. |
87 // if (!worker->scriptExecutionContext()->isDocument()) | 85 // if (!worker->scriptExecutionContext()->isDocument()) |
88 // return new WorkerMessagingProxy(worker); | 86 // return new WorkerMessagingProxy(worker); |
89 | 87 |
90 WebWorker* webWorker = 0; | 88 WebWorker* webWorker = 0; |
91 WebWorkerClientImpl* proxy = new WebWorkerClientImpl(worker); | 89 WebWorkerClientImpl* proxy = new WebWorkerClientImpl(worker); |
92 | 90 |
93 if (worker->scriptExecutionContext()->isDocument()) { | 91 if (worker->scriptExecutionContext()->isDocument()) { |
94 Document* document = static_cast<Document*>( | 92 Document* document = static_cast<Document*>( |
95 worker->scriptExecutionContext()); | 93 worker->scriptExecutionContext()); |
96 WebFrameImpl* webFrame = WebFrameImpl::FromFrame(document->frame()); | 94 WebFrameImpl* webFrame = WebFrameImpl::fromFrame(document->frame()); |
97 webWorker = webFrame->client()->createWorker(webFrame, proxy); | 95 webWorker = webFrame->client()->createWorker(webFrame, proxy); |
98 } else { | 96 } else { |
99 WorkerContextExecutionProxy* currentContext = | 97 WorkerContextExecutionProxy* currentContext = |
100 WorkerContextExecutionProxy::retrieve(); | 98 WorkerContextExecutionProxy::retrieve(); |
101 if (!currentContext) { | 99 if (!currentContext) { |
102 ASSERT_NOT_REACHED(); | 100 ASSERT_NOT_REACHED(); |
103 return 0; | 101 return 0; |
104 } | 102 } |
105 | 103 |
106 DedicatedWorkerThread* thread = | 104 DedicatedWorkerThread* thread = |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 void WebWorkerClientImpl::reportPendingActivityTask(ScriptExecutionContext* context, | 403 void WebWorkerClientImpl::reportPendingActivityTask(ScriptExecutionContext* context, |
406 WebWorkerClientImpl* thisPtr, | 404 WebWorkerClientImpl* thisPtr, |
407 bool hasPendingActivity) | 405 bool hasPendingActivity) |
408 { | 406 { |
409 thisPtr->m_workerContextHadPendingActivity = hasPendingActivity; | 407 thisPtr->m_workerContextHadPendingActivity = hasPendingActivity; |
410 } | 408 } |
411 | 409 |
412 } // namespace WebKit | 410 } // namespace WebKit |
413 | 411 |
414 #endif | 412 #endif |
OLD | NEW |