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

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

Issue 1878463002: Move DOMArrayBuffer, DOMArrayBufferViews and DataView to the heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tidy Created 4 years, 8 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 635 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(blobData.release(), siz e));
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 RefPtr<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.release(), Secur ityOrigin::create(m_url)->toString())); 658 m_eventQueue->dispatch(MessageEvent::create(arrayBuffer, SecurityOrigin: :create(m_url)->toString()));
659 break; 659 break;
660 } 660 }
661 } 661 }
662 662
663 void DOMWebSocket::didError() 663 void DOMWebSocket::didError()
664 { 664 {
665 WTF_LOG(Network, "WebSocket %p didError()", this); 665 WTF_LOG(Network, "WebSocket %p didError()", this);
666 m_state = CLOSED; 666 m_state = CLOSED;
667 m_eventQueue->dispatch(Event::create(EventTypeNames::error)); 667 m_eventQueue->dispatch(Event::create(EventTypeNames::error));
668 } 668 }
(...skipping 45 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 RefCountedGarbageCollectedEventTargetWithInlineData<DOMWebSocket>::trace(vis itor); 719 RefCountedGarbageCollectedEventTargetWithInlineData<DOMWebSocket>::trace(vis itor);
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