OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 return static_cast<Document*>(scriptExecutionContext()); | 87 return static_cast<Document*>(scriptExecutionContext()); |
88 } | 88 } |
89 | 89 |
90 void Worker::postMessage(const String& message) | 90 void Worker::postMessage(const String& message) |
91 { | 91 { |
92 m_messagingProxy->postMessageToWorkerContext(message); | 92 m_messagingProxy->postMessageToWorkerContext(message); |
93 } | 93 } |
94 | 94 |
95 void Worker::terminate() | 95 void Worker::terminate() |
96 { | 96 { |
97 m_messagingProxy->terminate(); | 97 m_messagingProxy->terminateWorkerContext(); |
98 } | 98 } |
99 | 99 |
100 bool Worker::canSuspend() const | 100 bool Worker::canSuspend() const |
101 { | 101 { |
102 // FIXME: It is not currently possible to suspend a worker, so pages with wo
rkers can not go into page cache. | 102 // FIXME: It is not currently possible to suspend a worker, so pages with wo
rkers can not go into page cache. |
103 return false; | 103 return false; |
104 } | 104 } |
105 | 105 |
106 void Worker::stop() | 106 void Worker::stop() |
107 { | 107 { |
108 terminate(); | 108 terminate(); |
109 } | 109 } |
110 | 110 |
111 bool Worker::hasPendingActivity() const | 111 bool Worker::hasPendingActivity() const |
112 { | 112 { |
113 return m_messagingProxy->workerThreadHasPendingActivity() || ActiveDOMObject
::hasPendingActivity(); | 113 return m_messagingProxy->hasPendingActivity() || ActiveDOMObject::hasPending
Activity(); |
114 } | 114 } |
115 | 115 |
116 void Worker::notifyFinished(CachedResource* unusedResource) | 116 void Worker::notifyFinished(CachedResource* unusedResource) |
117 { | 117 { |
118 ASSERT_UNUSED(unusedResource, unusedResource == m_cachedScript); | 118 ASSERT_UNUSED(unusedResource, unusedResource == m_cachedScript); |
119 | 119 |
120 if (m_cachedScript->errorOccurred()) | 120 if (m_cachedScript->errorOccurred()) |
121 dispatchErrorEvent(); | 121 dispatchErrorEvent(); |
122 else { | 122 else { |
123 String userAgent = document()->frame() ? document()->frame()->loader()->
userAgent(m_scriptURL) : String(); | 123 String userAgent = document()->frame() ? document()->frame()->loader()->
userAgent(m_scriptURL) : String(); |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 } | 195 } |
196 | 196 |
197 return !event->defaultPrevented(); | 197 return !event->defaultPrevented(); |
198 } | 198 } |
199 | 199 |
200 } // namespace WebCore | 200 } // namespace WebCore |
201 | 201 |
202 #endif // ENABLE(WORKERS) | 202 #endif // ENABLE(WORKERS) |
203 | 203 |
204 | 204 |
OLD | NEW |