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

Side by Side Diff: third_party/WebKit/Source/modules/websockets/DOMWebSocket.cpp

Issue 1979953002: Remove OwnPtr::release() calls in modules/ (part 3). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months 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) 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 628 matching lines...) Expand 10 before | Expand all | Expand 10 after
639 void DOMWebSocket::didReceiveBinaryMessage(PassOwnPtr<Vector<char>> binaryData) 639 void DOMWebSocket::didReceiveBinaryMessage(PassOwnPtr<Vector<char>> binaryData)
640 { 640 {
641 WTF_LOG(Network, "WebSocket %p didReceiveBinaryMessage() %lu byte binary mes sage", this, static_cast<unsigned long>(binaryData->size())); 641 WTF_LOG(Network, "WebSocket %p didReceiveBinaryMessage() %lu byte binary mes sage", this, static_cast<unsigned long>(binaryData->size()));
642 switch (m_binaryType) { 642 switch (m_binaryType) {
643 case BinaryTypeBlob: { 643 case BinaryTypeBlob: {
644 size_t size = binaryData->size(); 644 size_t size = binaryData->size();
645 RefPtr<RawData> rawData = RawData::create(); 645 RefPtr<RawData> rawData = RawData::create();
646 binaryData->swap(*rawData->mutableData()); 646 binaryData->swap(*rawData->mutableData());
647 OwnPtr<BlobData> blobData = BlobData::create(); 647 OwnPtr<BlobData> blobData = BlobData::create();
648 blobData->appendData(rawData.release(), 0, BlobDataItem::toEndOfFile); 648 blobData->appendData(rawData.release(), 0, BlobDataItem::toEndOfFile);
649 Blob* blob = Blob::create(BlobDataHandle::create(blobData.release(), siz e)); 649 Blob* blob = Blob::create(BlobDataHandle::create(std::move(blobData), si ze));
650 recordReceiveTypeHistogram(WebSocketReceiveTypeBlob); 650 recordReceiveTypeHistogram(WebSocketReceiveTypeBlob);
651 m_eventQueue->dispatch(MessageEvent::create(blob, SecurityOrigin::create (m_url)->toString())); 651 m_eventQueue->dispatch(MessageEvent::create(blob, SecurityOrigin::create (m_url)->toString()));
652 break; 652 break;
653 } 653 }
654 654
655 case BinaryTypeArrayBuffer: 655 case BinaryTypeArrayBuffer:
656 DOMArrayBuffer* arrayBuffer = DOMArrayBuffer::create(binaryData->data(), binaryData->size()); 656 DOMArrayBuffer* arrayBuffer = DOMArrayBuffer::create(binaryData->data(), binaryData->size());
657 recordReceiveTypeHistogram(WebSocketReceiveTypeArrayBuffer); 657 recordReceiveTypeHistogram(WebSocketReceiveTypeArrayBuffer);
658 m_eventQueue->dispatch(MessageEvent::create(arrayBuffer, SecurityOrigin: :create(m_url)->toString())); 658 m_eventQueue->dispatch(MessageEvent::create(arrayBuffer, SecurityOrigin: :create(m_url)->toString()));
659 break; 659 break;
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
714 DEFINE_TRACE(DOMWebSocket) 714 DEFINE_TRACE(DOMWebSocket)
715 { 715 {
716 visitor->trace(m_channel); 716 visitor->trace(m_channel);
717 visitor->trace(m_eventQueue); 717 visitor->trace(m_eventQueue);
718 WebSocketChannelClient::trace(visitor); 718 WebSocketChannelClient::trace(visitor);
719 EventTargetWithInlineData::trace(visitor); 719 EventTargetWithInlineData::trace(visitor);
720 ActiveDOMObject::trace(visitor); 720 ActiveDOMObject::trace(visitor);
721 } 721 }
722 722
723 } // namespace blink 723 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698