| 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_pipelined_connection_impl.h" | 5 #include "net/http/http_pipelined_connection_impl.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 922 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 933 // 1. DoReadHeadersLoop, which will post: | 933 // 1. DoReadHeadersLoop, which will post: |
| 934 // 2. InvokeUserCallback | 934 // 2. InvokeUserCallback |
| 935 SuddenCloseObserver observer(evicted_stream.get(), 2); | 935 SuddenCloseObserver observer(evicted_stream.get(), 2); |
| 936 MessageLoop::current()->AddTaskObserver(&observer); | 936 MessageLoop::current()->AddTaskObserver(&observer); |
| 937 MessageLoop::current()->RunUntilIdle(); | 937 MessageLoop::current()->RunUntilIdle(); |
| 938 EXPECT_FALSE(evicted_callback.have_result()); | 938 EXPECT_FALSE(evicted_callback.have_result()); |
| 939 } | 939 } |
| 940 | 940 |
| 941 class StreamDeleter { | 941 class StreamDeleter { |
| 942 public: | 942 public: |
| 943 StreamDeleter(HttpStream* stream) : | 943 explicit StreamDeleter(HttpStream* stream) : |
| 944 stream_(stream), | 944 stream_(stream), |
| 945 ALLOW_THIS_IN_INITIALIZER_LIST(callback_( | 945 ALLOW_THIS_IN_INITIALIZER_LIST(callback_( |
| 946 base::Bind(&StreamDeleter::OnIOComplete, base::Unretained(this)))) { | 946 base::Bind(&StreamDeleter::OnIOComplete, base::Unretained(this)))) { |
| 947 } | 947 } |
| 948 | 948 |
| 949 const CompletionCallback& callback() { return callback_; } | 949 const CompletionCallback& callback() { return callback_; } |
| 950 | 950 |
| 951 private: | 951 private: |
| 952 void OnIOComplete(int result) { | 952 void OnIOComplete(int result) { |
| 953 delete stream_; | 953 delete stream_; |
| (...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1536 MessageLoop::current()->RunUntilIdle(); | 1536 MessageLoop::current()->RunUntilIdle(); |
| 1537 | 1537 |
| 1538 stream->Close(false); | 1538 stream->Close(false); |
| 1539 EXPECT_CALL(delegate_, OnPipelineHasCapacity(pipeline_.get())).Times(1); | 1539 EXPECT_CALL(delegate_, OnPipelineHasCapacity(pipeline_.get())).Times(1); |
| 1540 stream.reset(NULL); | 1540 stream.reset(NULL); |
| 1541 } | 1541 } |
| 1542 | 1542 |
| 1543 } // anonymous namespace | 1543 } // anonymous namespace |
| 1544 | 1544 |
| 1545 } // namespace net | 1545 } // namespace net |
| OLD | NEW |