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

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

Issue 10959020: SystemMonitor refactoring: move power state monitor into a separate class called PowerMonitor (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 2 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
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 #include <map>
willchan no longer on Chromium 2012/10/12 18:17:15 alphabetical order please
Hongbo Min 2012/10/13 06:36:07 Done.
10 11
11 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
12 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
13 #include "base/memory/weak_ptr.h" 14 #include "base/memory/weak_ptr.h"
14 #include "base/system_monitor/system_monitor.h" 15 #include "base/power_monitor/power_observer.h"
15 #include "googleurl/src/gurl.h" 16 #include "googleurl/src/gurl.h"
16 #include "net/base/filter.h" 17 #include "net/base/filter.h"
17 #include "net/base/host_port_pair.h" 18 #include "net/base/host_port_pair.h"
18 #include "net/base/load_states.h" 19 #include "net/base/load_states.h"
19 #include "net/base/net_export.h" 20 #include "net/base/net_export.h"
20 #include "net/base/upload_progress.h" 21 #include "net/base/upload_progress.h"
21 #include "net/cookies/canonical_cookie.h" 22 #include "net/cookies/canonical_cookie.h"
22 23
23 namespace net { 24 namespace net {
24 25
25 class AuthChallengeInfo; 26 class AuthChallengeInfo;
26 class AuthCredentials; 27 class AuthCredentials;
27 class CookieOptions; 28 class CookieOptions;
28 class HttpRequestHeaders; 29 class HttpRequestHeaders;
29 class HttpResponseInfo; 30 class HttpResponseInfo;
30 class IOBuffer; 31 class IOBuffer;
31 class NetworkDelegate; 32 class NetworkDelegate;
32 class SSLCertRequestInfo; 33 class SSLCertRequestInfo;
33 class SSLInfo; 34 class SSLInfo;
34 class URLRequest; 35 class URLRequest;
35 class UploadData; 36 class UploadData;
36 class URLRequestStatus; 37 class URLRequestStatus;
37 class X509Certificate; 38 class X509Certificate;
38 39
39 class NET_EXPORT URLRequestJob : public base::RefCounted<URLRequestJob>, 40 class NET_EXPORT URLRequestJob : public base::RefCounted<URLRequestJob>,
40 public base::SystemMonitor::PowerObserver { 41 public base::PowerObserver {
41 public: 42 public:
42 explicit URLRequestJob(URLRequest* request, 43 explicit URLRequestJob(URLRequest* request,
43 NetworkDelegate* network_delegate); 44 NetworkDelegate* network_delegate);
44 45
45 // Returns the request that owns this job. THIS POINTER MAY BE NULL if the 46 // Returns the request that owns this job. THIS POINTER MAY BE NULL if the
46 // request was destroyed. 47 // request was destroyed.
47 URLRequest* request() const { 48 URLRequest* request() const {
48 return request_; 49 return request_;
49 } 50 }
50 51
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 bool has_response_started() const { return has_handled_response_; } 180 bool has_response_started() const { return has_handled_response_; }
180 181
181 // These methods are not applicable to all connections. 182 // These methods are not applicable to all connections.
182 virtual bool GetMimeType(std::string* mime_type) const; 183 virtual bool GetMimeType(std::string* mime_type) const;
183 virtual int GetResponseCode() const; 184 virtual int GetResponseCode() const;
184 185
185 // Returns the socket address for the connection. 186 // Returns the socket address for the connection.
186 // See url_request.h for details. 187 // See url_request.h for details.
187 virtual HostPortPair GetSocketAddress() const; 188 virtual HostPortPair GetSocketAddress() const;
188 189
189 // base::SystemMonitor::PowerObserver methods: 190 // base::PowerObserver methods:
190 // We invoke URLRequestJob::Kill on suspend (crbug.com/4606). 191 // We invoke URLRequestJob::Kill on suspend (crbug.com/4606).
191 virtual void OnSuspend() OVERRIDE; 192 virtual void OnSuspend() OVERRIDE;
192 193
193 // Called after a NetworkDelegate has been informed that the URLRequest 194 // Called after a NetworkDelegate has been informed that the URLRequest
194 // will be destroyed. This is used to track that no pending callbacks 195 // will be destroyed. This is used to track that no pending callbacks
195 // exist at destruction time of the URLRequestJob, unless they have been 196 // exist at destruction time of the URLRequestJob, unless they have been
196 // canceled by an explicit NetworkDelegate::NotifyURLRequestDestroyed() call. 197 // canceled by an explicit NetworkDelegate::NotifyURLRequestDestroyed() call.
197 virtual void NotifyURLRequestDestroyed(); 198 virtual void NotifyURLRequestDestroyed();
198 199
199 protected: 200 protected:
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 NetworkDelegate* network_delegate_; 380 NetworkDelegate* network_delegate_;
380 381
381 base::WeakPtrFactory<URLRequestJob> weak_factory_; 382 base::WeakPtrFactory<URLRequestJob> weak_factory_;
382 383
383 DISALLOW_COPY_AND_ASSIGN(URLRequestJob); 384 DISALLOW_COPY_AND_ASSIGN(URLRequestJob);
384 }; 385 };
385 386
386 } // namespace net 387 } // namespace net
387 388
388 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_H_ 389 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698