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

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

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: make HWNDMessageHandler as a friend class of PowerMonitor 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 #include "net/url_request/url_request_job.h" 5 #include "net/url_request/url_request_job.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/string_number_conversions.h" 10 #include "base/string_number_conversions.h"
(...skipping 16 matching lines...) Expand all
27 prefilter_bytes_read_(0), 27 prefilter_bytes_read_(0),
28 postfilter_bytes_read_(0), 28 postfilter_bytes_read_(0),
29 filter_input_byte_count_(0), 29 filter_input_byte_count_(0),
30 filter_needs_more_output_space_(false), 30 filter_needs_more_output_space_(false),
31 filtered_read_buffer_len_(0), 31 filtered_read_buffer_len_(0),
32 has_handled_response_(false), 32 has_handled_response_(false),
33 expected_content_size_(-1), 33 expected_content_size_(-1),
34 deferred_redirect_status_code_(-1), 34 deferred_redirect_status_code_(-1),
35 network_delegate_(network_delegate), 35 network_delegate_(network_delegate),
36 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) { 36 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) {
37 base::SystemMonitor* system_monitor = base::SystemMonitor::Get(); 37 base::PowerMonitor* system_monitor = base::PowerMonitor::Get();
38 if (system_monitor) 38 if (system_monitor)
39 base::SystemMonitor::Get()->AddPowerObserver(this); 39 base::PowerMonitor::Get()->AddPowerObserver(this);
40 } 40 }
41 41
42 void URLRequestJob::SetUpload(UploadData* upload) { 42 void URLRequestJob::SetUpload(UploadData* upload) {
43 } 43 }
44 44
45 void URLRequestJob::SetExtraRequestHeaders(const HttpRequestHeaders& headers) { 45 void URLRequestJob::SetExtraRequestHeaders(const HttpRequestHeaders& headers) {
46 } 46 }
47 47
48 void URLRequestJob::Kill() { 48 void URLRequestJob::Kill() {
49 weak_factory_.InvalidateWeakPtrs(); 49 weak_factory_.InvalidateWeakPtrs();
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 } 213 }
214 214
215 void URLRequestJob::OnSuspend() { 215 void URLRequestJob::OnSuspend() {
216 Kill(); 216 Kill();
217 } 217 }
218 218
219 void URLRequestJob::NotifyURLRequestDestroyed() { 219 void URLRequestJob::NotifyURLRequestDestroyed() {
220 } 220 }
221 221
222 URLRequestJob::~URLRequestJob() { 222 URLRequestJob::~URLRequestJob() {
223 base::SystemMonitor* system_monitor = base::SystemMonitor::Get(); 223 base::PowerMonitor* system_monitor = base::PowerMonitor::Get();
224 if (system_monitor) 224 if (system_monitor)
225 base::SystemMonitor::Get()->RemovePowerObserver(this); 225 base::PowerMonitor::Get()->RemovePowerObserver(this);
226 } 226 }
227 227
228 void URLRequestJob::NotifyCertificateRequested( 228 void URLRequestJob::NotifyCertificateRequested(
229 SSLCertRequestInfo* cert_request_info) { 229 SSLCertRequestInfo* cert_request_info) {
230 if (!request_) 230 if (!request_)
231 return; // The request was destroyed, so there is no more work to do. 231 return; // The request was destroyed, so there is no more work to do.
232 232
233 request_->NotifyCertificateRequested(cert_request_info); 233 request_->NotifyCertificateRequested(cert_request_info);
234 } 234 }
235 235
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after
699 } 699 }
700 700
701 bool URLRequestJob::FilterHasData() { 701 bool URLRequestJob::FilterHasData() {
702 return filter_.get() && filter_->stream_data_len(); 702 return filter_.get() && filter_->stream_data_len();
703 } 703 }
704 704
705 void URLRequestJob::UpdatePacketReadTimes() { 705 void URLRequestJob::UpdatePacketReadTimes() {
706 } 706 }
707 707
708 } // namespace net 708 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698