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

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

Issue 871013007: Use enum BinaryType for WebSocket.binaryType, instead of DOMString (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 8 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) 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 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
545 void DOMWebSocket::setBinaryType(const String& binaryType) 545 void DOMWebSocket::setBinaryType(const String& binaryType)
546 { 546 {
547 if (binaryType == "blob") { 547 if (binaryType == "blob") {
548 m_binaryType = BinaryTypeBlob; 548 m_binaryType = BinaryTypeBlob;
549 return; 549 return;
550 } 550 }
551 if (binaryType == "arraybuffer") { 551 if (binaryType == "arraybuffer") {
552 m_binaryType = BinaryTypeArrayBuffer; 552 m_binaryType = BinaryTypeArrayBuffer;
553 return; 553 return;
554 } 554 }
555 logError("'" + binaryType + "' is not a valid value for binaryType; binaryTy pe remains unchanged."); 555 ASSERT_NOT_REACHED();
556 } 556 }
557 557
558 const AtomicString& DOMWebSocket::interfaceName() const 558 const AtomicString& DOMWebSocket::interfaceName() const
559 { 559 {
560 return EventTargetNames::DOMWebSocket; 560 return EventTargetNames::DOMWebSocket;
561 } 561 }
562 562
563 ExecutionContext* DOMWebSocket::executionContext() const 563 ExecutionContext* DOMWebSocket::executionContext() const
564 { 564 {
565 return ActiveDOMObject::executionContext(); 565 return ActiveDOMObject::executionContext();
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
684 DEFINE_TRACE(DOMWebSocket) 684 DEFINE_TRACE(DOMWebSocket)
685 { 685 {
686 visitor->trace(m_channel); 686 visitor->trace(m_channel);
687 visitor->trace(m_eventQueue); 687 visitor->trace(m_eventQueue);
688 WebSocketChannelClient::trace(visitor); 688 WebSocketChannelClient::trace(visitor);
689 RefCountedGarbageCollectedEventTargetWithInlineData<DOMWebSocket>::trace(vis itor); 689 RefCountedGarbageCollectedEventTargetWithInlineData<DOMWebSocket>::trace(vis itor);
690 ActiveDOMObject::trace(visitor); 690 ActiveDOMObject::trace(visitor);
691 } 691 }
692 692
693 } // namespace blink 693 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/http/tests/websocket/binary-type-expected.txt ('k') | Source/modules/websockets/DOMWebSocketTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698