| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 15 #include "base/system_monitor/system_monitor.h" | 15 #include "base/system_monitor/system_monitor.h" |
| 16 #include "base/time.h" | |
| 17 #include "googleurl/src/gurl.h" | 16 #include "googleurl/src/gurl.h" |
| 18 #include "net/base/filter.h" | 17 #include "net/base/filter.h" |
| 19 #include "net/base/host_port_pair.h" | 18 #include "net/base/host_port_pair.h" |
| 20 #include "net/base/load_states.h" | 19 #include "net/base/load_states.h" |
| 21 #include "net/base/net_export.h" | 20 #include "net/base/net_export.h" |
| 22 | 21 |
| 23 namespace net { | 22 namespace net { |
| 24 | 23 |
| 25 class AuthChallengeInfo; | 24 class AuthChallengeInfo; |
| 26 class AuthCredentials; | 25 class AuthCredentials; |
| 27 class CookieList; | 26 class CookieList; |
| 28 class CookieOptions; | 27 class CookieOptions; |
| 29 class HttpRequestHeaders; | 28 class HttpRequestHeaders; |
| 30 class HttpResponseInfo; | 29 class HttpResponseInfo; |
| 31 class IOBuffer; | 30 class IOBuffer; |
| 31 class NetworkDelegate; |
| 32 class SSLCertRequestInfo; | 32 class SSLCertRequestInfo; |
| 33 class SSLInfo; | 33 class SSLInfo; |
| 34 class URLRequest; | 34 class URLRequest; |
| 35 class UploadData; | 35 class UploadData; |
| 36 class URLRequestStatus; | 36 class URLRequestStatus; |
| 37 class X509Certificate; | 37 class X509Certificate; |
| 38 | 38 |
| 39 class NET_EXPORT URLRequestJob : public base::RefCounted<URLRequestJob>, | 39 class NET_EXPORT URLRequestJob : public base::RefCounted<URLRequestJob>, |
| 40 public base::SystemMonitor::PowerObserver { | 40 public base::SystemMonitor::PowerObserver { |
| 41 public: | 41 public: |
| 42 explicit URLRequestJob(URLRequest* request); | 42 explicit URLRequestJob(URLRequest* request, |
| 43 NetworkDelegate* network_delegate); |
| 43 | 44 |
| 44 // Returns the request that owns this job. THIS POINTER MAY BE NULL if the | 45 // Returns the request that owns this job. THIS POINTER MAY BE NULL if the |
| 45 // request was destroyed. | 46 // request was destroyed. |
| 46 URLRequest* request() const { | 47 URLRequest* request() const { |
| 47 return request_; | 48 return request_; |
| 48 } | 49 } |
| 49 | 50 |
| 50 // Sets the upload data, most requests have no upload data, so this is a NOP. | 51 // Sets the upload data, most requests have no upload data, so this is a NOP. |
| 51 // Job types supporting upload data will override this. | 52 // Job types supporting upload data will override this. |
| 52 virtual void SetUpload(UploadData* upload); | 53 virtual void SetUpload(UploadData* upload); |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 // OnResponseStarted callback and potentially redirect callbacks as well. | 366 // OnResponseStarted callback and potentially redirect callbacks as well. |
| 366 bool has_handled_response_; | 367 bool has_handled_response_; |
| 367 | 368 |
| 368 // Expected content size | 369 // Expected content size |
| 369 int64 expected_content_size_; | 370 int64 expected_content_size_; |
| 370 | 371 |
| 371 // Set when a redirect is deferred. | 372 // Set when a redirect is deferred. |
| 372 GURL deferred_redirect_url_; | 373 GURL deferred_redirect_url_; |
| 373 int deferred_redirect_status_code_; | 374 int deferred_redirect_status_code_; |
| 374 | 375 |
| 376 NetworkDelegate* network_delegate_; |
| 377 |
| 375 base::WeakPtrFactory<URLRequestJob> weak_factory_; | 378 base::WeakPtrFactory<URLRequestJob> weak_factory_; |
| 376 | 379 |
| 377 DISALLOW_COPY_AND_ASSIGN(URLRequestJob); | 380 DISALLOW_COPY_AND_ASSIGN(URLRequestJob); |
| 378 }; | 381 }; |
| 379 | 382 |
| 380 } // namespace net | 383 } // namespace net |
| 381 | 384 |
| 382 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_H_ | 385 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_H_ |
| OLD | NEW |