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

Side by Side Diff: Source/core/xml/XMLHttpRequest.h

Issue 79953004: Improve fidelity of XHR progress events. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Make test stable Created 7 years 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) 2003, 2006, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2006, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2005, 2006 Alexey Proskuryakov <ap@nypop.com> 3 * Copyright (C) 2005, 2006 Alexey Proskuryakov <ap@nypop.com>
4 * Copyright (C) 2011 Google Inc. All rights reserved. 4 * Copyright (C) 2011 Google Inc. All rights reserved.
5 * Copyright (C) 2012 Intel Corporation 5 * Copyright (C) 2012 Intel Corporation
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public 8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 // Clears variables used only while the resource is being loaded. 177 // Clears variables used only while the resource is being loaded.
178 void clearVariablesForLoading(); 178 void clearVariablesForLoading();
179 // Returns false iff reentry happened and a new load is started. 179 // Returns false iff reentry happened and a new load is started.
180 bool internalAbort(DropProtection = DropProtectionSync); 180 bool internalAbort(DropProtection = DropProtectionSync);
181 // Clears variables holding response header and body data. 181 // Clears variables holding response header and body data.
182 void clearResponse(); 182 void clearResponse();
183 void clearRequest(); 183 void clearRequest();
184 184
185 void createRequest(ExceptionState&); 185 void createRequest(ExceptionState&);
186 186
187 // Dispatches an event of the specified type to m_upload and 187 // Dispatches an event of the specified type to m_progressEventThrottle.
188 // m_progressEventThrottle. 188 void dispatchEventAndLoadEnd(const AtomicString&, long long, long long);
189 void dispatchEventAndLoadEnd(const AtomicString&);
190 189
191 void dispatchThrottledProgressEvent(); 190 // Dispatches a response progress event to m_progressEventThrottle.
191 void dispatchThrottledProgressEvent(const AtomicString&, long long, long lon g);
192
193 // Dispatches a response progress event using values sampled from
194 // m_receivedLength and m_response.
195 void dispatchThrottledProgressEventSnapshot(const AtomicString&);
192 196
193 // Does clean up common for all kind of didFail() call. 197 // Does clean up common for all kind of didFail() call.
194 void handleDidFailGeneric(); 198 void handleDidFailGeneric();
195 // Handles didFail() call not caused by cancellation or timeout. 199 // Handles didFail() call not caused by cancellation or timeout.
196 void handleNetworkError(); 200 void handleNetworkError();
197 // Handles didFail() call triggered by m_loader->cancel(). 201 // Handles didFail() call triggered by m_loader->cancel().
198 void handleDidCancel(); 202 void handleDidCancel();
199 // Handles didFail() call for timeout. 203 // Handles didFail() call for timeout.
200 void handleDidTimeout(); 204 void handleDidTimeout();
201 205
202 void handleRequestError(ExceptionCode, const AtomicString&); 206 void handleRequestError(ExceptionCode, const AtomicString&, long long, long long);
203 207
204 OwnPtr<XMLHttpRequestUpload> m_upload; 208 OwnPtr<XMLHttpRequestUpload> m_upload;
205 209
206 KURL m_url; 210 KURL m_url;
207 String m_method; 211 String m_method;
208 HTTPHeaderMap m_requestHeaders; 212 HTTPHeaderMap m_requestHeaders;
209 RefPtr<FormData> m_requestEntityBody; 213 RefPtr<FormData> m_requestEntityBody;
210 String m_mimeTypeOverride; 214 String m_mimeTypeOverride;
211 bool m_async; 215 bool m_async;
212 bool m_includeCredentials; 216 bool m_includeCredentials;
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 256
253 // An enum corresponding to the allowed string values for the responseType a ttribute. 257 // An enum corresponding to the allowed string values for the responseType a ttribute.
254 ResponseTypeCode m_responseTypeCode; 258 ResponseTypeCode m_responseTypeCode;
255 AsyncMethodRunner<XMLHttpRequest> m_dropProtectionRunner; 259 AsyncMethodRunner<XMLHttpRequest> m_dropProtectionRunner;
256 RefPtr<SecurityOrigin> m_securityOrigin; 260 RefPtr<SecurityOrigin> m_securityOrigin;
257 }; 261 };
258 262
259 } // namespace WebCore 263 } // namespace WebCore
260 264
261 #endif // XMLHttpRequest_h 265 #endif // XMLHttpRequest_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698