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

Unified Diff: net/url_request/url_request_context_builder.h

Issue 2951813002: Make URLRequestContextBuilder use base/task_scheduler/ (Closed)
Patch Set: Merge Created 3 years, 6 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/network/url_loader_unittest.cc ('k') | net/url_request/url_request_context_builder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_context_builder.h
diff --git a/net/url_request/url_request_context_builder.h b/net/url_request/url_request_context_builder.h
index 2a520017cae85457ef517e3a0daf942eba8e52dc..e4c77c66aa896fd69d75db0705cf7ac559ca2d81 100644
--- a/net/url_request/url_request_context_builder.h
+++ b/net/url_request/url_request_context_builder.h
@@ -26,6 +26,7 @@
#include "base/files/file_path.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
+#include "base/task_scheduler/task_traits.h"
#include "build/build_config.h"
#include "net/base/net_export.h"
#include "net/base/network_delegate.h"
@@ -42,6 +43,8 @@
namespace base {
class SingleThreadTaskRunner;
+class SequencedTaskRunner;
+class TaskRunner;
}
namespace net {
@@ -325,8 +328,8 @@ class NET_EXPORT URLRequestContextBuilder {
std::unique_ptr<CookieStore> cookie_store,
std::unique_ptr<ChannelIDService> channel_id_service);
- // Sets the task runner used to perform file operations. If not set, one will
- // be created.
+ // Sets the task runner used to perform file operations. If not set,
+ // TaskSchedulers will be used instead.
void SetFileTaskRunner(
const scoped_refptr<base::SingleThreadTaskRunner>& task_runner);
@@ -358,6 +361,16 @@ class NET_EXPORT URLRequestContextBuilder {
NetworkDelegate* network_delegate,
NetLog* net_log);
+ // Returns a TaskRunner with the specified traits. If |file_task_runner_| is
+ // non-NULL, uses that. Otherwise, uses base/task_scheduler/ and the specified
+ // traits.
Randy Smith (Not in Mondays) 2017/06/27 21:00:51 Confirming that it's intentional on your part that
mmenke 2017/06/27 21:10:25 Yes, that's deliberate. While I'm not sure subcla
+ scoped_refptr<base::TaskRunner> GetFileTaskRunner(
+ const base::TaskTraits& traits);
+ scoped_refptr<base::SequencedTaskRunner> GetFileSequencedTaskRunner(
+ const base::TaskTraits& traits);
+ scoped_refptr<base::SingleThreadTaskRunner> GetFileSingleThreadTaskRunner(
+ const base::TaskTraits& traits);
Randy Smith (Not in Mondays) 2017/06/27 21:00:51 Thought (i.e. a notch underneath suggestion): At t
mmenke 2017/06/27 21:10:25 I'll have to use these again for the cookie store
+
private:
const char* name_;
bool enable_brotli_;
« no previous file with comments | « content/network/url_loader_unittest.cc ('k') | net/url_request/url_request_context_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698