| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
| 3 * Copyright (C) 2009 Google Inc. All Rights Reserved. | 3 * Copyright (C) 2009 Google Inc. All Rights Reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 // FIXME: This need to be revisited when we support nested worker one day | 115 // FIXME: This need to be revisited when we support nested worker one day |
| 116 ASSERT(m_executionContext->isDocument()); | 116 ASSERT(m_executionContext->isDocument()); |
| 117 if (m_askedToTerminate) { | 117 if (m_askedToTerminate) { |
| 118 // Worker.terminate() could be called from JS before the thread was crea
ted. | 118 // Worker.terminate() could be called from JS before the thread was crea
ted. |
| 119 return; | 119 return; |
| 120 } | 120 } |
| 121 Document* document = toDocument(m_executionContext.get()); | 121 Document* document = toDocument(m_executionContext.get()); |
| 122 SecurityOrigin* starterOrigin = document->securityOrigin(); | 122 SecurityOrigin* starterOrigin = document->securityOrigin(); |
| 123 | 123 |
| 124 OwnPtrWillBeRawPtr<WorkerThreadStartupData> startupData = WorkerThreadStartu
pData::create(scriptURL, userAgent, sourceCode, nullptr, startMode, document->co
ntentSecurityPolicy()->deprecatedHeader(), document->contentSecurityPolicy()->de
precatedHeaderType(), starterOrigin, m_workerClients.release()); | 124 OwnPtrWillBeRawPtr<WorkerThreadStartupData> startupData = WorkerThreadStartu
pData::create(scriptURL, userAgent, sourceCode, nullptr, startMode, document->co
ntentSecurityPolicy()->deprecatedHeader(), document->contentSecurityPolicy()->de
precatedHeaderType(), starterOrigin, m_workerClients.release()); |
| 125 double originTime = document->loader() ? document->loader()->timing()->refer
enceMonotonicTime() : monotonicallyIncreasingTime(); | 125 double originTime = document->loader() ? document->loader()->timing().refere
nceMonotonicTime() : monotonicallyIncreasingTime(); |
| 126 | 126 |
| 127 m_loaderProxy = WorkerLoaderProxy::create(this); | 127 m_loaderProxy = WorkerLoaderProxy::create(this); |
| 128 RefPtr<DedicatedWorkerThread> thread = DedicatedWorkerThread::create(m_loade
rProxy, *m_workerObjectProxy.get(), originTime, startupData.release()); | 128 RefPtr<DedicatedWorkerThread> thread = DedicatedWorkerThread::create(m_loade
rProxy, *m_workerObjectProxy.get(), originTime, startupData.release()); |
| 129 thread->start(); | 129 thread->start(); |
| 130 workerThreadCreated(thread); | 130 workerThreadCreated(thread); |
| 131 m_workerInspectorProxy->workerThreadCreated(m_executionContext.get(), m_work
erThread.get(), scriptURL); | 131 m_workerInspectorProxy->workerThreadCreated(m_executionContext.get(), m_work
erThread.get(), scriptURL); |
| 132 } | 132 } |
| 133 | 133 |
| 134 void WorkerMessagingProxy::postMessageToWorkerObject(PassRefPtr<SerializedScript
Value> message, PassOwnPtr<MessagePortChannelArray> channels) | 134 void WorkerMessagingProxy::postMessageToWorkerObject(PassRefPtr<SerializedScript
Value> message, PassOwnPtr<MessagePortChannelArray> channels) |
| 135 { | 135 { |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 | 299 |
| 300 // FIXME: This need to be revisited when we support nested worker one day | 300 // FIXME: This need to be revisited when we support nested worker one day |
| 301 ASSERT(m_executionContext->isDocument()); | 301 ASSERT(m_executionContext->isDocument()); |
| 302 Document* document = toDocument(m_executionContext.get()); | 302 Document* document = toDocument(m_executionContext.get()); |
| 303 LocalFrame* frame = document->frame(); | 303 LocalFrame* frame = document->frame(); |
| 304 if (frame) | 304 if (frame) |
| 305 frame->console().adoptWorkerMessagesAfterTermination(this); | 305 frame->console().adoptWorkerMessagesAfterTermination(this); |
| 306 } | 306 } |
| 307 | 307 |
| 308 } // namespace blink | 308 } // namespace blink |
| OLD | NEW |