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

Side by Side Diff: remoting/base/url_request_context_getter.h

Issue 354693004: Switch to using URLRequestContextBuilder to create some URLRequestContexts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix merge Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « remoting/base/url_request_context.cc ('k') | remoting/base/url_request_context_getter.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef REMOTING_BASE_URL_REQUEST_CONTEXT_H_ 5 #ifndef REMOTING_BASE_URL_REQUEST_CONTEXT_GETTER_H_
6 #define REMOTING_BASE_URL_REQUEST_CONTEXT_H_ 6 #define REMOTING_BASE_URL_REQUEST_CONTEXT_GETTER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 #include "base/message_loop/message_loop.h" 12 #include "base/message_loop/message_loop.h"
13 #include "net/proxy/proxy_config_service.h" 13 #include "net/proxy/proxy_config_service.h"
14 #include "net/url_request/url_request_context.h" 14 #include "net/url_request/url_request_context.h"
15 #include "net/url_request/url_request_context_getter.h" 15 #include "net/url_request/url_request_context_getter.h"
16 #include "net/url_request/url_request_context_storage.h" 16 #include "net/url_request/url_request_context_storage.h"
17 17
18 namespace base { 18 namespace base {
19 class MessageLoopProxy; 19 class MessageLoopProxy;
20 } // namespace base 20 } // namespace base
21 21
22 namespace remoting { 22 namespace remoting {
23 23
24 // Subclass of net::URLRequestContext which can be used to store extra
25 // information for requests. This subclass is meant to be used in the
26 // remoting Me2Me host process where the profile is not available.
27 class URLRequestContext : public net::URLRequestContext {
28 public:
29 explicit URLRequestContext(
30 scoped_ptr<net::ProxyConfigService> proxy_config_service);
31
32 private:
33 virtual ~URLRequestContext();
34
35 net::URLRequestContextStorage storage_;
36
37 DISALLOW_COPY_AND_ASSIGN(URLRequestContext);
38 };
39
40 class URLRequestContextGetter : public net::URLRequestContextGetter { 24 class URLRequestContextGetter : public net::URLRequestContextGetter {
41 public: 25 public:
42 URLRequestContextGetter( 26 URLRequestContextGetter(
43 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner); 27 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner);
44 28
45 // Overridden from net::URLRequestContextGetter: 29 // Overridden from net::URLRequestContextGetter:
46 virtual net::URLRequestContext* GetURLRequestContext() OVERRIDE; 30 virtual net::URLRequestContext* GetURLRequestContext() OVERRIDE;
47 virtual scoped_refptr<base::SingleThreadTaskRunner> 31 virtual scoped_refptr<base::SingleThreadTaskRunner>
48 GetNetworkTaskRunner() const OVERRIDE; 32 GetNetworkTaskRunner() const OVERRIDE;
49 33
50 protected: 34 protected:
51 virtual ~URLRequestContextGetter(); 35 virtual ~URLRequestContextGetter();
52 36
53 private: 37 private:
54 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner_; 38 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner_;
55 scoped_ptr<net::ProxyConfigService> proxy_config_service_; 39 scoped_ptr<net::ProxyConfigService> proxy_config_service_;
56 scoped_ptr<net::URLRequestContext> url_request_context_; 40 scoped_ptr<net::URLRequestContext> url_request_context_;
57 41
58 DISALLOW_COPY_AND_ASSIGN(URLRequestContextGetter); 42 DISALLOW_COPY_AND_ASSIGN(URLRequestContextGetter);
59 }; 43 };
60 44
61 } // namespace remoting 45 } // namespace remoting
62 46
63 #endif // REMOTING_BASE_URL_REQUEST_CONTEXT_H_ 47 #endif // REMOTING_BASE_URL_REQUEST_CONTEXT_GETTER_H_
OLDNEW
« no previous file with comments | « remoting/base/url_request_context.cc ('k') | remoting/base/url_request_context_getter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698