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

Side by Side Diff: sync/test/accounts_client/url_request_context_getter.cc

Issue 1138113003: Remove Test Accounts service client (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « sync/test/accounts_client/url_request_context_getter.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "sync/test/accounts_client/url_request_context_getter.h"
6
7 #include <string>
8
9 #include "net/proxy/proxy_config_service_fixed.h"
10 #include "net/url_request/url_request_context.h"
11 #include "net/url_request/url_request_context_builder.h"
12
13 URLRequestContextGetter::URLRequestContextGetter(
14 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner)
15 : network_task_runner_(network_task_runner) {
16 }
17
18 net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() {
19 CHECK(network_task_runner_->BelongsToCurrentThread());
20 if (!url_request_context_) {
21 net::URLRequestContextBuilder builder;
22 // net::HttpServer fails to parse headers if user-agent header is blank.
23 builder.set_user_agent("sync-test-accounts-client");
24 builder.DisableHttpCache();
25 #if defined(OS_LINUX) || defined(OS_ANDROID)
26 builder.set_proxy_config_service(
27 new net::ProxyConfigServiceFixed(net::ProxyConfig::CreateDirect()));
28 #endif
29 url_request_context_.reset(builder.Build());
30 }
31 return url_request_context_.get();
32 }
33
34 scoped_refptr<base::SingleThreadTaskRunner>
35 URLRequestContextGetter::GetNetworkTaskRunner() const {
36 return network_task_runner_;
37 }
38
39 URLRequestContextGetter::~URLRequestContextGetter() {}
OLDNEW
« no previous file with comments | « sync/test/accounts_client/url_request_context_getter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698