OLD | NEW |
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/http/http_network_layer.h" | 5 #include "net/http/http_network_layer.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/power_monitor/power_monitor.h" | 8 #include "base/power_monitor/power_monitor.h" |
9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "base/strings/string_split.h" | 10 #include "base/strings/string_split.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 suspended_(false) { | 24 suspended_(false) { |
25 DCHECK(session_); | 25 DCHECK(session_); |
26 #if defined(OS_WIN) | 26 #if defined(OS_WIN) |
27 base::PowerMonitor* power_monitor = base::PowerMonitor::Get(); | 27 base::PowerMonitor* power_monitor = base::PowerMonitor::Get(); |
28 if (power_monitor) | 28 if (power_monitor) |
29 power_monitor->AddObserver(this); | 29 power_monitor->AddObserver(this); |
30 #endif | 30 #endif |
31 } | 31 } |
32 | 32 |
33 HttpNetworkLayer::~HttpNetworkLayer() { | 33 HttpNetworkLayer::~HttpNetworkLayer() { |
| 34 DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); |
34 #if defined(OS_WIN) | 35 #if defined(OS_WIN) |
35 base::PowerMonitor* power_monitor = base::PowerMonitor::Get(); | 36 base::PowerMonitor* power_monitor = base::PowerMonitor::Get(); |
36 if (power_monitor) | 37 if (power_monitor) |
37 power_monitor->RemoveObserver(this); | 38 power_monitor->RemoveObserver(this); |
38 #endif | 39 #endif |
39 } | 40 } |
40 | 41 |
41 int HttpNetworkLayer::CreateTransaction( | 42 int HttpNetworkLayer::CreateTransaction( |
42 RequestPriority priority, | 43 RequestPriority priority, |
43 std::unique_ptr<HttpTransaction>* trans) { | 44 std::unique_ptr<HttpTransaction>* trans) { |
(...skipping 15 matching lines...) Expand all Loading... |
59 void HttpNetworkLayer::OnSuspend() { | 60 void HttpNetworkLayer::OnSuspend() { |
60 suspended_ = true; | 61 suspended_ = true; |
61 session_->CloseIdleConnections(); | 62 session_->CloseIdleConnections(); |
62 } | 63 } |
63 | 64 |
64 void HttpNetworkLayer::OnResume() { | 65 void HttpNetworkLayer::OnResume() { |
65 suspended_ = false; | 66 suspended_ = false; |
66 } | 67 } |
67 | 68 |
68 } // namespace net | 69 } // namespace net |
OLD | NEW |