OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 return; | 102 return; |
103 | 103 |
104 m_state = Suspended; | 104 m_state = Suspended; |
105 } | 105 } |
106 | 106 |
107 void DOMWebSocket::EventQueue::resume() | 107 void DOMWebSocket::EventQueue::resume() |
108 { | 108 { |
109 if (m_state != Suspended || m_resumeTimer.isActive()) | 109 if (m_state != Suspended || m_resumeTimer.isActive()) |
110 return; | 110 return; |
111 | 111 |
112 m_resumeTimer.startOneShot(0, FROM_HERE); | 112 m_resumeTimer.startOneShot(0, BLINK_FROM_HERE); |
113 } | 113 } |
114 | 114 |
115 void DOMWebSocket::EventQueue::stop() | 115 void DOMWebSocket::EventQueue::stop() |
116 { | 116 { |
117 if (m_state == Stopped) | 117 if (m_state == Stopped) |
118 return; | 118 return; |
119 | 119 |
120 m_state = Stopped; | 120 m_state = Stopped; |
121 m_resumeTimer.stop(); | 121 m_resumeTimer.stop(); |
122 m_events.clear(); | 122 m_events.clear(); |
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
655 void DOMWebSocket::didConsumeBufferedAmount(uint64_t consumed) | 655 void DOMWebSocket::didConsumeBufferedAmount(uint64_t consumed) |
656 { | 656 { |
657 ASSERT(m_bufferedAmount >= consumed + m_consumedBufferedAmount); | 657 ASSERT(m_bufferedAmount >= consumed + m_consumedBufferedAmount); |
658 // Cast to unsigned long long is required since clang doesn't accept | 658 // Cast to unsigned long long is required since clang doesn't accept |
659 // combination of %llu and uint64_t (known as unsigned long). | 659 // combination of %llu and uint64_t (known as unsigned long). |
660 WTF_LOG(Network, "WebSocket %p didConsumeBufferedAmount(%llu)", this, static
_cast<unsigned long long>(consumed)); | 660 WTF_LOG(Network, "WebSocket %p didConsumeBufferedAmount(%llu)", this, static
_cast<unsigned long long>(consumed)); |
661 if (m_state == CLOSED) | 661 if (m_state == CLOSED) |
662 return; | 662 return; |
663 m_consumedBufferedAmount += consumed; | 663 m_consumedBufferedAmount += consumed; |
664 if (!m_bufferedAmountConsumeTimer.isActive()) | 664 if (!m_bufferedAmountConsumeTimer.isActive()) |
665 m_bufferedAmountConsumeTimer.startOneShot(0, FROM_HERE); | 665 m_bufferedAmountConsumeTimer.startOneShot(0, BLINK_FROM_HERE); |
666 } | 666 } |
667 | 667 |
668 void DOMWebSocket::didStartClosingHandshake() | 668 void DOMWebSocket::didStartClosingHandshake() |
669 { | 669 { |
670 WTF_LOG(Network, "WebSocket %p didStartClosingHandshake()", this); | 670 WTF_LOG(Network, "WebSocket %p didStartClosingHandshake()", this); |
671 m_state = CLOSING; | 671 m_state = CLOSING; |
672 } | 672 } |
673 | 673 |
674 void DOMWebSocket::didClose(ClosingHandshakeCompletionStatus closingHandshakeCom
pletion, unsigned short code, const String& reason) | 674 void DOMWebSocket::didClose(ClosingHandshakeCompletionStatus closingHandshakeCom
pletion, unsigned short code, const String& reason) |
675 { | 675 { |
(...skipping 11 matching lines...) Expand all Loading... |
687 DEFINE_TRACE(DOMWebSocket) | 687 DEFINE_TRACE(DOMWebSocket) |
688 { | 688 { |
689 visitor->trace(m_channel); | 689 visitor->trace(m_channel); |
690 visitor->trace(m_eventQueue); | 690 visitor->trace(m_eventQueue); |
691 WebSocketChannelClient::trace(visitor); | 691 WebSocketChannelClient::trace(visitor); |
692 RefCountedGarbageCollectedEventTargetWithInlineData<DOMWebSocket>::trace(vis
itor); | 692 RefCountedGarbageCollectedEventTargetWithInlineData<DOMWebSocket>::trace(vis
itor); |
693 ActiveDOMObject::trace(visitor); | 693 ActiveDOMObject::trace(visitor); |
694 } | 694 } |
695 | 695 |
696 } // namespace blink | 696 } // namespace blink |
OLD | NEW |