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

Side by Side Diff: Source/core/inspector/InspectorResourceAgent.cpp

Issue 951313002: DevTools: NetworkPanel: Support unicode WS messages. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | no next file » | 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 746 matching lines...) Expand 10 before | Expand all | Expand 10 after
757 void InspectorResourceAgent::didCloseWebSocket(Document*, unsigned long identifi er) 757 void InspectorResourceAgent::didCloseWebSocket(Document*, unsigned long identifi er)
758 { 758 {
759 m_frontend->webSocketClosed(IdentifiersFactory::requestId(identifier), curre ntTime()); 759 m_frontend->webSocketClosed(IdentifiersFactory::requestId(identifier), curre ntTime());
760 } 760 }
761 761
762 void InspectorResourceAgent::didReceiveWebSocketFrame(unsigned long identifier, int opCode, bool masked, const char* payload, size_t payloadLength) 762 void InspectorResourceAgent::didReceiveWebSocketFrame(unsigned long identifier, int opCode, bool masked, const char* payload, size_t payloadLength)
763 { 763 {
764 RefPtr<TypeBuilder::Network::WebSocketFrame> frameObject = TypeBuilder::Netw ork::WebSocketFrame::create() 764 RefPtr<TypeBuilder::Network::WebSocketFrame> frameObject = TypeBuilder::Netw ork::WebSocketFrame::create()
765 .setOpcode(opCode) 765 .setOpcode(opCode)
766 .setMask(masked) 766 .setMask(masked)
767 .setPayloadData(String(payload, payloadLength)); 767 .setPayloadData(String::fromUTF8WithLatin1Fallback(payload, payloadLengt h));
768 m_frontend->webSocketFrameReceived(IdentifiersFactory::requestId(identifier) , currentTime(), frameObject); 768 m_frontend->webSocketFrameReceived(IdentifiersFactory::requestId(identifier) , currentTime(), frameObject);
769 } 769 }
770 770
771 void InspectorResourceAgent::didSendWebSocketFrame(unsigned long identifier, int opCode, bool masked, const char* payload, size_t payloadLength) 771 void InspectorResourceAgent::didSendWebSocketFrame(unsigned long identifier, int opCode, bool masked, const char* payload, size_t payloadLength)
772 { 772 {
773 RefPtr<TypeBuilder::Network::WebSocketFrame> frameObject = TypeBuilder::Netw ork::WebSocketFrame::create() 773 RefPtr<TypeBuilder::Network::WebSocketFrame> frameObject = TypeBuilder::Netw ork::WebSocketFrame::create()
774 .setOpcode(opCode) 774 .setOpcode(opCode)
775 .setMask(masked) 775 .setMask(masked)
776 .setPayloadData(String(payload, payloadLength)); 776 .setPayloadData(String::fromUTF8WithLatin1Fallback(payload, payloadLengt h));
777 m_frontend->webSocketFrameSent(IdentifiersFactory::requestId(identifier), cu rrentTime(), frameObject); 777 m_frontend->webSocketFrameSent(IdentifiersFactory::requestId(identifier), cu rrentTime(), frameObject);
778 } 778 }
779 779
780 void InspectorResourceAgent::didReceiveWebSocketFrameError(unsigned long identif ier, const String& errorMessage) 780 void InspectorResourceAgent::didReceiveWebSocketFrameError(unsigned long identif ier, const String& errorMessage)
781 { 781 {
782 m_frontend->webSocketFrameError(IdentifiersFactory::requestId(identifier), c urrentTime(), errorMessage); 782 m_frontend->webSocketFrameError(IdentifiersFactory::requestId(identifier), c urrentTime(), errorMessage);
783 } 783 }
784 784
785 void InspectorResourceAgent::enable(ErrorString*) 785 void InspectorResourceAgent::enable(ErrorString*)
786 { 786 {
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
1031 , m_removeFinishedReplayXHRTimer(this, &InspectorResourceAgent::removeFinish edReplayXHRFired) 1031 , m_removeFinishedReplayXHRTimer(this, &InspectorResourceAgent::removeFinish edReplayXHRFired)
1032 { 1032 {
1033 } 1033 }
1034 1034
1035 bool InspectorResourceAgent::shouldForceCORSPreflight() 1035 bool InspectorResourceAgent::shouldForceCORSPreflight()
1036 { 1036 {
1037 return m_state->getBoolean(ResourceAgentState::cacheDisabled); 1037 return m_state->getBoolean(ResourceAgentState::cacheDisabled);
1038 } 1038 }
1039 1039
1040 } // namespace blink 1040 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698