OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 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 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 | 336 |
337 bool Thread::IsOwned() { | 337 bool Thread::IsOwned() { |
338 return owned_; | 338 return owned_; |
339 } | 339 } |
340 | 340 |
341 void Thread::Stop() { | 341 void Thread::Stop() { |
342 MessageQueue::Quit(); | 342 MessageQueue::Quit(); |
343 Join(); | 343 Join(); |
344 } | 344 } |
345 | 345 |
346 void Thread::Send(MessageHandler* phandler, uint32_t id, MessageData* pdata) { | 346 void Thread::Send(const Location& posted_from, |
| 347 MessageHandler* phandler, |
| 348 uint32_t id, |
| 349 MessageData* pdata) { |
347 if (fStop_) | 350 if (fStop_) |
348 return; | 351 return; |
349 | 352 |
350 // Sent messages are sent to the MessageHandler directly, in the context | 353 // Sent messages are sent to the MessageHandler directly, in the context |
351 // of "thread", like Win32 SendMessage. If in the right context, | 354 // of "thread", like Win32 SendMessage. If in the right context, |
352 // call the handler directly. | 355 // call the handler directly. |
353 Message msg; | 356 Message msg; |
| 357 msg.posted_from = posted_from; |
354 msg.phandler = phandler; | 358 msg.phandler = phandler; |
355 msg.message_id = id; | 359 msg.message_id = id; |
356 msg.pdata = pdata; | 360 msg.pdata = pdata; |
357 if (IsCurrent()) { | 361 if (IsCurrent()) { |
358 phandler->OnMessage(&msg); | 362 phandler->OnMessage(&msg); |
359 return; | 363 return; |
360 } | 364 } |
361 | 365 |
362 AssertBlockingIsAllowedOnCurrentThread(); | 366 AssertBlockingIsAllowedOnCurrentThread(); |
363 | 367 |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
556 if (SUCCEEDED(hr)) { | 560 if (SUCCEEDED(hr)) { |
557 Thread::Run(); | 561 Thread::Run(); |
558 CoUninitialize(); | 562 CoUninitialize(); |
559 } else { | 563 } else { |
560 LOG(LS_ERROR) << "CoInitialize failed, hr=" << hr; | 564 LOG(LS_ERROR) << "CoInitialize failed, hr=" << hr; |
561 } | 565 } |
562 } | 566 } |
563 #endif | 567 #endif |
564 | 568 |
565 } // namespace rtc | 569 } // namespace rtc |
OLD | NEW |