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

Side by Side Diff: third_party/WebKit/Source/modules/worklet/Worklet.cpp

Issue 2049003002: Wrap GCed raw pointer parameters of WTF::bind with Persistent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "modules/worklet/Worklet.h" 5 #include "modules/worklet/Worklet.h"
6 6
7 #include "bindings/core/v8/ScriptPromiseResolver.h" 7 #include "bindings/core/v8/ScriptPromiseResolver.h"
8 #include "bindings/core/v8/V8Binding.h" 8 #include "bindings/core/v8/V8Binding.h"
9 #include "bindings/core/v8/WorkerOrWorkletScriptController.h" 9 #include "bindings/core/v8/WorkerOrWorkletScriptController.h"
10 #include "core/dom/DOMException.h" 10 #include "core/dom/DOMException.h"
(...skipping 24 matching lines...) Expand all
35 ScriptPromise promise = resolver->promise(); 35 ScriptPromise promise = resolver->promise();
36 36
37 // TODO(ikilpatrick): WorkerScriptLoader will need to be extended to allow 37 // TODO(ikilpatrick): WorkerScriptLoader will need to be extended to allow
38 // module loading support. For now just fetch a 'classic' script. 38 // module loading support. For now just fetch a 'classic' script.
39 39
40 // NOTE: WorkerScriptLoader may synchronously invoke its callbacks 40 // NOTE: WorkerScriptLoader may synchronously invoke its callbacks
41 // (resolving the promise) before we return it. 41 // (resolving the promise) before we return it.
42 m_scriptLoaders.append(WorkerScriptLoader::create()); 42 m_scriptLoaders.append(WorkerScriptLoader::create());
43 m_scriptLoaders.last()->loadAsynchronously(*getExecutionContext(), scriptURL , DenyCrossOriginRequests, 43 m_scriptLoaders.last()->loadAsynchronously(*getExecutionContext(), scriptURL , DenyCrossOriginRequests,
44 getExecutionContext()->securityContext().addressSpace(), 44 getExecutionContext()->securityContext().addressSpace(),
45 bind(&Worklet::onResponse, this, m_scriptLoaders.last().get()), 45 bind(&Worklet::onResponse, wrapPersistent(this), m_scriptLoaders.last(). get()),
46 bind(&Worklet::onFinished, this, m_scriptLoaders.last().get(), resolver) ); 46 bind(&Worklet::onFinished, wrapPersistent(this), m_scriptLoaders.last(). get(), wrapPersistent(resolver)));
47 47
48 return promise; 48 return promise;
49 } 49 }
50 50
51 void Worklet::onResponse(WorkerScriptLoader* scriptLoader) 51 void Worklet::onResponse(WorkerScriptLoader* scriptLoader)
52 { 52 {
53 InspectorInstrumentation::didReceiveScriptResponse(getExecutionContext(), sc riptLoader->identifier()); 53 InspectorInstrumentation::didReceiveScriptResponse(getExecutionContext(), sc riptLoader->identifier());
54 } 54 }
55 55
56 void Worklet::onFinished(WorkerScriptLoader* scriptLoader, ScriptPromiseResolver * resolver) 56 void Worklet::onFinished(WorkerScriptLoader* scriptLoader, ScriptPromiseResolver * resolver)
(...skipping 27 matching lines...) Expand all
84 } 84 }
85 } 85 }
86 86
87 DEFINE_TRACE(Worklet) 87 DEFINE_TRACE(Worklet)
88 { 88 {
89 visitor->trace(m_resolvers); 89 visitor->trace(m_resolvers);
90 ActiveDOMObject::trace(visitor); 90 ActiveDOMObject::trace(visitor);
91 } 91 }
92 92
93 } // namespace blink 93 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/webusb/USBDevice.cpp ('k') | third_party/WebKit/Source/platform/heap/HeapTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698