| OLD | NEW |
| 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 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 560 // The loaded blob is always placed on m_messages[0]. | 560 // The loaded blob is always placed on m_messages[0]. |
| 561 ASSERT(m_messages.size() > 0 && m_messages.first()->type == MessageTypeBlob)
; | 561 ASSERT(m_messages.size() > 0 && m_messages.first()->type == MessageTypeBlob)
; |
| 562 // We replace it with the loaded blob. | 562 // We replace it with the loaded blob. |
| 563 m_messages.first() = new Message(buffer); | 563 m_messages.first() = new Message(buffer); |
| 564 processSendQueue(); | 564 processSendQueue(); |
| 565 } | 565 } |
| 566 | 566 |
| 567 void DocumentWebSocketChannel::didFailLoadingBlob(FileError::ErrorCode errorCode
) | 567 void DocumentWebSocketChannel::didFailLoadingBlob(FileError::ErrorCode errorCode
) |
| 568 { | 568 { |
| 569 m_blobLoader.clear(); | 569 m_blobLoader.clear(); |
| 570 if (errorCode == FileError::ABORT_ERR) { | 570 if (errorCode == FileError::kAbortErr) { |
| 571 // The error is caused by cancel(). | 571 // The error is caused by cancel(). |
| 572 return; | 572 return; |
| 573 } | 573 } |
| 574 // FIXME: Generate human-friendly reason message. | 574 // FIXME: Generate human-friendly reason message. |
| 575 failAsError("Failed to load Blob: error code = " + String::number(errorCode)
); | 575 failAsError("Failed to load Blob: error code = " + String::number(errorCode)
); |
| 576 // |this| can be deleted here. | 576 // |this| can be deleted here. |
| 577 } | 577 } |
| 578 | 578 |
| 579 DEFINE_TRACE(DocumentWebSocketChannel) | 579 DEFINE_TRACE(DocumentWebSocketChannel) |
| 580 { | 580 { |
| 581 visitor->trace(m_blobLoader); | 581 visitor->trace(m_blobLoader); |
| 582 visitor->trace(m_messages); | 582 visitor->trace(m_messages); |
| 583 visitor->trace(m_client); | 583 visitor->trace(m_client); |
| 584 WebSocketChannel::trace(visitor); | 584 WebSocketChannel::trace(visitor); |
| 585 ContextLifecycleObserver::trace(visitor); | 585 ContextLifecycleObserver::trace(visitor); |
| 586 } | 586 } |
| 587 | 587 |
| 588 } // namespace blink | 588 } // namespace blink |
| OLD | NEW |