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

Side by Side Diff: Source/modules/websockets/DocumentWebSocketChannel.cpp

Issue 735433002: DOMWebSocket::bufferedAmount() should not return an "unsigned long" (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 , vectorData(vectorData) { } 296 , vectorData(vectorData) { }
297 297
298 DocumentWebSocketChannel::Message::Message(unsigned short code, const String& re ason) 298 DocumentWebSocketChannel::Message::Message(unsigned short code, const String& re ason)
299 : type(MessageTypeClose) 299 : type(MessageTypeClose)
300 , code(code) 300 , code(code)
301 , reason(reason) { } 301 , reason(reason) { }
302 302
303 void DocumentWebSocketChannel::sendInternal() 303 void DocumentWebSocketChannel::sendInternal()
304 { 304 {
305 ASSERT(m_handle); 305 ASSERT(m_handle);
306 unsigned long consumedBufferedAmount = 0; 306 unsigned consumedBufferedAmount = 0;
307 while (!m_messages.isEmpty() && !m_blobLoader) { 307 while (!m_messages.isEmpty() && !m_blobLoader) {
308 bool final = false; 308 bool final = false;
309 Message* message = m_messages.first().get(); 309 Message* message = m_messages.first().get();
310 if (m_sendingQuota <= 0 && message->type != MessageTypeClose) 310 if (m_sendingQuota <= 0 && message->type != MessageTypeClose)
311 break; 311 break;
312 switch (message->type) { 312 switch (message->type) {
313 case MessageTypeText: { 313 case MessageTypeText: {
314 WebSocketHandle::MessageType type = 314 WebSocketHandle::MessageType type =
315 m_sentSizeOfTopMessage ? WebSocketHandle::MessageTypeContinuatio n : WebSocketHandle::MessageTypeText; 315 m_sentSizeOfTopMessage ? WebSocketHandle::MessageTypeContinuatio n : WebSocketHandle::MessageTypeText;
316 size_t size = std::min(static_cast<size_t>(m_sendingQuota), message- >text.length() - m_sentSizeOfTopMessage); 316 size_t size = std::min(static_cast<size_t>(m_sendingQuota), message- >text.length() - m_sentSizeOfTopMessage);
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
585 } 585 }
586 586
587 void DocumentWebSocketChannel::trace(Visitor* visitor) 587 void DocumentWebSocketChannel::trace(Visitor* visitor)
588 { 588 {
589 visitor->trace(m_blobLoader); 589 visitor->trace(m_blobLoader);
590 visitor->trace(m_client); 590 visitor->trace(m_client);
591 WebSocketChannel::trace(visitor); 591 WebSocketChannel::trace(visitor);
592 } 592 }
593 593
594 } // namespace blink 594 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/websockets/DOMWebSocketTest.cpp ('k') | Source/modules/websockets/DocumentWebSocketChannelTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698