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/spdy/spdy_proxy_client_socket.h" | 5 #include "net/spdy/spdy_proxy_client_socket.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "net/base/address_list.h" | 10 #include "net/base/address_list.h" |
(...skipping 1299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1310 // CompletionCallback that causes the SpdyProxyClientSocket to be | 1310 // CompletionCallback that causes the SpdyProxyClientSocket to be |
1311 // deleted when Run is invoked. | 1311 // deleted when Run is invoked. |
1312 class DeleteSockCallback : public TestCompletionCallbackBase { | 1312 class DeleteSockCallback : public TestCompletionCallbackBase { |
1313 public: | 1313 public: |
1314 explicit DeleteSockCallback(scoped_ptr<SpdyProxyClientSocket>* sock) | 1314 explicit DeleteSockCallback(scoped_ptr<SpdyProxyClientSocket>* sock) |
1315 : sock_(sock), | 1315 : sock_(sock), |
1316 callback_(base::Bind(&DeleteSockCallback::OnComplete, | 1316 callback_(base::Bind(&DeleteSockCallback::OnComplete, |
1317 base::Unretained(this))) { | 1317 base::Unretained(this))) { |
1318 } | 1318 } |
1319 | 1319 |
1320 virtual ~DeleteSockCallback() { | 1320 ~DeleteSockCallback() override {} |
1321 } | |
1322 | 1321 |
1323 const CompletionCallback& callback() const { return callback_; } | 1322 const CompletionCallback& callback() const { return callback_; } |
1324 | 1323 |
1325 private: | 1324 private: |
1326 void OnComplete(int result) { | 1325 void OnComplete(int result) { |
1327 sock_->reset(NULL); | 1326 sock_->reset(NULL); |
1328 SetResult(result); | 1327 SetResult(result); |
1329 } | 1328 } |
1330 | 1329 |
1331 scoped_ptr<SpdyProxyClientSocket>* sock_; | 1330 scoped_ptr<SpdyProxyClientSocket>* sock_; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1375 | 1374 |
1376 EXPECT_FALSE(sock_.get()); | 1375 EXPECT_FALSE(sock_.get()); |
1377 EXPECT_TRUE(read_callback.have_result()); | 1376 EXPECT_TRUE(read_callback.have_result()); |
1378 EXPECT_FALSE(write_callback_.have_result()); | 1377 EXPECT_FALSE(write_callback_.have_result()); |
1379 | 1378 |
1380 // Let the RST_STREAM write while |rst| is in-scope. | 1379 // Let the RST_STREAM write while |rst| is in-scope. |
1381 base::MessageLoop::current()->RunUntilIdle(); | 1380 base::MessageLoop::current()->RunUntilIdle(); |
1382 } | 1381 } |
1383 | 1382 |
1384 } // namespace net | 1383 } // namespace net |
OLD | NEW |