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

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

Issue 1213443006: Invoke WorkerScriptLoader's m_finishedCallback callback safely. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: review #3 Created 5 years, 5 months 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 | Annotate | Revision Log
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 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 m_loadingShadowPage = false; 298 m_loadingShadowPage = false;
299 m_networkProvider = adoptPtr(m_workerContextClient->createServiceWorkerNetwo rkProvider(frame->dataSource())); 299 m_networkProvider = adoptPtr(m_workerContextClient->createServiceWorkerNetwo rkProvider(frame->dataSource()));
300 m_mainScriptLoader = adoptPtr(new WorkerScriptLoader()); 300 m_mainScriptLoader = adoptPtr(new WorkerScriptLoader());
301 m_mainScriptLoader->setRequestContext(WebURLRequest::RequestContextServiceWo rker); 301 m_mainScriptLoader->setRequestContext(WebURLRequest::RequestContextServiceWo rker);
302 m_mainScriptLoader->loadAsynchronously( 302 m_mainScriptLoader->loadAsynchronously(
303 *m_mainFrame->frame()->document(), 303 *m_mainFrame->frame()->document(),
304 m_workerStartData.scriptURL, 304 m_workerStartData.scriptURL,
305 DenyCrossOriginRequests, 305 DenyCrossOriginRequests,
306 nullptr, 306 nullptr,
307 bind(&WebEmbeddedWorkerImpl::onScriptLoaderFinished, this)); 307 bind(&WebEmbeddedWorkerImpl::onScriptLoaderFinished, this));
308 // Do nothing here since onScriptLoaderFinished() might be already invoked
haraken 2015/07/02 06:18:06 might be => might have been
Takashi Toyoshima 2015/07/02 07:33:56 Oops, tense is so important here.
309 // and |this| might have been deleted at this point.
308 } 310 }
309 311
310 void WebEmbeddedWorkerImpl::sendProtocolMessage(int callId, const WebString& mes sage, const WebString& state) 312 void WebEmbeddedWorkerImpl::sendProtocolMessage(int callId, const WebString& mes sage, const WebString& state)
311 { 313 {
312 m_workerContextClient->sendDevToolsMessage(callId, message, state); 314 m_workerContextClient->sendDevToolsMessage(callId, message, state);
313 } 315 }
314 316
315 void WebEmbeddedWorkerImpl::resumeStartup() 317 void WebEmbeddedWorkerImpl::resumeStartup()
316 { 318 {
317 WaitingForDebuggerState waitingForDebuggerState = m_waitingForDebuggerState; 319 WaitingForDebuggerState waitingForDebuggerState = m_waitingForDebuggerState;
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 m_mainScriptLoader.clear(); 387 m_mainScriptLoader.clear();
386 388
387 m_workerGlobalScopeProxy = ServiceWorkerGlobalScopeProxy::create(*this, *doc ument, *m_workerContextClient); 389 m_workerGlobalScopeProxy = ServiceWorkerGlobalScopeProxy::create(*this, *doc ument, *m_workerContextClient);
388 m_loaderProxy = WorkerLoaderProxy::create(this); 390 m_loaderProxy = WorkerLoaderProxy::create(this);
389 m_workerThread = ServiceWorkerThread::create(m_loaderProxy, *m_workerGlobalS copeProxy); 391 m_workerThread = ServiceWorkerThread::create(m_loaderProxy, *m_workerGlobalS copeProxy);
390 m_workerThread->start(startupData.release()); 392 m_workerThread->start(startupData.release());
391 m_workerInspectorProxy->workerThreadCreated(document, m_workerThread.get(), scriptURL); 393 m_workerInspectorProxy->workerThreadCreated(document, m_workerThread.get(), scriptURL);
392 } 394 }
393 395
394 } // namespace blink 396 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698