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

Side by Side Diff: third_party/WebKit/Source/modules/presentation/PresentationConnection.cpp

Issue 1978173002: Remove OwnPtr::release() calls in modules/ (part 2). (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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "modules/presentation/PresentationConnection.h" 5 #include "modules/presentation/PresentationConnection.h"
6 6
7 #include "bindings/core/v8/ScriptPromiseResolver.h" 7 #include "bindings/core/v8/ScriptPromiseResolver.h"
8 #include "core/dom/DOMArrayBuffer.h" 8 #include "core/dom/DOMArrayBuffer.h"
9 #include "core/dom/DOMArrayBufferView.h" 9 #include "core/dom/DOMArrayBufferView.h"
10 #include "core/dom/Document.h" 10 #include "core/dom/Document.h"
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 350
351 void PresentationConnection::didReceiveBinaryMessage(const uint8_t* data, size_t length) 351 void PresentationConnection::didReceiveBinaryMessage(const uint8_t* data, size_t length)
352 { 352 {
353 if (m_state != WebPresentationConnectionState::Connected) 353 if (m_state != WebPresentationConnectionState::Connected)
354 return; 354 return;
355 355
356 switch (m_binaryType) { 356 switch (m_binaryType) {
357 case BinaryTypeBlob: { 357 case BinaryTypeBlob: {
358 OwnPtr<BlobData> blobData = BlobData::create(); 358 OwnPtr<BlobData> blobData = BlobData::create();
359 blobData->appendBytes(data, length); 359 blobData->appendBytes(data, length);
360 Blob* blob = Blob::create(BlobDataHandle::create(blobData.release(), len gth)); 360 Blob* blob = Blob::create(BlobDataHandle::create(std::move(blobData), le ngth));
361 dispatchEvent(MessageEvent::create(blob)); 361 dispatchEvent(MessageEvent::create(blob));
362 return; 362 return;
363 } 363 }
364 case BinaryTypeArrayBuffer: 364 case BinaryTypeArrayBuffer:
365 DOMArrayBuffer* buffer = DOMArrayBuffer::create(data, length); 365 DOMArrayBuffer* buffer = DOMArrayBuffer::create(data, length);
366 dispatchEvent(MessageEvent::create(buffer)); 366 dispatchEvent(MessageEvent::create(buffer));
367 return; 367 return;
368 } 368 }
369 ASSERT_NOT_REACHED(); 369 ASSERT_NOT_REACHED();
370 } 370 }
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 { 453 {
454 // Cancel current Blob loading if any. 454 // Cancel current Blob loading if any.
455 if (m_blobLoader) { 455 if (m_blobLoader) {
456 m_blobLoader->cancel(); 456 m_blobLoader->cancel();
457 m_blobLoader.clear(); 457 m_blobLoader.clear();
458 } 458 }
459 m_messages.clear(); 459 m_messages.clear();
460 } 460 }
461 461
462 } // namespace blink 462 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698