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

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

Issue 12328072: Remove some calls to URLRequestContext::network_delegate(). (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Provide read-only access to network delegate for derived classes. Created 7 years, 9 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 // 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_REQUEST_JOB_H_ 5 #ifndef NET_URL_REQUEST_URL_REQUEST_JOB_H_
6 #define NET_URL_REQUEST_URL_REQUEST_JOB_H_ 6 #define NET_URL_REQUEST_URL_REQUEST_JOB_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 // Whether the response is being filtered in this job. 277 // Whether the response is being filtered in this job.
278 // Only valid after NotifyHeadersComplete() has been called. 278 // Only valid after NotifyHeadersComplete() has been called.
279 bool HasFilter() { return filter_ != NULL; } 279 bool HasFilter() { return filter_ != NULL; }
280 280
281 // At or near destruction time, a derived class may request that the filters 281 // At or near destruction time, a derived class may request that the filters
282 // be destroyed so that statistics can be gathered while the derived class is 282 // be destroyed so that statistics can be gathered while the derived class is
283 // still present to assist in calculations. This is used by URLRequestHttpJob 283 // still present to assist in calculations. This is used by URLRequestHttpJob
284 // to get SDCH to emit stats. 284 // to get SDCH to emit stats.
285 void DestroyFilters() { filter_.reset(); } 285 void DestroyFilters() { filter_.reset(); }
286 286
287 // Provides derived classes with access to the request's network delegate.
288 NetworkDelegate* network_delegate() { return network_delegate_; }
289
287 // The status of the job. 290 // The status of the job.
288 const URLRequestStatus GetStatus(); 291 const URLRequestStatus GetStatus();
289 292
290 // Set the status of the job. 293 // Set the status of the job.
291 void SetStatus(const URLRequestStatus& status); 294 void SetStatus(const URLRequestStatus& status);
292 295
293 // The number of bytes read before passing to the filter. 296 // The number of bytes read before passing to the filter.
294 int prefilter_bytes_read() const { return prefilter_bytes_read_; } 297 int prefilter_bytes_read() const { return prefilter_bytes_read_; }
295 298
296 // The number of bytes read after passing through the filter. 299 // The number of bytes read after passing through the filter.
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 // OnResponseStarted callback and potentially redirect callbacks as well. 375 // OnResponseStarted callback and potentially redirect callbacks as well.
373 bool has_handled_response_; 376 bool has_handled_response_;
374 377
375 // Expected content size 378 // Expected content size
376 int64 expected_content_size_; 379 int64 expected_content_size_;
377 380
378 // Set when a redirect is deferred. 381 // Set when a redirect is deferred.
379 GURL deferred_redirect_url_; 382 GURL deferred_redirect_url_;
380 int deferred_redirect_status_code_; 383 int deferred_redirect_status_code_;
381 384
385 // The network delegate to use with this request, if any.
382 NetworkDelegate* network_delegate_; 386 NetworkDelegate* network_delegate_;
383 387
384 base::WeakPtrFactory<URLRequestJob> weak_factory_; 388 base::WeakPtrFactory<URLRequestJob> weak_factory_;
385 389
386 DISALLOW_COPY_AND_ASSIGN(URLRequestJob); 390 DISALLOW_COPY_AND_ASSIGN(URLRequestJob);
387 }; 391 };
388 392
389 } // namespace net 393 } // namespace net
390 394
391 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_H_ 395 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_H_
OLDNEW
« no previous file with comments | « net/url_request/url_request_http_job.cc ('k') | net/url_request/url_request_job_factory_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698