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

Side by Side Diff: third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.cpp

Issue 2094903002: [Devtools] Fixed websocket initiators (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed initiators for websockets Created 4 years, 6 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 801 matching lines...) Expand 10 before | Expand all | Expand 10 after
812 return initiatorObject; 812 return initiatorObject;
813 } 813 }
814 814
815 if (m_isRecalculatingStyle && m_styleRecalculationInitiator) 815 if (m_isRecalculatingStyle && m_styleRecalculationInitiator)
816 return m_styleRecalculationInitiator->clone(); 816 return m_styleRecalculationInitiator->clone();
817 817
818 return protocol::Network::Initiator::create() 818 return protocol::Network::Initiator::create()
819 .setType(protocol::Network::Initiator::TypeEnum::Other).build(); 819 .setType(protocol::Network::Initiator::TypeEnum::Other).build();
820 } 820 }
821 821
822 void InspectorNetworkAgent::didCreateWebSocket(Document*, unsigned long identifi er, const KURL& requestURL, const String&) 822 void InspectorNetworkAgent::didCreateWebSocket(Document* document, unsigned long identifier, const KURL& requestURL, const String&)
823 { 823 {
824 frontend()->webSocketCreated(IdentifiersFactory::requestId(identifier), urlW ithoutFragment(requestURL).getString()); 824 std::unique_ptr<protocol::Runtime::StackTrace> currentStackTrace = SourceLoc ation::capture(document)->buildInspectorObject();
825 DCHECK(currentStackTrace);
dgozman 2016/06/24 20:21:03 This DCHECK looks suspicious. What if websocket wa
826 std::unique_ptr<protocol::Network::Initiator> initiatorObject = protocol::Ne twork::Initiator::create()
827 .setType(protocol::Network::Initiator::TypeEnum::Script).build();
828 initiatorObject->setStack(std::move(currentStackTrace));
829
830 frontend()->webSocketCreated(IdentifiersFactory::requestId(identifier), urlW ithoutFragment(requestURL).getString(), std::move(initiatorObject));
825 } 831 }
826 832
827 void InspectorNetworkAgent::willSendWebSocketHandshakeRequest(Document*, unsigne d long identifier, const WebSocketHandshakeRequest* request) 833 void InspectorNetworkAgent::willSendWebSocketHandshakeRequest(Document*, unsigne d long identifier, const WebSocketHandshakeRequest* request)
828 { 834 {
829 DCHECK(request); 835 DCHECK(request);
830 std::unique_ptr<protocol::Network::WebSocketRequest> requestObject = protoco l::Network::WebSocketRequest::create() 836 std::unique_ptr<protocol::Network::WebSocketRequest> requestObject = protoco l::Network::WebSocketRequest::create()
831 .setHeaders(buildObjectForHeaders(request->headerFields())).build(); 837 .setHeaders(buildObjectForHeaders(request->headerFields())).build();
832 frontend()->webSocketWillSendHandshakeRequest(IdentifiersFactory::requestId( identifier), monotonicallyIncreasingTime(), currentTime(), std::move(requestObje ct)); 838 frontend()->webSocketWillSendHandshakeRequest(IdentifiersFactory::requestId( identifier), monotonicallyIncreasingTime(), currentTime(), std::move(requestObje ct));
833 } 839 }
834 840
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
1123 , m_removeFinishedReplayXHRTimer(this, &InspectorNetworkAgent::removeFinishe dReplayXHRFired) 1129 , m_removeFinishedReplayXHRTimer(this, &InspectorNetworkAgent::removeFinishe dReplayXHRFired)
1124 { 1130 {
1125 } 1131 }
1126 1132
1127 bool InspectorNetworkAgent::shouldForceCORSPreflight() 1133 bool InspectorNetworkAgent::shouldForceCORSPreflight()
1128 { 1134 {
1129 return m_state->booleanProperty(NetworkAgentState::cacheDisabled, false); 1135 return m_state->booleanProperty(NetworkAgentState::cacheDisabled, false);
1130 } 1136 }
1131 1137
1132 } // namespace blink 1138 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698