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

Side by Side Diff: Source/web/WebSharedWorkerImpl.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) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 m_networkProvider = adoptPtr(m_client->createServiceWorkerNetworkProvider(fr ame->dataSource())); 193 m_networkProvider = adoptPtr(m_client->createServiceWorkerNetworkProvider(fr ame->dataSource()));
194 m_mainScriptLoader = adoptPtr(new WorkerScriptLoader()); 194 m_mainScriptLoader = adoptPtr(new WorkerScriptLoader());
195 m_mainScriptLoader->setRequestContext(WebURLRequest::RequestContextSharedWor ker); 195 m_mainScriptLoader->setRequestContext(WebURLRequest::RequestContextSharedWor ker);
196 m_loadingDocument = toWebLocalFrameImpl(frame)->frame()->document(); 196 m_loadingDocument = toWebLocalFrameImpl(frame)->frame()->document();
197 m_mainScriptLoader->loadAsynchronously( 197 m_mainScriptLoader->loadAsynchronously(
198 *m_loadingDocument.get(), 198 *m_loadingDocument.get(),
199 m_url, 199 m_url,
200 DenyCrossOriginRequests, 200 DenyCrossOriginRequests,
201 bind(&WebSharedWorkerImpl::didReceiveScriptLoaderResponse, this), 201 bind(&WebSharedWorkerImpl::didReceiveScriptLoaderResponse, this),
202 bind(&WebSharedWorkerImpl::onScriptLoaderFinished, this)); 202 bind(&WebSharedWorkerImpl::onScriptLoaderFinished, this));
203 // 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 Done.
204 // and |this| might have been deleted at this point.
203 } 205 }
204 206
205 bool WebSharedWorkerImpl::isControlledByServiceWorker(WebDataSource& dataSource) 207 bool WebSharedWorkerImpl::isControlledByServiceWorker(WebDataSource& dataSource)
206 { 208 {
207 return m_networkProvider && m_networkProvider->isControlledByServiceWorker(d ataSource); 209 return m_networkProvider && m_networkProvider->isControlledByServiceWorker(d ataSource);
208 } 210 }
209 211
210 int64_t WebSharedWorkerImpl::serviceWorkerID(WebDataSource& dataSource) 212 int64_t WebSharedWorkerImpl::serviceWorkerID(WebDataSource& dataSource)
211 { 213 {
212 if (!m_networkProvider) 214 if (!m_networkProvider)
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 if (devtoolsAgent) 413 if (devtoolsAgent)
412 devtoolsAgent->dispatchOnInspectorBackend(message); 414 devtoolsAgent->dispatchOnInspectorBackend(message);
413 } 415 }
414 416
415 WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client) 417 WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client)
416 { 418 {
417 return new WebSharedWorkerImpl(client); 419 return new WebSharedWorkerImpl(client);
418 } 420 }
419 421
420 } // namespace blink 422 } // namespace blink
OLDNEW
« Source/web/WebEmbeddedWorkerImpl.cpp ('K') | « Source/web/WebEmbeddedWorkerImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698