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

Unified Diff: content/browser/loader/test_resource_handler.h

Issue 2623383004: Update InterceptingResourceHandler tests to use MockResourceLoader. (Closed)
Patch Set: Response to comments Created 3 years, 11 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 | « content/browser/loader/mock_resource_loader.cc ('k') | content/browser/loader/test_resource_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/loader/test_resource_handler.h
diff --git a/content/browser/loader/test_resource_handler.h b/content/browser/loader/test_resource_handler.h
index 6269f403b7b45c567eeaab7fc03c5cd2fc83e26d..23316553415639ea01f43857bfc0f0eeb9193f1e 100644
--- a/content/browser/loader/test_resource_handler.h
+++ b/content/browser/loader/test_resource_handler.h
@@ -10,6 +10,7 @@
#include "base/macros.h"
#include "base/memory/ref_counted.h"
+#include "base/memory/weak_ptr.h"
#include "base/run_loop.h"
#include "content/browser/loader/resource_handler.h"
#include "net/base/io_buffer.h"
@@ -157,6 +158,9 @@ class TestResourceHandler : public ResourceHandler {
void WaitUntilResponseComplete();
+ // Returns a weak pointer to |this|. Allows testing object lifetime.
+ base::WeakPtr<TestResourceHandler> GetWeakPtr();
+
private:
// TODO(mmenke): Remove these, in favor of final_status_ and body_.
net::URLRequestStatus* request_status_ptr_;
@@ -208,6 +212,8 @@ class TestResourceHandler : public ResourceHandler {
base::RunLoop response_complete_run_loop_;
+ base::WeakPtrFactory<TestResourceHandler> weak_ptr_factory_;
+
DISALLOW_COPY_AND_ASSIGN(TestResourceHandler);
};
« no previous file with comments | « content/browser/loader/mock_resource_loader.cc ('k') | content/browser/loader/test_resource_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698