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

Side by Side Diff: third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.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) 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 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
501 m_receivingMessageData.clear(); 501 m_receivingMessageData.clear();
502 if (message.isNull()) { 502 if (message.isNull()) {
503 failAsError("Could not decode a text frame as UTF-8."); 503 failAsError("Could not decode a text frame as UTF-8.");
504 // failAsError may delete this object. 504 // failAsError may delete this object.
505 } else { 505 } else {
506 m_client->didReceiveTextMessage(message); 506 m_client->didReceiveTextMessage(message);
507 } 507 }
508 } else { 508 } else {
509 OwnPtr<Vector<char>> binaryData = adoptPtr(new Vector<char>); 509 OwnPtr<Vector<char>> binaryData = adoptPtr(new Vector<char>);
510 binaryData->swap(m_receivingMessageData); 510 binaryData->swap(m_receivingMessageData);
511 m_client->didReceiveBinaryMessage(binaryData.release()); 511 m_client->didReceiveBinaryMessage(std::move(binaryData));
512 } 512 }
513 } 513 }
514 514
515 void DocumentWebSocketChannel::didClose(WebSocketHandle* handle, bool wasClean, unsigned short code, const WebString& reason) 515 void DocumentWebSocketChannel::didClose(WebSocketHandle* handle, bool wasClean, unsigned short code, const WebString& reason)
516 { 516 {
517 WTF_LOG(Network, "DocumentWebSocketChannel %p didClose(%p, %d, %u, %s)", thi s, handle, wasClean, code, String(reason).utf8().data()); 517 WTF_LOG(Network, "DocumentWebSocketChannel %p didClose(%p, %d, %u, %s)", thi s, handle, wasClean, code, String(reason).utf8().data());
518 518
519 ASSERT(m_handle); 519 ASSERT(m_handle);
520 ASSERT(handle == m_handle); 520 ASSERT(handle == m_handle);
521 521
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
580 DEFINE_TRACE(DocumentWebSocketChannel) 580 DEFINE_TRACE(DocumentWebSocketChannel)
581 { 581 {
582 visitor->trace(m_blobLoader); 582 visitor->trace(m_blobLoader);
583 visitor->trace(m_messages); 583 visitor->trace(m_messages);
584 visitor->trace(m_client); 584 visitor->trace(m_client);
585 WebSocketChannel::trace(visitor); 585 WebSocketChannel::trace(visitor);
586 ContextLifecycleObserver::trace(visitor); 586 ContextLifecycleObserver::trace(visitor);
587 } 587 }
588 588
589 } // namespace blink 589 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698