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

Side by Side Diff: net/url_request/url_request_context_getter.h

Issue 292063002: Create a TrivialURLRequestContextGetter to shim an existing URLRequestContext. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Tweaks to compile. 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 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 CHROME_COMMON_NET_URL_REQUEST_CONTEXT_GETTER_H_ 5 #ifndef CHROME_COMMON_NET_URL_REQUEST_CONTEXT_GETTER_H_
6 #define CHROME_COMMON_NET_URL_REQUEST_CONTEXT_GETTER_H_ 6 #define CHROME_COMMON_NET_URL_REQUEST_CONTEXT_GETTER_H_
7 7
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/sequenced_task_runner_helpers.h" 9 #include "base/sequenced_task_runner_helpers.h"
10 #include "net/base/net_export.h" 10 #include "net/base/net_export.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 // IO happens. 46 // IO happens.
47 void OnDestruct() const; 47 void OnDestruct() const;
48 }; 48 };
49 49
50 struct URLRequestContextGetterTraits { 50 struct URLRequestContextGetterTraits {
51 static void Destruct(const URLRequestContextGetter* context_getter) { 51 static void Destruct(const URLRequestContextGetter* context_getter) {
52 context_getter->OnDestruct(); 52 context_getter->OnDestruct();
53 } 53 }
54 }; 54 };
55 55
56 // For use in shimming a URLRequestContext into a URLRequestContextGetter.
57 class NET_EXPORT TrivialURLRequestContextGetter
58 : public URLRequestContextGetter {
59 public:
60 TrivialURLRequestContextGetter(
61 net::URLRequestContext* context,
62 const scoped_refptr<base::SingleThreadTaskRunner>& main_task_runner);
63
64 // net::URLRequestContextGetter implementation:
65 virtual net::URLRequestContext* GetURLRequestContext() OVERRIDE;
66
67 virtual scoped_refptr<base::SingleThreadTaskRunner>
68 GetNetworkTaskRunner() const OVERRIDE;
69
70 private:
71 virtual ~TrivialURLRequestContextGetter();
72
73 net::URLRequestContext* context_;
74 const scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_;
75 };
willchan no longer on Chromium 2014/05/22 22:49:01 DISALLOW_COPY_AND_ASSIGN
Randy Smith (Not in Mondays) 2014/05/23 15:40:13 Done.
76
56 } // namespace net 77 } // namespace net
57 78
58 #endif // CHROME_COMMON_NET_URL_REQUEST_CONTEXT_GETTER_H_ 79 #endif // CHROME_COMMON_NET_URL_REQUEST_CONTEXT_GETTER_H_
OLDNEW
« no previous file with comments | « net/tools/get_server_time/get_server_time.cc ('k') | net/url_request/url_request_context_getter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698