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

Unified Diff: net/http/http_transaction_unittest.cc

Issue 7569027: net: Notify the http job and cache transaction about a filter (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 4 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
« no previous file with comments | « net/http/http_transaction_unittest.h ('k') | net/net.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_transaction_unittest.cc
===================================================================
--- net/http/http_transaction_unittest.cc (revision 95711)
+++ net/http/http_transaction_unittest.cc (working copy)
@@ -212,8 +212,10 @@
}
-MockNetworkTransaction::MockNetworkTransaction() :
- ALLOW_THIS_IN_INITIALIZER_LIST(task_factory_(this)), data_cursor_(0) {
+MockNetworkTransaction::MockNetworkTransaction(MockNetworkLayer* factory)
+ : ALLOW_THIS_IN_INITIALIZER_LIST(task_factory_(this)),
+ data_cursor_(0),
+ transaction_factory_(factory->AsWeakPtr()) {
}
MockNetworkTransaction::~MockNetworkTransaction() {}
@@ -295,6 +297,11 @@
void MockNetworkTransaction::StopCaching() {}
+void MockNetworkTransaction::DoneReading() {
+ if (transaction_factory_)
+ transaction_factory_->TransactionDoneReading();
+}
+
const net::HttpResponseInfo* MockNetworkTransaction::GetResponseInfo() const {
return &response_;
}
@@ -320,14 +327,19 @@
callback->Run(result);
}
-MockNetworkLayer::MockNetworkLayer() : transaction_count_(0) {}
+MockNetworkLayer::MockNetworkLayer()
+ : transaction_count_(0), done_reading_called_(false) {}
MockNetworkLayer::~MockNetworkLayer() {}
+void MockNetworkLayer::TransactionDoneReading() {
+ done_reading_called_ = true;
+}
+
int MockNetworkLayer::CreateTransaction(
scoped_ptr<net::HttpTransaction>* trans) {
transaction_count_++;
- trans->reset(new MockNetworkTransaction());
+ trans->reset(new MockNetworkTransaction(this));
return net::OK;
}
« no previous file with comments | « net/http/http_transaction_unittest.h ('k') | net/net.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698