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

Side by Side Diff: third_party/WebKit/Source/core/workers/InProcessWorkerMessagingProxy.cpp

Issue 2909613002: Replaced usage of RefPtr::Release with std::move wraps. (Closed)
Patch Set: Created 3 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 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3 * Copyright (C) 2009 Google Inc. All Rights Reserved. 3 * Copyright (C) 2009 Google Inc. All Rights Reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 196
197 // Worker initialization means a pending activity. 197 // Worker initialization means a pending activity.
198 worker_global_scope_has_pending_activity_ = true; 198 worker_global_scope_has_pending_activity_ = true;
199 199
200 DCHECK_EQ(0u, unconfirmed_message_count_); 200 DCHECK_EQ(0u, unconfirmed_message_count_);
201 unconfirmed_message_count_ = queued_early_tasks_.size(); 201 unconfirmed_message_count_ = queued_early_tasks_.size();
202 for (auto& queued_task : queued_early_tasks_) { 202 for (auto& queued_task : queued_early_tasks_) {
203 std::unique_ptr<WTF::CrossThreadClosure> task = CrossThreadBind( 203 std::unique_ptr<WTF::CrossThreadClosure> task = CrossThreadBind(
204 &InProcessWorkerObjectProxy::ProcessMessageFromWorkerObject, 204 &InProcessWorkerObjectProxy::ProcessMessageFromWorkerObject,
205 CrossThreadUnretained(&WorkerObjectProxy()), 205 CrossThreadUnretained(&WorkerObjectProxy()),
206 queued_task.message.Release(), 206 std::move(queued_task.message),
207 WTF::Passed(std::move(queued_task.channels)), 207 WTF::Passed(std::move(queued_task.channels)),
208 CrossThreadUnretained(GetWorkerThread())); 208 CrossThreadUnretained(GetWorkerThread()));
209 TaskRunnerHelper::Get(TaskType::kPostedMessage, GetWorkerThread()) 209 TaskRunnerHelper::Get(TaskType::kPostedMessage, GetWorkerThread())
210 ->PostTask(BLINK_FROM_HERE, std::move(task)); 210 ->PostTask(BLINK_FROM_HERE, std::move(task));
211 } 211 }
212 queued_early_tasks_.clear(); 212 queued_early_tasks_.clear();
213 } 213 }
214 214
215 void InProcessWorkerMessagingProxy::ParentObjectDestroyed() { 215 void InProcessWorkerMessagingProxy::ParentObjectDestroyed() {
216 DCHECK(IsParentContextThread()); 216 DCHECK(IsParentContextThread());
(...skipping 27 matching lines...) Expand all
244 } 244 }
245 245
246 bool InProcessWorkerMessagingProxy::HasPendingActivity() const { 246 bool InProcessWorkerMessagingProxy::HasPendingActivity() const {
247 DCHECK(IsParentContextThread()); 247 DCHECK(IsParentContextThread());
248 if (AskedToTerminate()) 248 if (AskedToTerminate())
249 return false; 249 return false;
250 return worker_global_scope_has_pending_activity_; 250 return worker_global_scope_has_pending_activity_;
251 } 251 }
252 252
253 } // namespace blink 253 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698