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

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

Issue 1999463002: Cleanup ConsoleMessage interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@console-message-callstack-in-constructor
Patch Set: PassRefPtr + win 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 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 processSendQueue(); 256 processSendQueue();
257 } 257 }
258 258
259 void DocumentWebSocketChannel::fail(const String& reason, MessageLevel level, co nst String& sourceURL, unsigned lineNumber) 259 void DocumentWebSocketChannel::fail(const String& reason, MessageLevel level, co nst String& sourceURL, unsigned lineNumber)
260 { 260 {
261 WTF_LOG(Network, "DocumentWebSocketChannel %p fail(%s)", this, reason.utf8() .data()); 261 WTF_LOG(Network, "DocumentWebSocketChannel %p fail(%s)", this, reason.utf8() .data());
262 // m_handle and m_client can be null here. 262 // m_handle and m_client can be null here.
263 263
264 InspectorInstrumentation::didReceiveWebSocketFrameError(document(), m_identi fier, reason); 264 InspectorInstrumentation::didReceiveWebSocketFrameError(document(), m_identi fier, reason);
265 const String message = "WebSocket connection to '" + m_url.elidedString() + "' failed: " + reason; 265 const String message = "WebSocket connection to '" + m_url.elidedString() + "' failed: " + reason;
266 getExecutionContext()->addConsoleMessage(ConsoleMessage::create(JSMessageSou rce, level, message, sourceURL, lineNumber)); 266 getExecutionContext()->addConsoleMessage(ConsoleMessage::create(JSMessageSou rce, level, message, sourceURL, lineNumber, 0));
267 267
268 if (m_client) 268 if (m_client)
269 m_client->didError(); 269 m_client->didError();
270 // |reason| is only for logging and should not be provided for scripts, 270 // |reason| is only for logging and should not be provided for scripts,
271 // hence close reason must be empty. 271 // hence close reason must be empty.
272 handleDidClose(false, CloseEventCodeAbnormalClosure, String()); 272 handleDidClose(false, CloseEventCodeAbnormalClosure, String());
273 // handleDidClose may delete this object. 273 // handleDidClose may delete this object.
274 } 274 }
275 275
276 void DocumentWebSocketChannel::disconnect() 276 void DocumentWebSocketChannel::disconnect()
(...skipping 303 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