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

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

Issue 23658039: [ABANDONED] Get content of resources from Blob when the downloadToFile option is enabled (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 3 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
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 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 10 *
(...skipping 12 matching lines...) Expand all
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */ 27 */
28 28
29 #ifndef NetworkResourcesData_h 29 #ifndef NetworkResourcesData_h
30 #define NetworkResourcesData_h 30 #define NetworkResourcesData_h
31 31
32 #include "core/fetch/TextResourceDecoder.h" 32 #include "core/fetch/TextResourceDecoder.h"
33 #include "core/fileapi/Blob.h"
33 #include "core/inspector/InspectorPageAgent.h" 34 #include "core/inspector/InspectorPageAgent.h"
34 #include "core/platform/network/HTTPHeaderMap.h" 35 #include "core/platform/network/HTTPHeaderMap.h"
35 #include "weborigin/KURL.h" 36 #include "weborigin/KURL.h"
36 #include "wtf/Deque.h" 37 #include "wtf/Deque.h"
37 #include "wtf/HashMap.h" 38 #include "wtf/HashMap.h"
38 #include "wtf/RefCounted.h" 39 #include "wtf/RefCounted.h"
39 #include "wtf/text/WTFString.h" 40 #include "wtf/text/WTFString.h"
40 41
41 42
42 namespace WebCore { 43 namespace WebCore {
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 88
88 String url() const { return m_url; } 89 String url() const { return m_url; }
89 void setUrl(const String& url) { m_url = url; } 90 void setUrl(const String& url) { m_url = url; }
90 91
91 bool hasContent() const { return !m_content.isNull(); } 92 bool hasContent() const { return !m_content.isNull(); }
92 String content() const { return m_content; } 93 String content() const { return m_content; }
93 void setContent(const String&, bool base64Encoded); 94 void setContent(const String&, bool base64Encoded);
94 95
95 bool base64Encoded() const { return m_base64Encoded; } 96 bool base64Encoded() const { return m_base64Encoded; }
96 97
98 bool hasBlob() const { return m_blob; }
99 PassRefPtr<Blob> blob() const { return m_blob; }
100 void setBlob(PassRefPtr<Blob>, const String& textEncodingName);
101
102 String blobTextEncodingName() const { return m_blobTextEncodingName; }
103
97 unsigned removeContent(); 104 unsigned removeContent();
98 bool isContentEvicted() const { return m_isContentEvicted; } 105 bool isContentEvicted() const { return m_isContentEvicted; }
99 unsigned evictContent(); 106 unsigned evictContent();
100 107
101 InspectorPageAgent::ResourceType type() const { return m_type; } 108 InspectorPageAgent::ResourceType type() const { return m_type; }
102 void setType(InspectorPageAgent::ResourceType type) { m_type = type; } 109 void setType(InspectorPageAgent::ResourceType type) { m_type = type; }
103 110
104 int httpStatusCode() const { return m_httpStatusCode; } 111 int httpStatusCode() const { return m_httpStatusCode; }
105 void setHTTPStatusCode(int httpStatusCode) { m_httpStatusCode = httpStat usCode; } 112 void setHTTPStatusCode(int httpStatusCode) { m_httpStatusCode = httpStat usCode; }
106 113
(...skipping 16 matching lines...) Expand all
123 bool hasData() const { return m_dataBuffer; } 130 bool hasData() const { return m_dataBuffer; }
124 size_t dataLength() const; 131 size_t dataLength() const;
125 void appendData(const char* data, size_t dataLength); 132 void appendData(const char* data, size_t dataLength);
126 size_t decodeDataToContent(); 133 size_t decodeDataToContent();
127 134
128 String m_requestId; 135 String m_requestId;
129 String m_loaderId; 136 String m_loaderId;
130 String m_frameId; 137 String m_frameId;
131 String m_url; 138 String m_url;
132 String m_content; 139 String m_content;
140 RefPtr<Blob> m_blob;
141 String m_blobTextEncodingName;
133 RefPtr<XHRReplayData> m_xhrReplayData; 142 RefPtr<XHRReplayData> m_xhrReplayData;
134 bool m_base64Encoded; 143 bool m_base64Encoded;
135 RefPtr<SharedBuffer> m_dataBuffer; 144 RefPtr<SharedBuffer> m_dataBuffer;
136 bool m_isContentEvicted; 145 bool m_isContentEvicted;
137 InspectorPageAgent::ResourceType m_type; 146 InspectorPageAgent::ResourceType m_type;
138 int m_httpStatusCode; 147 int m_httpStatusCode;
139 148
140 String m_textEncodingName; 149 String m_textEncodingName;
141 RefPtr<TextResourceDecoder> m_decoder; 150 RefPtr<TextResourceDecoder> m_decoder;
142 151
143 RefPtr<SharedBuffer> m_buffer; 152 RefPtr<SharedBuffer> m_buffer;
144 Resource* m_cachedResource; 153 Resource* m_cachedResource;
145 }; 154 };
146 155
147 NetworkResourcesData(); 156 NetworkResourcesData();
148 157
149 ~NetworkResourcesData(); 158 ~NetworkResourcesData();
150 159
151 void resourceCreated(const String& requestId, const String& loaderId); 160 void resourceCreated(const String& requestId, const String& loaderId);
152 void responseReceived(const String& requestId, const String& frameId, const ResourceResponse&); 161 void responseReceived(const String& requestId, const String& frameId, const ResourceResponse&);
153 void setResourceType(const String& requestId, InspectorPageAgent::ResourceTy pe); 162 void setResourceType(const String& requestId, InspectorPageAgent::ResourceTy pe);
154 InspectorPageAgent::ResourceType resourceType(const String& requestId); 163 InspectorPageAgent::ResourceType resourceType(const String& requestId);
155 void setResourceContent(const String& requestId, const String& content, bool base64Encoded = false); 164 void setResourceContent(const String& requestId, const String& content, bool base64Encoded = false);
165 void setResourceBlob(const String& requestId, PassRefPtr<Blob>, const String & textEncodingName);
156 void maybeAddResourceData(const String& requestId, const char* data, size_t dataLength); 166 void maybeAddResourceData(const String& requestId, const char* data, size_t dataLength);
157 void maybeDecodeDataToContent(const String& requestId); 167 void maybeDecodeDataToContent(const String& requestId);
158 void addResource(const String& requestId, Resource*); 168 void addResource(const String& requestId, Resource*);
159 void addResourceSharedBuffer(const String& requestId, PassRefPtr<SharedBuffe r>, const String& textEncodingName); 169 void addResourceSharedBuffer(const String& requestId, PassRefPtr<SharedBuffe r>, const String& textEncodingName);
160 ResourceData const* data(const String& requestId); 170 ResourceData const* data(const String& requestId);
161 Vector<String> removeResource(Resource*); 171 Vector<String> removeResource(Resource*);
162 void clear(const String& preservedLoaderId = String()); 172 void clear(const String& preservedLoaderId = String());
163 173
164 void setResourcesDataSizeLimits(size_t maximumResourcesContentSize, size_t m aximumSingleResourceContentSize); 174 void setResourcesDataSizeLimits(size_t maximumResourcesContentSize, size_t m aximumSingleResourceContentSize);
165 void setXHRReplayData(const String& requestId, XHRReplayData*); 175 void setXHRReplayData(const String& requestId, XHRReplayData*);
(...skipping 13 matching lines...) Expand all
179 ResourceDataMap m_requestIdToResourceDataMap; 189 ResourceDataMap m_requestIdToResourceDataMap;
180 size_t m_contentSize; 190 size_t m_contentSize;
181 size_t m_maximumResourcesContentSize; 191 size_t m_maximumResourcesContentSize;
182 size_t m_maximumSingleResourceContentSize; 192 size_t m_maximumSingleResourceContentSize;
183 }; 193 };
184 194
185 } // namespace WebCore 195 } // namespace WebCore
186 196
187 197
188 #endif // !defined(NetworkResourcesData_h) 198 #endif // !defined(NetworkResourcesData_h)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698