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

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

Issue 176853004: Oilpan: move core/fileapi to oilpan's heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased Created 6 years, 9 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
« no previous file with comments | « Source/modules/webmidi/MIDIAccessPromise.cpp ('k') | Source/web/WebBlob.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 27 matching lines...) Expand all
38 #include "core/dom/ExceptionCode.h" 38 #include "core/dom/ExceptionCode.h"
39 #include "core/dom/ExecutionContext.h" 39 #include "core/dom/ExecutionContext.h"
40 #include "core/events/Event.h" 40 #include "core/events/Event.h"
41 #include "core/events/MessageEvent.h" 41 #include "core/events/MessageEvent.h"
42 #include "core/fileapi/Blob.h" 42 #include "core/fileapi/Blob.h"
43 #include "core/frame/ConsoleTypes.h" 43 #include "core/frame/ConsoleTypes.h"
44 #include "core/frame/ContentSecurityPolicy.h" 44 #include "core/frame/ContentSecurityPolicy.h"
45 #include "core/frame/DOMWindow.h" 45 #include "core/frame/DOMWindow.h"
46 #include "core/frame/LocalFrame.h" 46 #include "core/frame/LocalFrame.h"
47 #include "core/inspector/ScriptCallStack.h" 47 #include "core/inspector/ScriptCallStack.h"
48 #include "heap/Handle.h"
48 #include "modules/websockets/CloseEvent.h" 49 #include "modules/websockets/CloseEvent.h"
49 #include "platform/Logging.h" 50 #include "platform/Logging.h"
50 #include "platform/blob/BlobData.h" 51 #include "platform/blob/BlobData.h"
51 #include "platform/weborigin/KnownPorts.h" 52 #include "platform/weborigin/KnownPorts.h"
52 #include "platform/weborigin/SecurityOrigin.h" 53 #include "platform/weborigin/SecurityOrigin.h"
53 #include "wtf/ArrayBuffer.h" 54 #include "wtf/ArrayBuffer.h"
54 #include "wtf/ArrayBufferView.h" 55 #include "wtf/ArrayBufferView.h"
55 #include "wtf/HashSet.h" 56 #include "wtf/HashSet.h"
56 #include "wtf/PassOwnPtr.h" 57 #include "wtf/PassOwnPtr.h"
57 #include "wtf/StdLibExtras.h" 58 #include "wtf/StdLibExtras.h"
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after
620 void WebSocket::didReceiveBinaryData(PassOwnPtr<Vector<char> > binaryData) 621 void WebSocket::didReceiveBinaryData(PassOwnPtr<Vector<char> > binaryData)
621 { 622 {
622 WTF_LOG(Network, "WebSocket %p didReceiveBinaryData() %lu byte binary messag e", this, static_cast<unsigned long>(binaryData->size())); 623 WTF_LOG(Network, "WebSocket %p didReceiveBinaryData() %lu byte binary messag e", this, static_cast<unsigned long>(binaryData->size()));
623 switch (m_binaryType) { 624 switch (m_binaryType) {
624 case BinaryTypeBlob: { 625 case BinaryTypeBlob: {
625 size_t size = binaryData->size(); 626 size_t size = binaryData->size();
626 RefPtr<RawData> rawData = RawData::create(); 627 RefPtr<RawData> rawData = RawData::create();
627 binaryData->swap(*rawData->mutableData()); 628 binaryData->swap(*rawData->mutableData());
628 OwnPtr<BlobData> blobData = BlobData::create(); 629 OwnPtr<BlobData> blobData = BlobData::create();
629 blobData->appendData(rawData.release(), 0, BlobDataItem::toEndOfFile); 630 blobData->appendData(rawData.release(), 0, BlobDataItem::toEndOfFile);
630 RefPtr<Blob> blob = Blob::create(BlobDataHandle::create(blobData.release (), size)); 631 RefPtrWillBeRawPtr<Blob> blob = Blob::create(BlobDataHandle::create(blob Data.release(), size));
631 m_eventQueue->dispatch(MessageEvent::create(blob.release(), SecurityOrig in::create(m_url)->toString())); 632 m_eventQueue->dispatch(MessageEvent::create(blob.release(), SecurityOrig in::create(m_url)->toString()));
632 break; 633 break;
633 } 634 }
634 635
635 case BinaryTypeArrayBuffer: 636 case BinaryTypeArrayBuffer:
636 m_eventQueue->dispatch(MessageEvent::create(ArrayBuffer::create(binaryDa ta->data(), binaryData->size()), SecurityOrigin::create(m_url)->toString())); 637 m_eventQueue->dispatch(MessageEvent::create(ArrayBuffer::create(binaryDa ta->data(), binaryData->size()), SecurityOrigin::create(m_url)->toString()));
637 break; 638 break;
638 } 639 }
639 } 640 }
640 641
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
680 static const size_t minimumPayloadSizeWithEightByteExtendedPayloadLength = 0 x10000; 681 static const size_t minimumPayloadSizeWithEightByteExtendedPayloadLength = 0 x10000;
681 size_t overhead = hybiBaseFramingOverhead + hybiMaskingKeyLength; 682 size_t overhead = hybiBaseFramingOverhead + hybiMaskingKeyLength;
682 if (payloadSize >= minimumPayloadSizeWithEightByteExtendedPayloadLength) 683 if (payloadSize >= minimumPayloadSizeWithEightByteExtendedPayloadLength)
683 overhead += 8; 684 overhead += 8;
684 else if (payloadSize >= minimumPayloadSizeWithTwoByteExtendedPayloadLength) 685 else if (payloadSize >= minimumPayloadSizeWithTwoByteExtendedPayloadLength)
685 overhead += 2; 686 overhead += 2;
686 return overhead; 687 return overhead;
687 } 688 }
688 689
689 } // namespace WebCore 690 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/modules/webmidi/MIDIAccessPromise.cpp ('k') | Source/web/WebBlob.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698