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

Unified Diff: net/url_request/url_request_data_job_fuzzer.cc

Issue 2697843002: Add ScopedTaskScheduler in URLRequestDataJobFuzzerHarness. (Closed)
Patch Set: CR xunjieli #8 Created 3 years, 10 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 | « no previous file | 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_data_job_fuzzer.cc
diff --git a/net/url_request/url_request_data_job_fuzzer.cc b/net/url_request/url_request_data_job_fuzzer.cc
index 003edd5cb223e6221bd8432656b251992616c840..82b6047f2bd1ff897efe9b1c0ba4d42b4c21c5ce 100644
--- a/net/url_request/url_request_data_job_fuzzer.cc
+++ b/net/url_request/url_request_data_job_fuzzer.cc
@@ -7,8 +7,10 @@
#include "base/memory/ptr_util.h"
#include "base/memory/singleton.h"
+#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
#include "base/test/fuzzed_data_provider.h"
+#include "base/test/scoped_task_scheduler.h"
#include "base/threading/thread_task_runner_handle.h"
#include "net/http/http_request_headers.h"
#include "net/url_request/data_protocol_handler.h"
@@ -29,7 +31,9 @@ const size_t kMaxLengthForFuzzedRange = 32;
class URLRequestDataJobFuzzerHarness : public net::URLRequest::Delegate {
public:
URLRequestDataJobFuzzerHarness()
- : context_(true), task_runner_(base::ThreadTaskRunnerHandle::Get()) {
+ : scoped_task_scheduler_(base::MessageLoop::current()),
+ task_runner_(base::ThreadTaskRunnerHandle::Get()),
+ context_(true) {
job_factory_.SetProtocolHandler(
"data", base::MakeUnique<net::DataProtocolHandler>());
context_.set_job_factory(&job_factory_);
@@ -155,11 +159,13 @@ class URLRequestDataJobFuzzerHarness : public net::URLRequest::Delegate {
private:
friend struct base::DefaultSingletonTraits<URLRequestDataJobFuzzerHarness>;
+ base::test::ScopedTaskScheduler scoped_task_scheduler_;
+ scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
+
net::TestURLRequestContext context_;
net::URLRequestJobFactoryImpl job_factory_;
std::vector<size_t> read_lengths_;
scoped_refptr<net::IOBuffer> buf_;
- scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
base::RunLoop* read_loop_;
DISALLOW_COPY_AND_ASSIGN(URLRequestDataJobFuzzerHarness);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698