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

Side by Side Diff: Source/core/inspector/InspectorPageAgent.h

Issue 347543002: DevTools: Extract CSS resources preloading from css agent to page agent controlled loader. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 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 | Annotate | Revision Log
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 16 matching lines...) Expand all
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #ifndef InspectorPageAgent_h 31 #ifndef InspectorPageAgent_h
32 #define InspectorPageAgent_h 32 #define InspectorPageAgent_h
33 33
34 34
35 #include "core/InspectorFrontend.h" 35 #include "core/InspectorFrontend.h"
36 #include "core/inspector/InspectorBaseAgent.h" 36 #include "core/inspector/InspectorBaseAgent.h"
37 #include "core/inspector/InspectorResourceContentLoader.h"
37 #include "wtf/HashMap.h" 38 #include "wtf/HashMap.h"
38 #include "wtf/text/WTFString.h" 39 #include "wtf/text/WTFString.h"
39 40
40 namespace WebCore { 41 namespace WebCore {
41 42
42 class Resource; 43 class Resource;
43 class DOMWrapperWorld; 44 class DOMWrapperWorld;
44 class Document; 45 class Document;
45 class DocumentLoader; 46 class DocumentLoader;
46 class LocalFrame; 47 class LocalFrame;
47 class GraphicsContext; 48 class GraphicsContext;
48 class GraphicsLayer; 49 class GraphicsLayer;
49 class InjectedScriptManager; 50 class InjectedScriptManager;
50 class InspectorClient; 51 class InspectorClient;
51 class InspectorOverlay; 52 class InspectorOverlay;
53 class InspectorResourceContentLoader;
52 class InstrumentingAgents; 54 class InstrumentingAgents;
53 class IntSize; 55 class IntSize;
54 class KURL; 56 class KURL;
55 class LayoutRect; 57 class LayoutRect;
56 class Page; 58 class Page;
57 class RenderObject; 59 class RenderObject;
58 class SharedBuffer; 60 class SharedBuffer;
59 class StyleResolver; 61 class StyleResolver;
60 62
61 typedef String ErrorString; 63 typedef String ErrorString;
(...skipping 13 matching lines...) Expand all
75 WebSocketResource, 77 WebSocketResource,
76 OtherResource 78 OtherResource
77 }; 79 };
78 80
79 static PassOwnPtr<InspectorPageAgent> create(Page*, InjectedScriptManager*, InspectorClient*, InspectorOverlay*); 81 static PassOwnPtr<InspectorPageAgent> create(Page*, InjectedScriptManager*, InspectorClient*, InspectorOverlay*);
80 82
81 // Settings overrides. 83 // Settings overrides.
82 void setTextAutosizingEnabled(bool); 84 void setTextAutosizingEnabled(bool);
83 void setDeviceScaleAdjustment(float); 85 void setDeviceScaleAdjustment(float);
84 86
87 static Vector<Document*> importsForFrame(LocalFrame*);
85 static bool cachedResourceContent(Resource*, String* result, bool* base64Enc oded); 88 static bool cachedResourceContent(Resource*, String* result, bool* base64Enc oded);
86 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);
87 90
88 static PassRefPtr<SharedBuffer> resourceData(LocalFrame*, const KURL&, Strin g* textEncodingName); 91 static PassRefPtr<SharedBuffer> resourceData(LocalFrame*, const KURL&, Strin g* textEncodingName);
89 static Resource* cachedResource(LocalFrame*, const KURL&); 92 static Resource* cachedResource(LocalFrame*, const KURL&);
90 static TypeBuilder::Page::ResourceType::Enum resourceTypeJson(ResourceType); 93 static TypeBuilder::Page::ResourceType::Enum resourceTypeJson(ResourceType);
91 static ResourceType cachedResourceType(const Resource&); 94 static ResourceType cachedResourceType(const Resource&);
92 static TypeBuilder::Page::ResourceType::Enum cachedResourceTypeJson(const Re source&); 95 static TypeBuilder::Page::ResourceType::Enum cachedResourceTypeJson(const Re source&);
93 96
94 // Page API for InspectorFrontend 97 // Page API for InspectorFrontend
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 LocalFrame* frameForId(const String& frameId); 156 LocalFrame* frameForId(const String& frameId);
154 String frameId(LocalFrame*); 157 String frameId(LocalFrame*);
155 bool hasIdForFrame(LocalFrame*) const; 158 bool hasIdForFrame(LocalFrame*) const;
156 String loaderId(DocumentLoader*); 159 String loaderId(DocumentLoader*);
157 LocalFrame* findFrameWithSecurityOrigin(const String& originRawString); 160 LocalFrame* findFrameWithSecurityOrigin(const String& originRawString);
158 LocalFrame* assertFrame(ErrorString*, const String& frameId); 161 LocalFrame* assertFrame(ErrorString*, const String& frameId);
159 String scriptPreprocessorSource() { return m_scriptPreprocessorSource; } 162 String scriptPreprocessorSource() { return m_scriptPreprocessorSource; }
160 const AtomicString& resourceSourceMapURL(const String& url); 163 const AtomicString& resourceSourceMapURL(const String& url);
161 bool deviceMetricsOverrideEnabled(); 164 bool deviceMetricsOverrideEnabled();
162 static DocumentLoader* assertDocumentLoader(ErrorString*, LocalFrame*); 165 static DocumentLoader* assertDocumentLoader(ErrorString*, LocalFrame*);
166 InspectorResourceContentLoader* resourceContentLoader() { return m_inspector ResourceContentLoader.get(); }
163 167
164 private: 168 private:
165 static void resourceContent(ErrorString*, LocalFrame*, const KURL&, String* result, bool* base64Encoded); 169 static void resourceContent(ErrorString*, LocalFrame*, const KURL&, String* result, bool* base64Encoded);
166 170
167 InspectorPageAgent(Page*, InjectedScriptManager*, InspectorClient*, Inspecto rOverlay*); 171 InspectorPageAgent(Page*, InjectedScriptManager*, InspectorClient*, Inspecto rOverlay*);
168 bool deviceMetricsChanged(bool enabled, int width, int height, double device ScaleFactor, bool emulateViewport, bool fitWindow, double fontScaleFactor, bool textAutosizing); 172 bool deviceMetricsChanged(bool enabled, int width, int height, double device ScaleFactor, bool emulateViewport, bool fitWindow, double fontScaleFactor, bool textAutosizing);
169 void updateViewMetricsFromState(); 173 void updateViewMetricsFromState();
170 void updateViewMetrics(bool enabled, int width, int height, double deviceSca leFactor, bool emulateViewport, bool fitWindow, double fontScaleFactor, bool tex tAutosizingEnabled); 174 void updateViewMetrics(bool enabled, int width, int height, double deviceSca leFactor, bool emulateViewport, bool fitWindow, double fontScaleFactor, bool tex tAutosizingEnabled);
171 void updateTouchEventEmulationInPage(bool); 175 void updateTouchEventEmulationInPage(bool);
172 bool compositingEnabled(ErrorString*); 176 bool compositingEnabled(ErrorString*);
(...skipping 20 matching lines...) Expand all
193 bool m_deviceMetricsOverridden; 197 bool m_deviceMetricsOverridden;
194 bool m_emulateViewportEnabled; 198 bool m_emulateViewportEnabled;
195 199
196 bool m_touchEmulationEnabled; 200 bool m_touchEmulationEnabled;
197 bool m_originalTouchEnabled; 201 bool m_originalTouchEnabled;
198 bool m_originalDeviceSupportsMouse; 202 bool m_originalDeviceSupportsMouse;
199 bool m_originalDeviceSupportsTouch; 203 bool m_originalDeviceSupportsTouch;
200 204
201 bool m_embedderTextAutosizingEnabled; 205 bool m_embedderTextAutosizingEnabled;
202 double m_embedderFontScaleFactor; 206 double m_embedderFontScaleFactor;
207
208 OwnPtr<InspectorResourceContentLoader> m_inspectorResourceContentLoader;
203 }; 209 };
204 210
205 211
206 } // namespace WebCore 212 } // namespace WebCore
207 213
208 214
209 #endif // !defined(InspectorPagerAgent_h) 215 #endif // !defined(InspectorPagerAgent_h)
OLDNEW
« no previous file with comments | « Source/core/inspector/InspectorCSSAgent.cpp ('k') | Source/core/inspector/InspectorPageAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698