OLD | NEW |
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 CLOUD_PRINT_GCP20_PROTOTYPE_CLOUD_PRINT_URL_REQUEST_CONTEXT_GETTER_H_ | 5 #ifndef CLOUD_PRINT_GCP20_PROTOTYPE_CLOUD_PRINT_URL_REQUEST_CONTEXT_GETTER_H_ |
6 #define CLOUD_PRINT_GCP20_PROTOTYPE_CLOUD_PRINT_URL_REQUEST_CONTEXT_GETTER_H_ | 6 #define CLOUD_PRINT_GCP20_PROTOTYPE_CLOUD_PRINT_URL_REQUEST_CONTEXT_GETTER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "net/url_request/url_request_context_getter.h" | 10 #include "net/url_request/url_request_context_getter.h" |
11 | 11 |
12 // Used to return a dummy context, which lives on the message loop | 12 // Used to return a dummy context, which lives on the message loop |
13 // given in the constructor. | 13 // given in the constructor. |
14 class CloudPrintURLRequestContextGetter : public net::URLRequestContextGetter { | 14 class CloudPrintURLRequestContextGetter : public net::URLRequestContextGetter { |
15 public: | 15 public: |
16 // |task_runner| must not be NULL. | 16 // |task_runner| must not be NULL. |
17 explicit CloudPrintURLRequestContextGetter( | 17 explicit CloudPrintURLRequestContextGetter( |
18 scoped_refptr<base::SingleThreadTaskRunner> task_runner); | 18 scoped_refptr<base::SingleThreadTaskRunner> task_runner); |
19 | 19 |
20 // URLRequestContextGetter implementation. | 20 // URLRequestContextGetter implementation. |
21 virtual net::URLRequestContext* GetURLRequestContext() OVERRIDE; | 21 virtual net::URLRequestContext* GetURLRequestContext() override; |
22 | 22 |
23 virtual scoped_refptr<base::SingleThreadTaskRunner> | 23 virtual scoped_refptr<base::SingleThreadTaskRunner> |
24 GetNetworkTaskRunner() const OVERRIDE; | 24 GetNetworkTaskRunner() const override; |
25 | 25 |
26 private: | 26 private: |
27 virtual ~CloudPrintURLRequestContextGetter(); | 27 virtual ~CloudPrintURLRequestContextGetter(); |
28 | 28 |
29 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner_; | 29 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner_; |
30 scoped_ptr<net::URLRequestContext> context_; | 30 scoped_ptr<net::URLRequestContext> context_; |
31 | 31 |
32 DISALLOW_COPY_AND_ASSIGN(CloudPrintURLRequestContextGetter); | 32 DISALLOW_COPY_AND_ASSIGN(CloudPrintURLRequestContextGetter); |
33 }; | 33 }; |
34 | 34 |
35 #endif // CLOUD_PRINT_GCP20_PROTOTYPE_CLOUD_PRINT_URL_REQUEST_CONTEXT_GETTER_H_ | 35 #endif // CLOUD_PRINT_GCP20_PROTOTYPE_CLOUD_PRINT_URL_REQUEST_CONTEXT_GETTER_H_ |
36 | 36 |
OLD | NEW |