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

Side by Side Diff: net/url_request/url_fetcher_core.h

Issue 15711003: net: Move write flush responsiblity from URLFetcherResponseWriter to URLFetcherCore (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix comment Created 7 years, 7 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
« no previous file with comments | « no previous file | net/url_request/url_fetcher_core.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef NET_URL_REQUEST_URL_FETCHER_CORE_H_ 5 #ifndef NET_URL_REQUEST_URL_FETCHER_CORE_H_
6 #define NET_URL_REQUEST_URL_FETCHER_CORE_H_ 6 #define NET_URL_REQUEST_URL_FETCHER_CORE_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 10
(...skipping 10 matching lines...) Expand all
21 #include "net/http/http_request_headers.h" 21 #include "net/http/http_request_headers.h"
22 #include "net/url_request/url_fetcher.h" 22 #include "net/url_request/url_fetcher.h"
23 #include "net/url_request/url_request.h" 23 #include "net/url_request/url_request.h"
24 #include "net/url_request/url_request_status.h" 24 #include "net/url_request/url_request_status.h"
25 25
26 namespace base { 26 namespace base {
27 class SingleThreadTaskRunner; 27 class SingleThreadTaskRunner;
28 } // namespace base 28 } // namespace base
29 29
30 namespace net { 30 namespace net {
31 class DrainableIOBuffer;
31 class HttpResponseHeaders; 32 class HttpResponseHeaders;
32 class IOBuffer; 33 class IOBuffer;
33 class URLFetcherDelegate; 34 class URLFetcherDelegate;
34 class URLFetcherFileWriter; 35 class URLFetcherFileWriter;
35 class URLFetcherResponseWriter; 36 class URLFetcherResponseWriter;
36 class URLRequestContextGetter; 37 class URLRequestContextGetter;
37 class URLRequestThrottlerEntryInterface; 38 class URLRequestThrottlerEntryInterface;
38 39
39 class URLFetcherCore 40 class URLFetcherCore
40 : public base::RefCountedThreadSafe<URLFetcherCore>, 41 : public base::RefCountedThreadSafe<URLFetcherCore>,
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 // destruction observer. 187 // destruction observer.
187 void ReleaseRequest(); 188 void ReleaseRequest();
188 189
189 // Returns the max value of exponential back-off release time for 190 // Returns the max value of exponential back-off release time for
190 // |original_url_| and |url_|. 191 // |original_url_| and |url_|.
191 base::TimeTicks GetBackoffReleaseTime(); 192 base::TimeTicks GetBackoffReleaseTime();
192 193
193 void CompleteAddingUploadDataChunk(const std::string& data, 194 void CompleteAddingUploadDataChunk(const std::string& data,
194 bool is_last_chunk); 195 bool is_last_chunk);
195 196
196 // Handles the result of WriteBuffer. 197 // Writes all bytes stored in |data| with |response_writer_|.
197 void DidWriteBuffer(int result); 198 // Returns OK if all bytes in |data| get written synchronously. Otherwise,
199 // returns ERR_IO_PENDING or a network error code.
200 int WriteBuffer(scoped_refptr<DrainableIOBuffer> data);
201
202 // Used to implement WriteBuffer().
203 void DidWriteBuffer(scoped_refptr<DrainableIOBuffer> data, int result);
198 204
199 // Read response bytes from the request. 205 // Read response bytes from the request.
200 void ReadResponse(); 206 void ReadResponse();
201 207
202 // Drop ownership of any file managed by |file_path_|. 208 // Drop ownership of any file managed by |file_path_|.
203 void DisownFile(); 209 void DisownFile();
204 210
205 // Notify Delegate about the progress of upload/download. 211 // Notify Delegate about the progress of upload/download.
206 void InformDelegateUploadProgress(); 212 void InformDelegateUploadProgress();
207 void InformDelegateUploadProgressInDelegateThread(int64 current, int64 total); 213 void InformDelegateUploadProgressInDelegateThread(int64 current, int64 total);
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 base::debug::StackTrace stack_trace_; 343 base::debug::StackTrace stack_trace_;
338 344
339 static base::LazyInstance<Registry> g_registry; 345 static base::LazyInstance<Registry> g_registry;
340 346
341 DISALLOW_COPY_AND_ASSIGN(URLFetcherCore); 347 DISALLOW_COPY_AND_ASSIGN(URLFetcherCore);
342 }; 348 };
343 349
344 } // namespace net 350 } // namespace net
345 351
346 #endif // NET_URL_REQUEST_URL_FETCHER_CORE_H_ 352 #endif // NET_URL_REQUEST_URL_FETCHER_CORE_H_
OLDNEW
« no previous file with comments | « no previous file | net/url_request/url_fetcher_core.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698