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

Unified Diff: net/http/http_pipelined_network_transaction_unittest.cc

Issue 10690104: DeterministicSocketDataProvider should not be RefCounted (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: net/http/http_pipelined_network_transaction_unittest.cc
diff --git a/net/http/http_pipelined_network_transaction_unittest.cc b/net/http/http_pipelined_network_transaction_unittest.cc
index 872eb9fc11c62f63a404346194a0b1e95f5e52c4..6b4bffafa5b2f0045ba39ae6560c377f6fff721a 100644
--- a/net/http/http_pipelined_network_transaction_unittest.cc
+++ b/net/http/http_pipelined_network_transaction_unittest.cc
@@ -227,7 +227,7 @@ class HttpPipelinedNetworkTransactionTest : public testing::Test {
DeterministicMockClientSocketFactory factory_;
ClientSocketPoolHistograms histograms_;
MockTransportClientSocketPool pool_;
- std::vector<scoped_refptr<DeterministicSocketData> > data_vector_;
+ ScopedVector<DeterministicSocketData> data_vector_;
TestCompletionCallback callback_;
ScopedVector<HttpRequestInfo> request_info_vector_;
bool default_pipelining_enabled_;
@@ -832,7 +832,7 @@ TEST_F(HttpPipelinedNetworkTransactionTest, OpenPipelinesWhileBinding) {
// We need to make sure that the response that triggers OnPipelineFeedback(OK)
// is called in between when task #3 is scheduled and when it runs. The
// DataRunnerObserver does that.
- DataRunnerObserver observer(data_vector_[0].get(), 3);
+ DataRunnerObserver observer(data_vector_[0], 3);
MessageLoop::current()->AddTaskObserver(&observer);
data_vector_[0]->SetStop(4);
MessageLoop::current()->RunAllPending();
@@ -847,13 +847,13 @@ TEST_F(HttpPipelinedNetworkTransactionTest, OpenPipelinesWhileBinding) {
TEST_F(HttpPipelinedNetworkTransactionTest, ProxyChangesWhileConnecting) {
Initialize(false);
- scoped_refptr<DeterministicSocketData> data(
- new DeterministicSocketData(NULL, 0, NULL, 0));
+ DeterministicSocketData* data =
Ryan Hamilton 2012/07/09 17:35:47 Is this a memory leak? (Or does AddSocketDataProv
+ new DeterministicSocketData(NULL, 0, NULL, 0);
data->set_connect_data(MockConnect(ASYNC, ERR_CONNECTION_REFUSED));
factory_.AddSocketDataProvider(data);
- scoped_refptr<DeterministicSocketData> data2(
- new DeterministicSocketData(NULL, 0, NULL, 0));
+ DeterministicSocketData* data2 =
+ new DeterministicSocketData(NULL, 0, NULL, 0);
data2->set_connect_data(MockConnect(ASYNC, ERR_FAILED));
factory_.AddSocketDataProvider(data2);
@@ -915,8 +915,8 @@ TEST_F(HttpPipelinedNetworkTransactionTest,
ForcedPipelineConnectionErrorFailsBoth) {
Initialize(true);
- scoped_refptr<DeterministicSocketData> data(
- new DeterministicSocketData(NULL, 0, NULL, 0));
+ DeterministicSocketData* data =
+ new DeterministicSocketData(NULL, 0, NULL, 0);
data->set_connect_data(MockConnect(ASYNC, ERR_FAILED));
factory_.AddSocketDataProvider(data);
@@ -995,8 +995,8 @@ TEST_F(HttpPipelinedNetworkTransactionTest, ForcedPipelineOrder) {
MockRead reads[] = {
MockRead(ASYNC, ERR_FAILED, 1),
};
- scoped_refptr<DeterministicSocketData> data(new DeterministicSocketData(
- reads, arraysize(reads), writes, arraysize(writes)));
+ DeterministicSocketData* data = new DeterministicSocketData(
+ reads, arraysize(reads), writes, arraysize(writes));
data->set_connect_data(MockConnect(ASYNC, OK));
factory_.AddSocketDataProvider(data);
« no previous file with comments | « net/http/http_pipelined_connection_impl_unittest.cc ('k') | net/http/http_proxy_client_socket_pool_spdy2_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698