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

Unified Diff: components/component_updater/test/url_request_post_interceptor.h

Issue 514473002: Componentize component_updater: Break content/ dependency for rest of component_updater tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
Index: components/component_updater/test/url_request_post_interceptor.h
diff --git a/components/component_updater/test/url_request_post_interceptor.h b/components/component_updater/test/url_request_post_interceptor.h
index 5699d0768be08f721f272ce13a3b2ca7eab1e39b..709fabecbc6008e641c7b33ec4b55f1e402b90fd 100644
--- a/components/component_updater/test/url_request_post_interceptor.h
+++ b/components/component_updater/test/url_request_post_interceptor.h
@@ -12,11 +12,13 @@
#include <vector>
#include "base/basictypes.h"
+#include "base/memory/ref_counted.h"
#include "base/synchronization/lock.h"
#include "url/gurl.h"
namespace base {
class FilePath;
+class SequencedTaskRunner;
}
namespace net {
@@ -92,11 +94,14 @@ class URLRequestPostInterceptor {
friend class URLRequestPostInterceptorFactory;
typedef std::pair<const RequestMatcher*, std::string> Expectation;
- explicit URLRequestPostInterceptor(const GURL& url);
+ explicit URLRequestPostInterceptor(
Sorin Jianu 2014/08/27 17:36:02 In general, explicit is used for one param ctor in
tommycli 2014/08/27 17:59:22 Done.
+ const GURL& url,
+ const scoped_refptr<base::SequencedTaskRunner>& io_task_runner);
~URLRequestPostInterceptor();
void ClearExpectations();
const GURL url_;
+ scoped_refptr<base::SequencedTaskRunner> io_task_runner_;
mutable base::Lock interceptor_lock_;
mutable int hit_count_;
@@ -108,8 +113,10 @@ class URLRequestPostInterceptor {
class URLRequestPostInterceptorFactory {
public:
- URLRequestPostInterceptorFactory(const std::string& scheme,
- const std::string& hostname);
+ URLRequestPostInterceptorFactory(
+ const std::string& scheme,
+ const std::string& hostname,
+ const scoped_refptr<base::SequencedTaskRunner>& io_task_runner);
~URLRequestPostInterceptorFactory();
// Creates an interceptor object for the specified url path. Returns NULL
@@ -120,6 +127,7 @@ class URLRequestPostInterceptorFactory {
private:
const std::string scheme_;
const std::string hostname_;
+ scoped_refptr<base::SequencedTaskRunner> io_task_runner_;
// After creation, |delegate_| lives on the IO thread and it is owned by
// a URLRequestFilter after registration. A task to unregister it and
@@ -132,7 +140,8 @@ class URLRequestPostInterceptorFactory {
// Intercepts HTTP POST requests sent to "localhost2".
class InterceptorFactory : public URLRequestPostInterceptorFactory {
public:
- InterceptorFactory();
+ InterceptorFactory(
Sorin Jianu 2014/08/27 17:36:02 explicit
tommycli 2014/08/27 17:59:22 Done.
+ const scoped_refptr<base::SequencedTaskRunner>& io_task_runner);
~InterceptorFactory();
URLRequestPostInterceptor* CreateInterceptor();

Powered by Google App Engine
This is Rietveld 408576698