Chromium Code Reviews| 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 #include "webrtc/base/physicalsocketserver.h" | 10 #include "webrtc/base/physicalsocketserver.h" |
| (...skipping 1445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1456 return false; | 1456 return false; |
| 1457 } | 1457 } |
| 1458 return true; | 1458 return true; |
| 1459 } | 1459 } |
| 1460 #endif // WEBRTC_POSIX | 1460 #endif // WEBRTC_POSIX |
| 1461 | 1461 |
| 1462 #if defined(WEBRTC_WIN) | 1462 #if defined(WEBRTC_WIN) |
| 1463 bool PhysicalSocketServer::Wait(int cmsWait, bool process_io) { | 1463 bool PhysicalSocketServer::Wait(int cmsWait, bool process_io) { |
| 1464 int cmsTotal = cmsWait; | 1464 int cmsTotal = cmsWait; |
| 1465 int cmsElapsed = 0; | 1465 int cmsElapsed = 0; |
| 1466 uint32_t msStart = Time(); | 1466 int64_t msStart = Time(); |
| 1467 | 1467 |
| 1468 fWait_ = true; | 1468 fWait_ = true; |
| 1469 while (fWait_) { | 1469 while (fWait_) { |
| 1470 std::vector<WSAEVENT> events; | 1470 std::vector<WSAEVENT> events; |
| 1471 std::vector<Dispatcher *> event_owners; | 1471 std::vector<Dispatcher *> event_owners; |
| 1472 | 1472 |
| 1473 events.push_back(socket_ev_); | 1473 events.push_back(socket_ev_); |
| 1474 | 1474 |
| 1475 { | 1475 { |
| 1476 CritScope cr(&crit_); | 1476 CritScope cr(&crit_); |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1606 iterators_.pop_back(); | 1606 iterators_.pop_back(); |
| 1607 } | 1607 } |
| 1608 | 1608 |
| 1609 // Reset the network event until new activity occurs | 1609 // Reset the network event until new activity occurs |
| 1610 WSAResetEvent(socket_ev_); | 1610 WSAResetEvent(socket_ev_); |
| 1611 } | 1611 } |
| 1612 | 1612 |
| 1613 // Break? | 1613 // Break? |
| 1614 if (!fWait_) | 1614 if (!fWait_) |
| 1615 break; | 1615 break; |
| 1616 cmsElapsed = TimeSince(msStart); | 1616 cmsElapsed = static_cast<int>(TimeSince(msStart)); |
|
pthatcher1
2016/05/02 16:57:56
Can you leave a comment about why we do this and w
honghaiz3
2016/05/03 21:18:25
Just used int64_t instead.
Deferred the type conv
| |
| 1617 if ((cmsWait != kForever) && (cmsElapsed >= cmsWait)) { | 1617 if ((cmsWait != kForever) && (cmsElapsed >= cmsWait)) { |
| 1618 break; | 1618 break; |
| 1619 } | 1619 } |
| 1620 } | 1620 } |
| 1621 | 1621 |
| 1622 // Done | 1622 // Done |
| 1623 return true; | 1623 return true; |
| 1624 } | 1624 } |
| 1625 #endif // WEBRTC_WIN | 1625 #endif // WEBRTC_WIN |
| 1626 | 1626 |
| 1627 } // namespace rtc | 1627 } // namespace rtc |
| OLD | NEW |