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

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

Issue 2668903003: Replace WTF::emptyString{16Bit}() with a static global (Closed)
Patch Set: Replace WTF::emptyString{16Bit}() with a static global Created 3 years, 10 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 542 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 WebSocketFrame::OpCode opcode = m_receivingMessageTypeIsText 553 WebSocketFrame::OpCode opcode = m_receivingMessageTypeIsText
554 ? WebSocketFrame::OpCodeText 554 ? WebSocketFrame::OpCodeText
555 : WebSocketFrame::OpCodeBinary; 555 : WebSocketFrame::OpCodeBinary;
556 WebSocketFrame frame(opcode, m_receivingMessageData.data(), 556 WebSocketFrame frame(opcode, m_receivingMessageData.data(),
557 m_receivingMessageData.size(), WebSocketFrame::Final); 557 m_receivingMessageData.size(), WebSocketFrame::Final);
558 InspectorInstrumentation::didReceiveWebSocketFrame( 558 InspectorInstrumentation::didReceiveWebSocketFrame(
559 document(), m_identifier, frame.opCode, frame.masked, frame.payload, 559 document(), m_identifier, frame.opCode, frame.masked, frame.payload,
560 frame.payloadLength); 560 frame.payloadLength);
561 if (m_receivingMessageTypeIsText) { 561 if (m_receivingMessageTypeIsText) {
562 String message = m_receivingMessageData.isEmpty() 562 String message = m_receivingMessageData.isEmpty()
563 ? emptyString() 563 ? emptyString
564 : String::fromUTF8(m_receivingMessageData.data(), 564 : String::fromUTF8(m_receivingMessageData.data(),
565 m_receivingMessageData.size()); 565 m_receivingMessageData.size());
566 m_receivingMessageData.clear(); 566 m_receivingMessageData.clear();
567 if (message.isNull()) { 567 if (message.isNull()) {
568 failAsError("Could not decode a text frame as UTF-8."); 568 failAsError("Could not decode a text frame as UTF-8.");
569 // failAsError may delete this object. 569 // failAsError may delete this object.
570 } else { 570 } else {
571 m_client->didReceiveTextMessage(message); 571 m_client->didReceiveTextMessage(message);
572 } 572 }
573 } else { 573 } else {
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
657 WebSocketChannel::trace(visitor); 657 WebSocketChannel::trace(visitor);
658 } 658 }
659 659
660 std::ostream& operator<<(std::ostream& ostream, 660 std::ostream& operator<<(std::ostream& ostream,
661 const DocumentWebSocketChannel* channel) { 661 const DocumentWebSocketChannel* channel) {
662 return ostream << "DocumentWebSocketChannel " 662 return ostream << "DocumentWebSocketChannel "
663 << static_cast<const void*>(channel); 663 << static_cast<const void*>(channel);
664 } 664 }
665 665
666 } // namespace blink 666 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698