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

Side by Side Diff: net/http/http_network_layer.cc

Issue 4013: Port more unit tests in net/http/ (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 12 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « net/http/http_cache_unittest.cc ('k') | net/http/http_transaction_unittest.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/basictypes.h"
7 #include "base/logging.h" 8 #include "base/logging.h"
8 #include "net/base/client_socket_factory.h" 9 #include "net/base/client_socket_factory.h"
9 #include "net/http/http_network_session.h" 10 #include "net/http/http_network_session.h"
11 // TODO(port): Port http_network_transaction and remove #if.
12 #if defined(OS_WIN)
10 #include "net/http/http_network_transaction.h" 13 #include "net/http/http_network_transaction.h"
14 #endif
11 #include "net/proxy/proxy_resolver_fixed.h" 15 #include "net/proxy/proxy_resolver_fixed.h"
12 #if defined(OS_WIN) 16 #if defined(OS_WIN)
13 #include "net/http/http_transaction_winhttp.h" 17 #include "net/http/http_transaction_winhttp.h"
14 #include "net/proxy/proxy_resolver_winhttp.h" 18 #include "net/proxy/proxy_resolver_winhttp.h"
15 #endif 19 #endif
16 20
17 namespace net { 21 namespace net {
18 22
19 //----------------------------------------------------------------------------- 23 //-----------------------------------------------------------------------------
20 24
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 proxy_resolver = NULL; 60 proxy_resolver = NULL;
57 #endif 61 #endif
58 } 62 }
59 session_ = new HttpNetworkSession(proxy_resolver); 63 session_ = new HttpNetworkSession(proxy_resolver);
60 } 64 }
61 65
62 HttpNetworkLayer::~HttpNetworkLayer() { 66 HttpNetworkLayer::~HttpNetworkLayer() {
63 } 67 }
64 68
65 HttpTransaction* HttpNetworkLayer::CreateTransaction() { 69 HttpTransaction* HttpNetworkLayer::CreateTransaction() {
70 #if defined(OS_WIN)
66 if (suspended_) 71 if (suspended_)
67 return NULL; 72 return NULL;
68 73
69 return new HttpNetworkTransaction( 74 return new HttpNetworkTransaction(
70 session_, ClientSocketFactory::GetDefaultFactory()); 75 session_, ClientSocketFactory::GetDefaultFactory());
76 #else
77 NOTIMPLEMENTED();
78 return NULL;
79 #endif
71 } 80 }
72 81
73 HttpCache* HttpNetworkLayer::GetCache() { 82 HttpCache* HttpNetworkLayer::GetCache() {
74 return NULL; 83 return NULL;
75 } 84 }
76 85
77 AuthCache* HttpNetworkLayer::GetAuthCache() { 86 AuthCache* HttpNetworkLayer::GetAuthCache() {
78 return session_->auth_cache(); 87 return session_->auth_cache();
79 } 88 }
80 89
81 void HttpNetworkLayer::Suspend(bool suspend) { 90 void HttpNetworkLayer::Suspend(bool suspend) {
82 suspended_ = suspend; 91 suspended_ = suspend;
83 92
84 if (suspend) 93 if (suspend)
85 session_->connection_pool()->CloseIdleSockets(); 94 session_->connection_pool()->CloseIdleSockets();
86 } 95 }
87 96
88 } // namespace net 97 } // namespace net
89 98
OLDNEW
« no previous file with comments | « net/http/http_cache_unittest.cc ('k') | net/http/http_transaction_unittest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698