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

Unified Diff: net/http/http_transaction_test_util.h

Issue 793823002: Let prefetched resources skip cache revalidation once for a short duration. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleaning up Created 6 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 e6e831257e878a8b6d87083229ebab535db5ef7d..1459f2daaa6bcdb57a4b8ec78d925070c96dd989 100644
--- a/net/http/http_transaction_test_util.h
+++ b/net/http/http_transaction_test_util.h
@@ -291,11 +291,23 @@ class MockNetworkLayer : public net::HttpTransactionFactory,
net::HttpCache* GetCache() override;
net::HttpNetworkSession* GetSession() override;
+ // The caller must guarantee that |clock| will outlive this object.
+ void SetClock(base::Clock* clock);
+ base::Clock* clock() const { return clock_; }
+
private:
int transaction_count_;
bool done_reading_called_;
bool stop_caching_called_;
net::RequestPriority last_create_transaction_priority_;
+
+ scoped_ptr<base::Clock> default_clock_;
+
+ // Normally clock_ points to default_clock_ but it can be overridden to point
+ // to a custom
+ // clock set by test_clock().
+ base::Clock* clock_;
+
base::WeakPtr<MockNetworkTransaction> last_transaction_;
};

Powered by Google App Engine
This is Rietveld 408576698