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

Unified Diff: net/http/http_transaction_test_util.h

Issue 2519473002: Fixes the cache lock issue. (Closed)
Patch Set: Initial patch Created 4 years 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_transaction_test_util.h
diff --git a/net/http/http_transaction_test_util.h b/net/http/http_transaction_test_util.h
index 718fe2727bcd0c7270c08273cfb5879452212ca0..ca5c4c53cea9ee620368a14e276e6819ab207b02 100644
--- a/net/http/http_transaction_test_util.h
+++ b/net/http/http_transaction_test_util.h
@@ -14,6 +14,7 @@
#include "base/callback.h"
#include "base/compiler_specific.h"
#include "base/memory/weak_ptr.h"
+#include "base/run_loop.h"
#include "base/strings/string16.h"
#include "net/base/io_buffer.h"
#include "net/base/load_flags.h"
@@ -201,6 +202,9 @@ class MockNetworkTransaction
int Read(IOBuffer* buf,
int buf_len,
const CompletionCallback& callback) override;
+
+ void Orphan(std::unique_ptr<HttpTransaction> trans) override;
+
void PopulateNetErrorDetails(NetErrorDetails* details) const override;
void StopCaching() override;
@@ -347,12 +351,42 @@ class MockNetworkLayer : public HttpTransactionFactory,
base::WeakPtr<MockNetworkTransaction> last_transaction_;
};
+struct Context {
+ Context();
+
+ int result;
+ TestCompletionCallback callback;
+ std::unique_ptr<HttpTransaction> trans;
+ ~Context();
+};
+
//-----------------------------------------------------------------------------
// helpers
// read the transaction completely
int ReadTransaction(HttpTransaction* trans, std::string* result);
+int ReadSharedWritersCacheRead(std::vector<Context*>& context_list,
+ std::vector<std::string>& results);
+
+int ReadSharedWritersJoinedRead(std::vector<Context*>& context_list,
+ std::vector<std::string>& results);
+
+int ReadSharedWritersJoinedReadDoneReading(std::vector<Context*>& context_list,
+ std::vector<std::string>& results);
+
+int ReadSharedWritersJoinedReadDoomCurrentWriter(
+ std::vector<Context*>& context_list,
+ std::vector<std::string>& results);
+
+int ReadSharedWritersJoinedReadDeleteWaitingWriter(
+ std::vector<Context*>& context_list,
+ std::vector<std::string>& results);
+
+int ReadSharedWritersJoinedReadDeleteIdleWriter(
+ std::vector<Context*>& context_list,
+ std::vector<std::string>& results);
+
} // namespace net
#endif // NET_HTTP_HTTP_TRANSACTION_UNITTEST_H_

Powered by Google App Engine
This is Rietveld 408576698