| OLD | NEW |
| 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 840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 851 return initiatorObject; | 851 return initiatorObject; |
| 852 } | 852 } |
| 853 | 853 |
| 854 if (m_isRecalculatingStyle && m_styleRecalculationInitiator) | 854 if (m_isRecalculatingStyle && m_styleRecalculationInitiator) |
| 855 return m_styleRecalculationInitiator->clone(); | 855 return m_styleRecalculationInitiator->clone(); |
| 856 | 856 |
| 857 return protocol::Network::Initiator::create() | 857 return protocol::Network::Initiator::create() |
| 858 .setType(protocol::Network::Initiator::TypeEnum::Other).build(); | 858 .setType(protocol::Network::Initiator::TypeEnum::Other).build(); |
| 859 } | 859 } |
| 860 | 860 |
| 861 void InspectorNetworkAgent::didCreateWebSocket(Document*, unsigned long identifi
er, const KURL& requestURL, const String&) | 861 void InspectorNetworkAgent::didCreateWebSocket(Document* document, unsigned long
identifier, const KURL& requestURL, const String&) |
| 862 { | 862 { |
| 863 frontend()->webSocketCreated(IdentifiersFactory::requestId(identifier), urlW
ithoutFragment(requestURL).getString()); | 863 std::unique_ptr<protocol::Runtime::StackTrace> currentStackTrace = SourceLoc
ation::capture(document)->buildInspectorObject(); |
| 864 if (!currentStackTrace) { |
| 865 frontend()->webSocketCreated(IdentifiersFactory::requestId(identifier),
urlWithoutFragment(requestURL).getString()); |
| 866 return; |
| 867 } |
| 868 |
| 869 std::unique_ptr<protocol::Network::Initiator> initiatorObject = protocol::Ne
twork::Initiator::create() |
| 870 .setType(protocol::Network::Initiator::TypeEnum::Script).build(); |
| 871 initiatorObject->setStack(std::move(currentStackTrace)); |
| 872 frontend()->webSocketCreated(IdentifiersFactory::requestId(identifier), urlW
ithoutFragment(requestURL).getString(), std::move(initiatorObject)); |
| 864 } | 873 } |
| 865 | 874 |
| 866 void InspectorNetworkAgent::willSendWebSocketHandshakeRequest(Document*, unsigne
d long identifier, const WebSocketHandshakeRequest* request) | 875 void InspectorNetworkAgent::willSendWebSocketHandshakeRequest(Document*, unsigne
d long identifier, const WebSocketHandshakeRequest* request) |
| 867 { | 876 { |
| 868 DCHECK(request); | 877 DCHECK(request); |
| 869 std::unique_ptr<protocol::Network::WebSocketRequest> requestObject = protoco
l::Network::WebSocketRequest::create() | 878 std::unique_ptr<protocol::Network::WebSocketRequest> requestObject = protoco
l::Network::WebSocketRequest::create() |
| 870 .setHeaders(buildObjectForHeaders(request->headerFields())).build(); | 879 .setHeaders(buildObjectForHeaders(request->headerFields())).build(); |
| 871 frontend()->webSocketWillSendHandshakeRequest(IdentifiersFactory::requestId(
identifier), monotonicallyIncreasingTime(), currentTime(), std::move(requestObje
ct)); | 880 frontend()->webSocketWillSendHandshakeRequest(IdentifiersFactory::requestId(
identifier), monotonicallyIncreasingTime(), currentTime(), std::move(requestObje
ct)); |
| 872 } | 881 } |
| 873 | 882 |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1181 , m_removeFinishedReplayXHRTimer(this, &InspectorNetworkAgent::removeFinishe
dReplayXHRFired) | 1190 , m_removeFinishedReplayXHRTimer(this, &InspectorNetworkAgent::removeFinishe
dReplayXHRFired) |
| 1182 { | 1191 { |
| 1183 } | 1192 } |
| 1184 | 1193 |
| 1185 bool InspectorNetworkAgent::shouldForceCORSPreflight() | 1194 bool InspectorNetworkAgent::shouldForceCORSPreflight() |
| 1186 { | 1195 { |
| 1187 return m_state->booleanProperty(NetworkAgentState::cacheDisabled, false); | 1196 return m_state->booleanProperty(NetworkAgentState::cacheDisabled, false); |
| 1188 } | 1197 } |
| 1189 | 1198 |
| 1190 } // namespace blink | 1199 } // namespace blink |
| OLD | NEW |