Chromium Code Reviews| Index: third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.h |
| diff --git a/third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.h b/third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.h |
| index c5237f32a7face254e41c5571db37f9ae216350a..9349fe222d2b23ca8284354c4722b4626218efdd 100644 |
| --- a/third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.h |
| +++ b/third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.h |
| @@ -38,6 +38,7 @@ |
| #include "core/inspector/protocol/Network.h" |
| #include "platform/Timer.h" |
| #include "platform/heap/Handle.h" |
| +#include "wtf/text/AtomicString.h" |
| #include "wtf/text/WTFString.h" |
| namespace blink { |
| @@ -68,9 +69,16 @@ class DictionaryValue; |
| class CORE_EXPORT InspectorNetworkAgent final : public InspectorBaseAgent<protocol::Network::Metainfo> { |
| public: |
| - static InspectorNetworkAgent* create(InspectedFrames* inspectedFrames) |
| + class Client { |
| + public: |
| + virtual ~Client() { } |
| + |
| + virtual void showCertificateViewer(const AtomicString& certificate) = 0; |
| + }; |
| + |
| + static InspectorNetworkAgent* create(Client* client, InspectedFrames* inspectedFrames) |
| { |
| - return new InspectorNetworkAgent(inspectedFrames); |
| + return new InspectorNetworkAgent(client, inspectedFrames); |
| } |
| void restore() override; |
| @@ -146,13 +154,14 @@ public: |
| void setCacheDisabled(ErrorString*, bool cacheDisabled) override; |
| void setBypassServiceWorker(ErrorString*, bool bypass) override; |
| void setDataSizeLimitsForTest(ErrorString*, int maxTotalSize, int maxResourceSize) override; |
| + void showCertificateViewer(ErrorString*, int certificateHash) override; |
| // Called from other agents. |
| void setHostId(const String&); |
| bool fetchResourceContent(Document*, const KURL&, String* content, bool* base64Encoded); |
| private: |
| - explicit InspectorNetworkAgent(InspectedFrames*); |
| + InspectorNetworkAgent(Client*, InspectedFrames*); |
| void enable(int totalBufferSize, int resourceBufferSize); |
| void willSendRequestInternal(LocalFrame*, unsigned long identifier, DocumentLoader*, const ResourceRequest&, const ResourceResponse& redirectResponse, const FetchInitiatorInfo&); |
| @@ -164,6 +173,7 @@ private: |
| void getResponseBodyBlob(const String& requestId, std::unique_ptr<GetResponseBodyCallback>); |
| void clearPendingRequestData(); |
| + Client* m_client; |
| Member<InspectedFrames> m_inspectedFrames; |
| String m_userAgentOverride; |
| String m_hostId; |
| @@ -187,6 +197,10 @@ private: |
| std::unique_ptr<protocol::Network::Initiator> m_styleRecalculationInitiator; |
| bool m_isRecalculatingStyle; |
| + // Optimization so that we don't send the full cerfificate data to the frontend. |
|
jam
2016/08/31 22:13:28
this hash map isn't for saving memory (since I'm u
|
| + typedef HashMap<unsigned, AtomicString> CertificateHashMap; |
| + CertificateHashMap m_certificateHashMap; |
|
pfeldman
2016/08/31 23:08:45
We should clean it up at least from InspectorNetwo
jam
2016/08/31 23:15:09
Done
|
| + |
| HeapHashSet<Member<XMLHttpRequest>> m_replayXHRs; |
| HeapHashSet<Member<XMLHttpRequest>> m_replayXHRsToBeDeleted; |
| Timer<InspectorNetworkAgent> m_removeFinishedReplayXHRTimer; |