OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008, 2010 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008, 2010 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 worker->suspendIfNeeded(); | 67 worker->suspendIfNeeded(); |
68 | 68 |
69 KURL scriptURL = worker->resolveURL(url, exceptionState); | 69 KURL scriptURL = worker->resolveURL(url, exceptionState); |
70 if (scriptURL.isEmpty()) | 70 if (scriptURL.isEmpty()) |
71 return nullptr; | 71 return nullptr; |
72 | 72 |
73 // The worker context does not exist while loading, so we must ensure that t
he worker object is not collected, nor are its event listeners. | 73 // The worker context does not exist while loading, so we must ensure that t
he worker object is not collected, nor are its event listeners. |
74 worker->setPendingActivity(worker.get()); | 74 worker->setPendingActivity(worker.get()); |
75 | 75 |
76 worker->m_scriptLoader = WorkerScriptLoader::create(); | 76 worker->m_scriptLoader = WorkerScriptLoader::create(); |
77 worker->m_scriptLoader->loadAsynchronously(context, scriptURL, DenyCrossOrig
inRequests, worker.get()); | 77 worker->m_scriptLoader->loadAsynchronously(*context, scriptURL, DenyCrossOri
ginRequests, worker.get()); |
78 worker->m_contextProxy = proxyProvider->createWorkerGlobalScopeProxy(worker.
get()); | 78 worker->m_contextProxy = proxyProvider->createWorkerGlobalScopeProxy(worker.
get()); |
79 return worker.release(); | 79 return worker.release(); |
80 } | 80 } |
81 | 81 |
82 Worker::~Worker() | 82 Worker::~Worker() |
83 { | 83 { |
84 ASSERT(isMainThread()); | 84 ASSERT(isMainThread()); |
85 ASSERT(executionContext()); // The context is protected by worker context pr
oxy, so it cannot be destroyed while a Worker exists. | 85 ASSERT(executionContext()); // The context is protected by worker context pr
oxy, so it cannot be destroyed while a Worker exists. |
86 if (m_contextProxy) | 86 if (m_contextProxy) |
87 m_contextProxy->workerObjectDestroyed(); | 87 m_contextProxy->workerObjectDestroyed(); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 | 137 |
138 unsetPendingActivity(this); | 138 unsetPendingActivity(this); |
139 } | 139 } |
140 | 140 |
141 void Worker::trace(Visitor* visitor) | 141 void Worker::trace(Visitor* visitor) |
142 { | 142 { |
143 AbstractWorker::trace(visitor); | 143 AbstractWorker::trace(visitor); |
144 } | 144 } |
145 | 145 |
146 } // namespace WebCore | 146 } // namespace WebCore |
OLD | NEW |