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

Unified Diff: net/url_request/url_request_unittest.cc

Issue 7043007: Kill URLRequestJobTracker. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge. Created 9 years, 7 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/url_request/url_request_test_util.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_unittest.cc
diff --git a/net/url_request/url_request_unittest.cc b/net/url_request/url_request_unittest.cc
index 31bea3b7421604d8f4f0adab0465dd9b8276eacf..ebabe8da4a9bd063ec69ccabd8ad58c6ab6bc850 100644
--- a/net/url_request/url_request_unittest.cc
+++ b/net/url_request/url_request_unittest.cc
@@ -12,6 +12,7 @@
#include <algorithm>
#include <string>
+#include "base/compiler_specific.h"
#include "base/file_util.h"
#include "base/format_macros.h"
#include "base/message_loop.h"
@@ -50,13 +51,6 @@
using base::Time;
-// We don't need a refcount because we are guaranteed the test will not proceed
-// until its task is run.
-namespace net {
-class BlockingNetworkDelegate;
-} // namespace net
-DISABLE_RUNNABLE_METHOD_REFCOUNT(net::BlockingNetworkDelegate);
-
namespace net {
namespace {
@@ -126,7 +120,9 @@ void CheckSSLInfo(const SSLInfo& ssl_info) {
// them.
class BlockingNetworkDelegate : public TestNetworkDelegate {
public:
- BlockingNetworkDelegate() : callback_retval_(net::OK) {}
+ BlockingNetworkDelegate()
+ : callback_retval_(net::OK),
+ ALLOW_THIS_IN_INITIALIZER_LIST(method_factory_(this)) {}
void set_callback_retval(int retval) { callback_retval_ = retval; }
void set_redirect_url(const GURL& url) { redirect_url_ = url; }
@@ -145,9 +141,10 @@ class BlockingNetworkDelegate : public TestNetworkDelegate {
if (!redirect_url_.is_empty())
*new_url = redirect_url_;
- MessageLoop::current()->PostTask(FROM_HERE,
- NewRunnableMethod(this, &BlockingNetworkDelegate::DoCallback,
- callback));
+ MessageLoop::current()->PostTask(
+ FROM_HERE,
+ method_factory_.NewRunnableMethod(&BlockingNetworkDelegate::DoCallback,
+ callback));
return net::ERR_IO_PENDING;
}
@@ -157,6 +154,7 @@ class BlockingNetworkDelegate : public TestNetworkDelegate {
int callback_retval_;
GURL redirect_url_;
+ ScopedRunnableMethodFactory<BlockingNetworkDelegate> method_factory_;
};
// Inherit PlatformTest since we require the autorelease pool on Mac OS X.f
« no previous file with comments | « net/url_request/url_request_test_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698