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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/RejectedPromises.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: revert "unretained" part and "disallow pointers" part Created 4 years, 6 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "bindings/core/v8/RejectedPromises.h" 5 #include "bindings/core/v8/RejectedPromises.h"
6 6
7 #include "bindings/core/v8/ScopedPersistent.h" 7 #include "bindings/core/v8/ScopedPersistent.h"
8 #include "bindings/core/v8/ScriptState.h" 8 #include "bindings/core/v8/ScriptState.h"
9 #include "bindings/core/v8/ScriptValue.h" 9 #include "bindings/core/v8/ScriptValue.h"
10 #include "bindings/core/v8/V8Binding.h" 10 #include "bindings/core/v8/V8Binding.h"
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 m_queue.remove(it); 203 m_queue.remove(it);
204 return; 204 return;
205 } 205 }
206 } 206 }
207 207
208 // Then look it up in the reported errors. 208 // Then look it up in the reported errors.
209 for (size_t i = 0; i < m_reportedAsErrors.size(); ++i) { 209 for (size_t i = 0; i < m_reportedAsErrors.size(); ++i) {
210 OwnPtr<Message>& message = m_reportedAsErrors.at(i); 210 OwnPtr<Message>& message = m_reportedAsErrors.at(i);
211 if (!message->isCollected() && message->hasPromise(data.GetPromise())) { 211 if (!message->isCollected() && message->hasPromise(data.GetPromise())) {
212 message->makePromiseStrong(); 212 message->makePromiseStrong();
213 Platform::current()->currentThread()->scheduler()->timerTaskRunner() ->postTask(BLINK_FROM_HERE, bind(&RejectedPromises::revokeNow, this, passed(std: :move(message)))); 213 Platform::current()->currentThread()->scheduler()->timerTaskRunner() ->postTask(BLINK_FROM_HERE, bind(&RejectedPromises::revokeNow, RefPtr<RejectedPr omises>(this), passed(std::move(message))));
hiroshige 2016/06/15 12:12:39 I think it is better to split this change into a s
tzik 2016/06/21 09:09:04 Done. I split this part into https://codereview.ch
214 m_reportedAsErrors.remove(i); 214 m_reportedAsErrors.remove(i);
215 return; 215 return;
216 } 216 }
217 } 217 }
218 } 218 }
219 219
220 PassOwnPtr<RejectedPromises::MessageQueue> RejectedPromises::createMessageQueue( ) 220 PassOwnPtr<RejectedPromises::MessageQueue> RejectedPromises::createMessageQueue( )
221 { 221 {
222 return adoptPtr(new MessageQueue()); 222 return adoptPtr(new MessageQueue());
223 } 223 }
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 } 265 }
266 } 266 }
267 } 267 }
268 268
269 void RejectedPromises::revokeNow(PassOwnPtr<Message> message) 269 void RejectedPromises::revokeNow(PassOwnPtr<Message> message)
270 { 270 {
271 message->revoke(); 271 message->revoke();
272 } 272 }
273 273
274 } // namespace blink 274 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698