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

Unified Diff: components/domain_reliability/monitor.cc

Issue 292063002: Create a TrivialURLRequestContextGetter to shim an existing URLRequestContext. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync'd up to r272911 Created 6 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 | « no previous file | net/tools/get_server_time/get_server_time.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/domain_reliability/monitor.cc
diff --git a/components/domain_reliability/monitor.cc b/components/domain_reliability/monitor.cc
index 3f0c1ff34bf655c41bf55ebfb2b85e0163257cfc..957a1463ee21eb726f7562220572f1f69c8f2c1b 100644
--- a/components/domain_reliability/monitor.cc
+++ b/components/domain_reliability/monitor.cc
@@ -23,33 +23,6 @@ bool OnIOThread() {
return content::BrowserThread::CurrentlyOn(content::BrowserThread::IO);
}
-// Shamelessly stolen from net/tools/get_server_time/get_server_time.cc.
-// TODO(ttuttle): Merge them, if possible.
-class TrivialURLRequestContextGetter : public net::URLRequestContextGetter {
- public:
- TrivialURLRequestContextGetter(
- net::URLRequestContext* context,
- const scoped_refptr<base::SingleThreadTaskRunner>& main_task_runner)
- : context_(context),
- main_task_runner_(main_task_runner) {}
-
- // net::URLRequestContextGetter implementation:
- virtual net::URLRequestContext* GetURLRequestContext() OVERRIDE {
- return context_;
- }
-
- virtual scoped_refptr<base::SingleThreadTaskRunner>
- GetNetworkTaskRunner() const OVERRIDE {
- return main_task_runner_;
- }
-
- private:
- virtual ~TrivialURLRequestContextGetter() {}
-
- net::URLRequestContext* context_;
- const scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_;
-};
-
} // namespace
namespace domain_reliability {
@@ -59,7 +32,7 @@ DomainReliabilityMonitor::DomainReliabilityMonitor(
const std::string& upload_reporter_string)
: time_(new ActualTime()),
url_request_context_getter_(scoped_refptr<net::URLRequestContextGetter>(
- new TrivialURLRequestContextGetter(
+ new net::TrivialURLRequestContextGetter(
url_request_context,
content::BrowserThread::GetMessageLoopProxyForThread(
content::BrowserThread::IO)))),
@@ -80,7 +53,7 @@ DomainReliabilityMonitor::DomainReliabilityMonitor(
scoped_ptr<MockableTime> time)
: time_(time.Pass()),
url_request_context_getter_(scoped_refptr<net::URLRequestContextGetter>(
- new TrivialURLRequestContextGetter(
+ new net::TrivialURLRequestContextGetter(
url_request_context,
content::BrowserThread::GetMessageLoopProxyForThread(
content::BrowserThread::IO)))),
« no previous file with comments | « no previous file | net/tools/get_server_time/get_server_time.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698