Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(107)

Side by Side Diff: third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp

Issue 1448353002: Oilpan: move ServiceWorkerGlobalScopeProxy to the heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: assert for clean detachment Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698