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

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

Issue 1916283003: [K6] Replace bind() + GCed pointers with retainedRef() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Kuroneko_5c
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 // 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/ScriptSourceCode.h" 8 #include "bindings/core/v8/ScriptSourceCode.h"
9 #include "bindings/core/v8/V8Binding.h" 9 #include "bindings/core/v8/V8Binding.h"
10 #include "bindings/core/v8/WorkerOrWorkletScriptController.h" 10 #include "bindings/core/v8/WorkerOrWorkletScriptController.h"
(...skipping 25 matching lines...) Expand all
36 ScriptPromise promise = resolver->promise(); 36 ScriptPromise promise = resolver->promise();
37 37
38 // TODO(ikilpatrick): WorkerScriptLoader will need to be extended to allow 38 // TODO(ikilpatrick): WorkerScriptLoader will need to be extended to allow
39 // module loading support. For now just fetch a 'classic' script. 39 // module loading support. For now just fetch a 'classic' script.
40 40
41 // NOTE: WorkerScriptLoader may synchronously invoke its callbacks 41 // NOTE: WorkerScriptLoader may synchronously invoke its callbacks
42 // (resolving the promise) before we return it. 42 // (resolving the promise) before we return it.
43 m_scriptLoaders.append(WorkerScriptLoader::create()); 43 m_scriptLoaders.append(WorkerScriptLoader::create());
44 m_scriptLoaders.last()->loadAsynchronously(*getExecutionContext(), scriptURL , DenyCrossOriginRequests, 44 m_scriptLoaders.last()->loadAsynchronously(*getExecutionContext(), scriptURL , DenyCrossOriginRequests,
45 getExecutionContext()->securityContext().addressSpace(), 45 getExecutionContext()->securityContext().addressSpace(),
46 bind(&Worklet::onResponse, this), 46 bind(&Worklet::onResponse, retainedRef(this)),
47 bind(&Worklet::onFinished, this, unretainedUnsafe(m_scriptLoaders.last() .get()), resolver)); 47 bind(&Worklet::onFinished, retainedRef(this), unretainedUnsafe(m_scriptL oaders.last().get()), retainedRef(resolver)));
48 48
49 return promise; 49 return promise;
50 } 50 }
51 51
52 void Worklet::onResponse() 52 void Worklet::onResponse()
53 { 53 {
54 // TODO(ikilpatrick): Add devtools instrumentation on worklet script 54 // TODO(ikilpatrick): Add devtools instrumentation on worklet script
55 // resource loading. 55 // resource loading.
56 } 56 }
57 57
(...skipping 28 matching lines...) Expand all
86 } 86 }
87 } 87 }
88 88
89 DEFINE_TRACE(Worklet) 89 DEFINE_TRACE(Worklet)
90 { 90 {
91 visitor->trace(m_resolvers); 91 visitor->trace(m_resolvers);
92 ActiveDOMObject::trace(visitor); 92 ActiveDOMObject::trace(visitor);
93 } 93 }
94 94
95 } // namespace blink 95 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/webusb/USBDevice.cpp ('k') | third_party/WebKit/Source/platform/heap/Handle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698