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

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

Issue 1915153004: [K5] Replace bind() + non-GC pointers with unretained() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Kuroneko_4
Patch Set: Rebase Created 4 years, 7 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
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 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 m_loadingShadowPage = false; 312 m_loadingShadowPage = false;
313 m_networkProvider = adoptPtr(m_workerContextClient->createServiceWorkerNetwo rkProvider(frame->dataSource())); 313 m_networkProvider = adoptPtr(m_workerContextClient->createServiceWorkerNetwo rkProvider(frame->dataSource()));
314 m_mainScriptLoader = WorkerScriptLoader::create(); 314 m_mainScriptLoader = WorkerScriptLoader::create();
315 m_mainScriptLoader->setRequestContext(WebURLRequest::RequestContextServiceWo rker); 315 m_mainScriptLoader->setRequestContext(WebURLRequest::RequestContextServiceWo rker);
316 m_mainScriptLoader->loadAsynchronously( 316 m_mainScriptLoader->loadAsynchronously(
317 *m_mainFrame->frame()->document(), 317 *m_mainFrame->frame()->document(),
318 m_workerStartData.scriptURL, 318 m_workerStartData.scriptURL,
319 DenyCrossOriginRequests, 319 DenyCrossOriginRequests,
320 m_mainFrame->frame()->document()->addressSpace(), 320 m_mainFrame->frame()->document()->addressSpace(),
321 nullptr, 321 nullptr,
322 bind(&WebEmbeddedWorkerImpl::onScriptLoaderFinished, this)); 322 bind(&WebEmbeddedWorkerImpl::onScriptLoaderFinished, unretained(this)));
323 // Do nothing here since onScriptLoaderFinished() might have been already 323 // Do nothing here since onScriptLoaderFinished() might have been already
324 // invoked and |this| might have been deleted at this point. 324 // invoked and |this| might have been deleted at this point.
325 } 325 }
326 326
327 void WebEmbeddedWorkerImpl::sendProtocolMessage(int sessionId, int callId, const WebString& message, const WebString& state) 327 void WebEmbeddedWorkerImpl::sendProtocolMessage(int sessionId, int callId, const WebString& message, const WebString& state)
328 { 328 {
329 m_workerContextClient->sendDevToolsMessage(sessionId, callId, message, state ); 329 m_workerContextClient->sendDevToolsMessage(sessionId, callId, message, state );
330 } 330 }
331 331
332 void WebEmbeddedWorkerImpl::resumeStartup() 332 void WebEmbeddedWorkerImpl::resumeStartup()
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 m_mainScriptLoader.clear(); 401 m_mainScriptLoader.clear();
402 402
403 m_workerGlobalScopeProxy = ServiceWorkerGlobalScopeProxy::create(*this, *doc ument, *m_workerContextClient); 403 m_workerGlobalScopeProxy = ServiceWorkerGlobalScopeProxy::create(*this, *doc ument, *m_workerContextClient);
404 m_loaderProxy = WorkerLoaderProxy::create(this); 404 m_loaderProxy = WorkerLoaderProxy::create(this);
405 m_workerThread = ServiceWorkerThread::create(m_loaderProxy, *m_workerGlobalS copeProxy); 405 m_workerThread = ServiceWorkerThread::create(m_loaderProxy, *m_workerGlobalS copeProxy);
406 m_workerThread->start(startupData.release()); 406 m_workerThread->start(startupData.release());
407 m_workerInspectorProxy->workerThreadCreated(document, m_workerThread.get(), scriptURL); 407 m_workerInspectorProxy->workerThreadCreated(document, m_workerThread.get(), scriptURL);
408 } 408 }
409 409
410 } // namespace blink 410 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698