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/string_number_conversions.h" | 8 #include "base/string_number_conversions.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/strings/string_split.h" | 10 #include "base/strings/string_split.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 return ERR_NETWORK_IO_SUSPENDED; | 55 return ERR_NETWORK_IO_SUSPENDED; |
56 | 56 |
57 trans->reset(new HttpNetworkTransaction(priority, GetSession())); | 57 trans->reset(new HttpNetworkTransaction(priority, GetSession())); |
58 return OK; | 58 return OK; |
59 } | 59 } |
60 | 60 |
61 HttpCache* HttpNetworkLayer::GetCache() { | 61 HttpCache* HttpNetworkLayer::GetCache() { |
62 return NULL; | 62 return NULL; |
63 } | 63 } |
64 | 64 |
65 HttpNetworkSession* HttpNetworkLayer::GetSession() { | 65 HttpNetworkSession* HttpNetworkLayer::GetSession() { return session_.get(); } |
66 return session_; | |
67 } | |
68 | 66 |
69 void HttpNetworkLayer::OnSuspend() { | 67 void HttpNetworkLayer::OnSuspend() { |
70 suspended_ = true; | 68 suspended_ = true; |
71 | 69 |
72 if (session_) | 70 if (session_.get()) |
73 session_->CloseIdleConnections(); | 71 session_->CloseIdleConnections(); |
74 } | 72 } |
75 | 73 |
76 void HttpNetworkLayer::OnResume() { | 74 void HttpNetworkLayer::OnResume() { |
77 suspended_ = false; | 75 suspended_ = false; |
78 } | 76 } |
79 | 77 |
80 } // namespace net | 78 } // namespace net |
OLD | NEW |