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 29 matching lines...) Expand all Loading... |
40 #include "wtf/text/WTFString.h" | 40 #include "wtf/text/WTFString.h" |
41 | 41 |
42 namespace blink { | 42 namespace blink { |
43 | 43 |
44 class Resource; | 44 class Resource; |
45 class Document; | 45 class Document; |
46 class DocumentLoader; | 46 class DocumentLoader; |
47 class FrameHost; | 47 class FrameHost; |
48 class InspectorCSSAgent; | 48 class InspectorCSSAgent; |
49 class InspectorDebuggerAgent; | 49 class InspectorDebuggerAgent; |
50 class InspectorOverlay; | |
51 class InspectorResourceContentLoader; | 50 class InspectorResourceContentLoader; |
52 class KURL; | 51 class KURL; |
53 class LocalFrame; | 52 class LocalFrame; |
54 class SharedBuffer; | 53 class SharedBuffer; |
55 class TextResourceDecoder; | 54 class TextResourceDecoder; |
56 | 55 |
57 typedef String ErrorString; | 56 typedef String ErrorString; |
58 | 57 |
59 class CORE_EXPORT InspectorPageAgent final : public InspectorBaseAgent<Inspector
PageAgent, InspectorFrontend::Page>, public InspectorBackendDispatcher::PageComm
andHandler { | 58 class CORE_EXPORT InspectorPageAgent final : public InspectorBaseAgent<Inspector
PageAgent, InspectorFrontend::Page>, public InspectorBackendDispatcher::PageComm
andHandler { |
60 WTF_MAKE_NONCOPYABLE(InspectorPageAgent); | 59 WTF_MAKE_NONCOPYABLE(InspectorPageAgent); |
61 public: | 60 public: |
| 61 class Client { |
| 62 public: |
| 63 virtual ~Client() { } |
| 64 virtual void pageLayoutInvalidated(bool resized) { } |
| 65 virtual void setShowViewportSizeOnResize(bool show, bool showGrid) { } |
| 66 virtual void setPausedInDebuggerMessage(const String*) { } |
| 67 }; |
| 68 |
62 enum ResourceType { | 69 enum ResourceType { |
63 DocumentResource, | 70 DocumentResource, |
64 StylesheetResource, | 71 StylesheetResource, |
65 ImageResource, | 72 ImageResource, |
66 FontResource, | 73 FontResource, |
67 MediaResource, | 74 MediaResource, |
68 ScriptResource, | 75 ScriptResource, |
69 TextTrackResource, | 76 TextTrackResource, |
70 XHRResource, | 77 XHRResource, |
71 FetchResource, | 78 FetchResource, |
72 EventSourceResource, | 79 EventSourceResource, |
73 WebSocketResource, | 80 WebSocketResource, |
74 OtherResource | 81 OtherResource |
75 }; | 82 }; |
76 | 83 |
77 static PassOwnPtrWillBeRawPtr<InspectorPageAgent> create(LocalFrame* inspect
edFrame, InspectorOverlay*, InspectorResourceContentLoader*); | 84 static PassOwnPtrWillBeRawPtr<InspectorPageAgent> create(LocalFrame* inspect
edFrame, Client*, InspectorResourceContentLoader*); |
78 void setDebuggerAgent(InspectorDebuggerAgent*); | 85 void setDebuggerAgent(InspectorDebuggerAgent*); |
79 | 86 |
80 static Vector<Document*> importsForFrame(LocalFrame*); | 87 static Vector<Document*> importsForFrame(LocalFrame*); |
81 static bool cachedResourceContent(Resource*, String* result, bool* base64Enc
oded); | 88 static bool cachedResourceContent(Resource*, String* result, bool* base64Enc
oded); |
82 static bool sharedBufferContent(PassRefPtr<SharedBuffer>, const String& text
EncodingName, bool withBase64Encode, String* result); | 89 static bool sharedBufferContent(PassRefPtr<SharedBuffer>, const String& text
EncodingName, bool withBase64Encode, String* result); |
83 | 90 |
84 static PassRefPtr<SharedBuffer> resourceData(LocalFrame*, const KURL&, Strin
g* textEncodingName); | 91 static PassRefPtr<SharedBuffer> resourceData(LocalFrame*, const KURL&, Strin
g* textEncodingName); |
85 static Resource* cachedResource(LocalFrame*, const KURL&); | 92 static Resource* cachedResource(LocalFrame*, const KURL&); |
86 static TypeBuilder::Page::ResourceType::Enum resourceTypeJson(ResourceType); | 93 static TypeBuilder::Page::ResourceType::Enum resourceTypeJson(ResourceType); |
87 static ResourceType cachedResourceType(const Resource&); | 94 static ResourceType cachedResourceType(const Resource&); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 | 134 |
128 // Cross-agents API | 135 // Cross-agents API |
129 FrameHost* frameHost(); | 136 FrameHost* frameHost(); |
130 LocalFrame* inspectedFrame() const { return m_inspectedFrame.get(); } | 137 LocalFrame* inspectedFrame() const { return m_inspectedFrame.get(); } |
131 LocalFrame* findFrameWithSecurityOrigin(const String& originRawString); | 138 LocalFrame* findFrameWithSecurityOrigin(const String& originRawString); |
132 bool screencastEnabled(); | 139 bool screencastEnabled(); |
133 | 140 |
134 DECLARE_VIRTUAL_TRACE(); | 141 DECLARE_VIRTUAL_TRACE(); |
135 | 142 |
136 private: | 143 private: |
137 InspectorPageAgent(LocalFrame* inspectedFrame, InspectorOverlay*, InspectorR
esourceContentLoader*); | 144 InspectorPageAgent(LocalFrame* inspectedFrame, Client*, InspectorResourceCon
tentLoader*); |
138 | 145 |
139 void finishReload(); | 146 void finishReload(); |
140 void getResourceContentAfterResourcesContentLoaded(const String& frameId, co
nst String& url, PassRefPtrWillBeRawPtr<GetResourceContentCallback>); | 147 void getResourceContentAfterResourcesContentLoaded(const String& frameId, co
nst String& url, PassRefPtrWillBeRawPtr<GetResourceContentCallback>); |
141 | 148 |
142 static bool dataContent(const char* data, unsigned size, const String& textE
ncodingName, bool withBase64Encode, String* result); | 149 static bool dataContent(const char* data, unsigned size, const String& textE
ncodingName, bool withBase64Encode, String* result); |
143 | 150 |
144 PassRefPtr<TypeBuilder::Page::Frame> buildObjectForFrame(LocalFrame*); | 151 PassRefPtr<TypeBuilder::Page::Frame> buildObjectForFrame(LocalFrame*); |
145 PassRefPtr<TypeBuilder::Page::FrameResourceTree> buildObjectForFrameTree(Loc
alFrame*); | 152 PassRefPtr<TypeBuilder::Page::FrameResourceTree> buildObjectForFrameTree(Loc
alFrame*); |
146 RawPtrWillBeMember<LocalFrame> m_inspectedFrame; | 153 RawPtrWillBeMember<LocalFrame> m_inspectedFrame; |
147 RawPtrWillBeMember<InspectorDebuggerAgent> m_debuggerAgent; | 154 RawPtrWillBeMember<InspectorDebuggerAgent> m_debuggerAgent; |
148 RawPtrWillBeMember<InspectorOverlay> m_overlay; | 155 Client* m_client; |
149 long m_lastScriptIdentifier; | 156 long m_lastScriptIdentifier; |
150 String m_pendingScriptToEvaluateOnLoadOnce; | 157 String m_pendingScriptToEvaluateOnLoadOnce; |
151 String m_scriptToEvaluateOnLoadOnce; | 158 String m_scriptToEvaluateOnLoadOnce; |
152 bool m_enabled; | 159 bool m_enabled; |
153 bool m_reloading; | 160 bool m_reloading; |
154 | 161 |
155 RawPtrWillBeMember<InspectorResourceContentLoader> m_inspectorResourceConten
tLoader; | 162 RawPtrWillBeMember<InspectorResourceContentLoader> m_inspectorResourceConten
tLoader; |
156 }; | 163 }; |
157 | 164 |
158 | 165 |
159 } // namespace blink | 166 } // namespace blink |
160 | 167 |
161 | 168 |
162 #endif // !defined(InspectorPagerAgent_h) | 169 #endif // !defined(InspectorPagerAgent_h) |
OLD | NEW |