OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 if (m_workerThread) | 101 if (m_workerThread) |
102 m_workerThread->terminateAndWait(); | 102 m_workerThread->terminateAndWait(); |
103 | 103 |
104 ASSERT(runningWorkerInstances().contains(this)); | 104 ASSERT(runningWorkerInstances().contains(this)); |
105 runningWorkerInstances().remove(this); | 105 runningWorkerInstances().remove(this); |
106 ASSERT(m_webView); | 106 ASSERT(m_webView); |
107 | 107 |
108 // Detach the client before closing the view to avoid getting called back. | 108 // Detach the client before closing the view to avoid getting called back. |
109 m_mainFrame->setClient(0); | 109 m_mainFrame->setClient(0); |
110 | 110 |
| 111 if (m_workerGlobalScopeProxy) { |
| 112 m_workerGlobalScopeProxy->detach(); |
| 113 m_workerGlobalScopeProxy.clear(); |
| 114 } |
| 115 |
111 m_webView->close(); | 116 m_webView->close(); |
112 m_mainFrame->close(); | 117 m_mainFrame->close(); |
113 if (m_loaderProxy) | 118 if (m_loaderProxy) |
114 m_loaderProxy->detachProvider(this); | 119 m_loaderProxy->detachProvider(this); |
115 } | 120 } |
116 | 121 |
117 void WebEmbeddedWorkerImpl::startWorkerContext( | 122 void WebEmbeddedWorkerImpl::startWorkerContext( |
118 const WebEmbeddedWorkerStartData& data) | 123 const WebEmbeddedWorkerStartData& data) |
119 { | 124 { |
120 ASSERT(!m_askedToTerminate); | 125 ASSERT(!m_askedToTerminate); |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 m_mainScriptLoader.clear(); | 358 m_mainScriptLoader.clear(); |
354 | 359 |
355 m_workerGlobalScopeProxy = ServiceWorkerGlobalScopeProxy::create(*this, *doc
ument, *m_workerContextClient); | 360 m_workerGlobalScopeProxy = ServiceWorkerGlobalScopeProxy::create(*this, *doc
ument, *m_workerContextClient); |
356 m_loaderProxy = WorkerLoaderProxy::create(this); | 361 m_loaderProxy = WorkerLoaderProxy::create(this); |
357 m_workerThread = ServiceWorkerThread::create(m_loaderProxy, *m_workerGlobalS
copeProxy); | 362 m_workerThread = ServiceWorkerThread::create(m_loaderProxy, *m_workerGlobalS
copeProxy); |
358 m_workerThread->start(startupData.release()); | 363 m_workerThread->start(startupData.release()); |
359 m_workerInspectorProxy->workerThreadCreated(document, m_workerThread.get(),
scriptURL); | 364 m_workerInspectorProxy->workerThreadCreated(document, m_workerThread.get(),
scriptURL); |
360 } | 365 } |
361 | 366 |
362 } // namespace blink | 367 } // namespace blink |
OLD | NEW |