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 812 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
823 } | 823 } |
824 | 824 |
825 void InspectorNetworkAgent::didScheduleStyleRecalculation(Document* document) | 825 void InspectorNetworkAgent::didScheduleStyleRecalculation(Document* document) |
826 { | 826 { |
827 if (!m_styleRecalculationInitiator) | 827 if (!m_styleRecalculationInitiator) |
828 m_styleRecalculationInitiator = buildInitiatorObject(document, FetchInit
iatorInfo()); | 828 m_styleRecalculationInitiator = buildInitiatorObject(document, FetchInit
iatorInfo()); |
829 } | 829 } |
830 | 830 |
831 std::unique_ptr<protocol::Network::Initiator> InspectorNetworkAgent::buildInitia
torObject(Document* document, const FetchInitiatorInfo& initiatorInfo) | 831 std::unique_ptr<protocol::Network::Initiator> InspectorNetworkAgent::buildInitia
torObject(Document* document, const FetchInitiatorInfo& initiatorInfo) |
832 { | 832 { |
833 std::unique_ptr<protocol::Runtime::StackTrace> currentStackTrace = SourceLoc
ation::capture(document)->buildInspectorObject(); | 833 std::unique_ptr<protocol::Runtime::API::StackTrace> currentStackTrace = Sour
ceLocation::capture(document)->buildInspectorObject(); |
834 if (currentStackTrace) { | 834 if (currentStackTrace) { |
835 std::unique_ptr<protocol::Network::Initiator> initiatorObject = protocol
::Network::Initiator::create() | 835 std::unique_ptr<protocol::Network::Initiator> initiatorObject = protocol
::Network::Initiator::create() |
836 .setType(protocol::Network::Initiator::TypeEnum::Script).build(); | 836 .setType(protocol::Network::Initiator::TypeEnum::Script).build(); |
837 initiatorObject->setStack(std::move(currentStackTrace)); | 837 initiatorObject->setStack(std::move(currentStackTrace)); |
838 return initiatorObject; | 838 return initiatorObject; |
839 } | 839 } |
840 | 840 |
841 while (document && !document->scriptableDocumentParser()) | 841 while (document && !document->scriptableDocumentParser()) |
842 document = document->localOwner() ? document->localOwner()->ownerDocumen
t() : nullptr; | 842 document = document->localOwner() ? document->localOwner()->ownerDocumen
t() : nullptr; |
843 if (document && document->scriptableDocumentParser()) { | 843 if (document && document->scriptableDocumentParser()) { |
844 std::unique_ptr<protocol::Network::Initiator> initiatorObject = protocol
::Network::Initiator::create() | 844 std::unique_ptr<protocol::Network::Initiator> initiatorObject = protocol
::Network::Initiator::create() |
845 .setType(protocol::Network::Initiator::TypeEnum::Parser).build(); | 845 .setType(protocol::Network::Initiator::TypeEnum::Parser).build(); |
846 initiatorObject->setUrl(urlWithoutFragment(document->url()).getString())
; | 846 initiatorObject->setUrl(urlWithoutFragment(document->url()).getString())
; |
847 if (TextPosition::belowRangePosition() != initiatorInfo.position) | 847 if (TextPosition::belowRangePosition() != initiatorInfo.position) |
848 initiatorObject->setLineNumber(initiatorInfo.position.m_line.zeroBas
edInt()); | 848 initiatorObject->setLineNumber(initiatorInfo.position.m_line.zeroBas
edInt()); |
849 else | 849 else |
850 initiatorObject->setLineNumber(document->scriptableDocumentParser()-
>lineNumber().zeroBasedInt()); | 850 initiatorObject->setLineNumber(document->scriptableDocumentParser()-
>lineNumber().zeroBasedInt()); |
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* document, unsigned long
identifier, const KURL& requestURL, const String&) | 861 void InspectorNetworkAgent::didCreateWebSocket(Document* document, unsigned long
identifier, const KURL& requestURL, const String&) |
862 { | 862 { |
863 std::unique_ptr<protocol::Runtime::StackTrace> currentStackTrace = SourceLoc
ation::capture(document)->buildInspectorObject(); | 863 std::unique_ptr<protocol::Runtime::API::StackTrace> currentStackTrace = Sour
ceLocation::capture(document)->buildInspectorObject(); |
864 if (!currentStackTrace) { | 864 if (!currentStackTrace) { |
865 frontend()->webSocketCreated(IdentifiersFactory::requestId(identifier),
urlWithoutFragment(requestURL).getString()); | 865 frontend()->webSocketCreated(IdentifiersFactory::requestId(identifier),
urlWithoutFragment(requestURL).getString()); |
866 return; | 866 return; |
867 } | 867 } |
868 | 868 |
869 std::unique_ptr<protocol::Network::Initiator> initiatorObject = protocol::Ne
twork::Initiator::create() | 869 std::unique_ptr<protocol::Network::Initiator> initiatorObject = protocol::Ne
twork::Initiator::create() |
870 .setType(protocol::Network::Initiator::TypeEnum::Script).build(); | 870 .setType(protocol::Network::Initiator::TypeEnum::Script).build(); |
871 initiatorObject->setStack(std::move(currentStackTrace)); | 871 initiatorObject->setStack(std::move(currentStackTrace)); |
872 frontend()->webSocketCreated(IdentifiersFactory::requestId(identifier), urlW
ithoutFragment(requestURL).getString(), std::move(initiatorObject)); | 872 frontend()->webSocketCreated(IdentifiersFactory::requestId(identifier), urlW
ithoutFragment(requestURL).getString(), std::move(initiatorObject)); |
873 } | 873 } |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1190 , m_removeFinishedReplayXHRTimer(this, &InspectorNetworkAgent::removeFinishe
dReplayXHRFired) | 1190 , m_removeFinishedReplayXHRTimer(this, &InspectorNetworkAgent::removeFinishe
dReplayXHRFired) |
1191 { | 1191 { |
1192 } | 1192 } |
1193 | 1193 |
1194 bool InspectorNetworkAgent::shouldForceCORSPreflight() | 1194 bool InspectorNetworkAgent::shouldForceCORSPreflight() |
1195 { | 1195 { |
1196 return m_state->booleanProperty(NetworkAgentState::cacheDisabled, false); | 1196 return m_state->booleanProperty(NetworkAgentState::cacheDisabled, false); |
1197 } | 1197 } |
1198 | 1198 |
1199 } // namespace blink | 1199 } // namespace blink |
OLD | NEW |