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 * 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 public: | 50 public: |
51 static PassRefPtr<XHRReplayData> create(const String &method, const KURL&, b
ool async, PassRefPtr<FormData>, bool includeCredentials); | 51 static PassRefPtr<XHRReplayData> create(const String &method, const KURL&, b
ool async, PassRefPtr<FormData>, bool includeCredentials); |
52 | 52 |
53 void addHeader(const AtomicString& key, const String& value); | 53 void addHeader(const AtomicString& key, const String& value); |
54 const String& method() const { return m_method; } | 54 const String& method() const { return m_method; } |
55 const KURL& url() const { return m_url; } | 55 const KURL& url() const { return m_url; } |
56 bool async() const { return m_async; } | 56 bool async() const { return m_async; } |
57 PassRefPtr<FormData> formData() const { return m_formData; } | 57 PassRefPtr<FormData> formData() const { return m_formData; } |
58 const HTTPHeaderMap& headers() const { return m_headers; } | 58 const HTTPHeaderMap& headers() const { return m_headers; } |
59 bool includeCredentials() const { return m_includeCredentials; } | 59 bool includeCredentials() const { return m_includeCredentials; } |
60 void reportMemoryUsage(MemoryObjectInfo*) const; | |
61 private: | 60 private: |
62 XHRReplayData(const String &method, const KURL&, bool async, PassRefPtr<Form
Data>, bool includeCredentials); | 61 XHRReplayData(const String &method, const KURL&, bool async, PassRefPtr<Form
Data>, bool includeCredentials); |
63 | 62 |
64 String m_method; | 63 String m_method; |
65 KURL m_url; | 64 KURL m_url; |
66 bool m_async; | 65 bool m_async; |
67 RefPtr<FormData> m_formData; | 66 RefPtr<FormData> m_formData; |
68 HTTPHeaderMap m_headers; | 67 HTTPHeaderMap m_headers; |
69 bool m_includeCredentials; | 68 bool m_includeCredentials; |
70 }; | 69 }; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 | 110 |
112 PassRefPtr<SharedBuffer> buffer() const { return m_buffer; } | 111 PassRefPtr<SharedBuffer> buffer() const { return m_buffer; } |
113 void setBuffer(PassRefPtr<SharedBuffer> buffer) { m_buffer = buffer; } | 112 void setBuffer(PassRefPtr<SharedBuffer> buffer) { m_buffer = buffer; } |
114 | 113 |
115 CachedResource* cachedResource() const { return m_cachedResource; } | 114 CachedResource* cachedResource() const { return m_cachedResource; } |
116 void setCachedResource(CachedResource* cachedResource) { m_cachedResourc
e = cachedResource; } | 115 void setCachedResource(CachedResource* cachedResource) { m_cachedResourc
e = cachedResource; } |
117 | 116 |
118 XHRReplayData* xhrReplayData() const { return m_xhrReplayData.get(); } | 117 XHRReplayData* xhrReplayData() const { return m_xhrReplayData.get(); } |
119 void setXHRReplayData(XHRReplayData* xhrReplayData) { m_xhrReplayData =
xhrReplayData; } | 118 void setXHRReplayData(XHRReplayData* xhrReplayData) { m_xhrReplayData =
xhrReplayData; } |
120 | 119 |
121 void reportMemoryUsage(MemoryObjectInfo*) const; | |
122 | |
123 private: | 120 private: |
124 bool hasData() const { return m_dataBuffer; } | 121 bool hasData() const { return m_dataBuffer; } |
125 size_t dataLength() const; | 122 size_t dataLength() const; |
126 void appendData(const char* data, size_t dataLength); | 123 void appendData(const char* data, size_t dataLength); |
127 size_t decodeDataToContent(); | 124 size_t decodeDataToContent(); |
128 | 125 |
129 String m_requestId; | 126 String m_requestId; |
130 String m_loaderId; | 127 String m_loaderId; |
131 String m_frameId; | 128 String m_frameId; |
132 String m_url; | 129 String m_url; |
(...skipping 27 matching lines...) Expand all Loading... |
160 void addResourceSharedBuffer(const String& requestId, PassRefPtr<SharedBuffe
r>, const String& textEncodingName); | 157 void addResourceSharedBuffer(const String& requestId, PassRefPtr<SharedBuffe
r>, const String& textEncodingName); |
161 ResourceData const* data(const String& requestId); | 158 ResourceData const* data(const String& requestId); |
162 Vector<String> removeCachedResource(CachedResource*); | 159 Vector<String> removeCachedResource(CachedResource*); |
163 void clear(const String& preservedLoaderId = String()); | 160 void clear(const String& preservedLoaderId = String()); |
164 | 161 |
165 void setResourcesDataSizeLimits(size_t maximumResourcesContentSize, size_t m
aximumSingleResourceContentSize); | 162 void setResourcesDataSizeLimits(size_t maximumResourcesContentSize, size_t m
aximumSingleResourceContentSize); |
166 void setXHRReplayData(const String& requestId, XHRReplayData*); | 163 void setXHRReplayData(const String& requestId, XHRReplayData*); |
167 void reuseXHRReplayData(const String& requestId, const String& reusedRequest
Id); | 164 void reuseXHRReplayData(const String& requestId, const String& reusedRequest
Id); |
168 XHRReplayData* xhrReplayData(const String& requestId); | 165 XHRReplayData* xhrReplayData(const String& requestId); |
169 | 166 |
170 void reportMemoryUsage(MemoryObjectInfo*) const; | |
171 | |
172 private: | 167 private: |
173 ResourceData* resourceDataForRequestId(const String& requestId); | 168 ResourceData* resourceDataForRequestId(const String& requestId); |
174 void ensureNoDataForRequestId(const String& requestId); | 169 void ensureNoDataForRequestId(const String& requestId); |
175 bool ensureFreeSpace(size_t); | 170 bool ensureFreeSpace(size_t); |
176 | 171 |
177 Deque<String> m_requestIdsDeque; | 172 Deque<String> m_requestIdsDeque; |
178 | 173 |
179 typedef HashMap<String, String> ReusedRequestIds; | 174 typedef HashMap<String, String> ReusedRequestIds; |
180 ReusedRequestIds m_reusedXHRReplayDataRequestIds; | 175 ReusedRequestIds m_reusedXHRReplayDataRequestIds; |
181 typedef HashMap<String, ResourceData*> ResourceDataMap; | 176 typedef HashMap<String, ResourceData*> ResourceDataMap; |
182 ResourceDataMap m_requestIdToResourceDataMap; | 177 ResourceDataMap m_requestIdToResourceDataMap; |
183 size_t m_contentSize; | 178 size_t m_contentSize; |
184 size_t m_maximumResourcesContentSize; | 179 size_t m_maximumResourcesContentSize; |
185 size_t m_maximumSingleResourceContentSize; | 180 size_t m_maximumSingleResourceContentSize; |
186 }; | 181 }; |
187 | 182 |
188 } // namespace WebCore | 183 } // namespace WebCore |
189 | 184 |
190 | 185 |
191 #endif // !defined(NetworkResourcesData_h) | 186 #endif // !defined(NetworkResourcesData_h) |
OLD | NEW |