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

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

Issue 1456463002: [WebSocket] Remove release assertions that are no longer needed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 | « no previous file | third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.h » ('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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 , m_binaryType(BinaryTypeBlob) 227 , m_binaryType(BinaryTypeBlob)
228 , m_subprotocol("") 228 , m_subprotocol("")
229 , m_extensions("") 229 , m_extensions("")
230 , m_eventQueue(EventQueue::create(this)) 230 , m_eventQueue(EventQueue::create(this))
231 , m_bufferedAmountConsumeTimer(this, &DOMWebSocket::reflectBufferedAmountCon sumption) 231 , m_bufferedAmountConsumeTimer(this, &DOMWebSocket::reflectBufferedAmountCon sumption)
232 { 232 {
233 } 233 }
234 234
235 DOMWebSocket::~DOMWebSocket() 235 DOMWebSocket::~DOMWebSocket()
236 { 236 {
237 WebSocketChannel* channel = m_channel; 237 ASSERT(!m_channel);
238 // TODO(yhirano): Use ASSERT instead when crbug.com/550632 is fixed.
239 RELEASE_ASSERT(!channel);
240 } 238 }
241 239
242 void DOMWebSocket::logError(const String& message) 240 void DOMWebSocket::logError(const String& message)
243 { 241 {
244 executionContext()->addConsoleMessage(ConsoleMessage::create(JSMessageSource , ErrorMessageLevel, message)); 242 executionContext()->addConsoleMessage(ConsoleMessage::create(JSMessageSource , ErrorMessageLevel, message));
245 } 243 }
246 244
247 DOMWebSocket* DOMWebSocket::create(ExecutionContext* context, const String& url, ExceptionState& exceptionState) 245 DOMWebSocket* DOMWebSocket::create(ExecutionContext* context, const String& url, ExceptionState& exceptionState)
248 { 246 {
249 StringOrStringSequence protocols; 247 StringOrStringSequence protocols;
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
566 } 564 }
567 565
568 ExecutionContext* DOMWebSocket::executionContext() const 566 ExecutionContext* DOMWebSocket::executionContext() const
569 { 567 {
570 return ActiveDOMObject::executionContext(); 568 return ActiveDOMObject::executionContext();
571 } 569 }
572 570
573 void DOMWebSocket::contextDestroyed() 571 void DOMWebSocket::contextDestroyed()
574 { 572 {
575 WTF_LOG(Network, "WebSocket %p contextDestroyed()", this); 573 WTF_LOG(Network, "WebSocket %p contextDestroyed()", this);
576 // TODO(yhirano): Use ASSERT instead when crbug.com/550632 is fixed. 574 ASSERT(!m_channel);
577 RELEASE_ASSERT(!m_channel);
578 ASSERT(m_state == CLOSED); 575 ASSERT(m_state == CLOSED);
579 ActiveDOMObject::contextDestroyed(); 576 ActiveDOMObject::contextDestroyed();
580 } 577 }
581 578
582 bool DOMWebSocket::hasPendingActivity() const 579 bool DOMWebSocket::hasPendingActivity() const
583 { 580 {
584 return m_channel || !m_eventQueue->isEmpty(); 581 return m_channel || !m_eventQueue->isEmpty();
585 } 582 }
586 583
587 void DOMWebSocket::suspend() 584 void DOMWebSocket::suspend()
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
690 DEFINE_TRACE(DOMWebSocket) 687 DEFINE_TRACE(DOMWebSocket)
691 { 688 {
692 visitor->trace(m_channel); 689 visitor->trace(m_channel);
693 visitor->trace(m_eventQueue); 690 visitor->trace(m_eventQueue);
694 WebSocketChannelClient::trace(visitor); 691 WebSocketChannelClient::trace(visitor);
695 RefCountedGarbageCollectedEventTargetWithInlineData<DOMWebSocket>::trace(vis itor); 692 RefCountedGarbageCollectedEventTargetWithInlineData<DOMWebSocket>::trace(vis itor);
696 ActiveDOMObject::trace(visitor); 693 ActiveDOMObject::trace(visitor);
697 } 694 }
698 695
699 } // namespace blink 696 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698