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

Side by Side Diff: webrtc/base/rtccertificategenerator.cc

Issue 2019423006: Adding more detail to MessageQueue::Dispatch logging. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: 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 /* 1 /*
2 * Copyright 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2016 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 switch (msg->message_id) { 59 switch (msg->message_id) {
60 case MSG_GENERATE: 60 case MSG_GENERATE:
61 RTC_DCHECK(worker_thread_->IsCurrent()); 61 RTC_DCHECK(worker_thread_->IsCurrent());
62 62
63 // Perform the certificate generation work here on the worker thread. 63 // Perform the certificate generation work here on the worker thread.
64 certificate_ = RTCCertificateGenerator::GenerateCertificate( 64 certificate_ = RTCCertificateGenerator::GenerateCertificate(
65 key_params_, expires_ms_); 65 key_params_, expires_ms_);
66 66
67 // Handle callbacks on signaling thread. Pass on the |msg->pdata| 67 // Handle callbacks on signaling thread. Pass on the |msg->pdata|
68 // (which references |this| with ref counting) to that thread. 68 // (which references |this| with ref counting) to that thread.
69 signaling_thread_->Post(this, MSG_GENERATE_DONE, msg->pdata); 69 signaling_thread_->Post(FROM_HERE, this, MSG_GENERATE_DONE, msg->pdata);
70 break; 70 break;
71 case MSG_GENERATE_DONE: 71 case MSG_GENERATE_DONE:
72 RTC_DCHECK(signaling_thread_->IsCurrent()); 72 RTC_DCHECK(signaling_thread_->IsCurrent());
73 73
74 // Perform callback with result here on the signaling thread. 74 // Perform callback with result here on the signaling thread.
75 if (certificate_) { 75 if (certificate_) {
76 callback_->OnSuccess(certificate_); 76 callback_->OnSuccess(certificate_);
77 } else { 77 } else {
78 callback_->OnFailure(); 78 callback_->OnFailure();
79 } 79 }
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 RTC_DCHECK(callback); 145 RTC_DCHECK(callback);
146 146
147 // Create a new |RTCCertificateGenerationTask| for this generation request. It 147 // Create a new |RTCCertificateGenerationTask| for this generation request. It
148 // is reference counted and referenced by the message data, ensuring it lives 148 // is reference counted and referenced by the message data, ensuring it lives
149 // until the task has completed (independent of |RTCCertificateGenerator|). 149 // until the task has completed (independent of |RTCCertificateGenerator|).
150 ScopedRefMessageData<RTCCertificateGenerationTask>* msg_data = 150 ScopedRefMessageData<RTCCertificateGenerationTask>* msg_data =
151 new ScopedRefMessageData<RTCCertificateGenerationTask>( 151 new ScopedRefMessageData<RTCCertificateGenerationTask>(
152 new RefCountedObject<RTCCertificateGenerationTask>( 152 new RefCountedObject<RTCCertificateGenerationTask>(
153 signaling_thread_, worker_thread_, key_params, expires_ms, 153 signaling_thread_, worker_thread_, key_params, expires_ms,
154 callback)); 154 callback));
155 worker_thread_->Post(msg_data->data().get(), MSG_GENERATE, msg_data); 155 worker_thread_->Post(FROM_HERE, msg_data->data().get(), MSG_GENERATE,
156 msg_data);
156 } 157 }
157 158
158 } // namespace rtc 159 } // namespace rtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698