OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_CHROMIUM_URL_REQUEST_H_ | 5 #ifndef REMOTING_BASE_CHROMIUM_URL_REQUEST_H_ |
6 #define REMOTING_BASE_CHROMIUM_URL_REQUEST_H_ | 6 #define REMOTING_BASE_CHROMIUM_URL_REQUEST_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 // UrlRequest interface. | 29 // UrlRequest interface. |
30 void AddHeader(const std::string& value) override; | 30 void AddHeader(const std::string& value) override; |
31 void SetPostData(const std::string& content_type, | 31 void SetPostData(const std::string& content_type, |
32 const std::string& data) override; | 32 const std::string& data) override; |
33 void Start(const OnResultCallback& on_result_callback) override; | 33 void Start(const OnResultCallback& on_result_callback) override; |
34 | 34 |
35 private: | 35 private: |
36 // net::URLFetcherDelegate interface. | 36 // net::URLFetcherDelegate interface. |
37 void OnURLFetchComplete(const net::URLFetcher* url_fetcher) override; | 37 void OnURLFetchComplete(const net::URLFetcher* url_fetcher) override; |
38 | 38 |
39 scoped_ptr<net::URLFetcher> url_fetcher_; | 39 std::unique_ptr<net::URLFetcher> url_fetcher_; |
40 OnResultCallback on_result_callback_; | 40 OnResultCallback on_result_callback_; |
41 }; | 41 }; |
42 | 42 |
43 class ChromiumUrlRequestFactory : public UrlRequestFactory { | 43 class ChromiumUrlRequestFactory : public UrlRequestFactory { |
44 public: | 44 public: |
45 ChromiumUrlRequestFactory( | 45 ChromiumUrlRequestFactory( |
46 scoped_refptr<net::URLRequestContextGetter> url_context); | 46 scoped_refptr<net::URLRequestContextGetter> url_context); |
47 ~ChromiumUrlRequestFactory() override; | 47 ~ChromiumUrlRequestFactory() override; |
48 | 48 |
49 // UrlRequestFactory interface. | 49 // UrlRequestFactory interface. |
50 scoped_ptr<UrlRequest> CreateUrlRequest(UrlRequest::Type type, | 50 std::unique_ptr<UrlRequest> CreateUrlRequest(UrlRequest::Type type, |
51 const std::string& url) override; | 51 const std::string& url) override; |
52 | 52 |
53 private: | 53 private: |
54 scoped_refptr<net::URLRequestContextGetter> url_context_; | 54 scoped_refptr<net::URLRequestContextGetter> url_context_; |
55 }; | 55 }; |
56 | 56 |
57 } // namespace remoting | 57 } // namespace remoting |
58 | 58 |
59 #endif // REMOTING_BASE_CHROMIUM_URL_REQUEST_H_ | 59 #endif // REMOTING_BASE_CHROMIUM_URL_REQUEST_H_ |
OLD | NEW |