| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_TEST_REMOTE_HOST_INFO_FETCHER_H_ | 5 #ifndef REMOTING_TEST_REMOTE_HOST_INFO_FETCHER_H_ |
| 6 #define REMOTING_TEST_REMOTE_HOST_INFO_FETCHER_H_ | 6 #define REMOTING_TEST_REMOTE_HOST_INFO_FETCHER_H_ |
| 7 | 7 |
| 8 #include <memory> |
| 8 #include <string> | 9 #include <string> |
| 9 | 10 |
| 10 #include "base/callback.h" | 11 #include "base/callback.h" |
| 11 #include "base/macros.h" | 12 #include "base/macros.h" |
| 12 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 13 #include "base/memory/scoped_ptr.h" | |
| 14 #include "net/url_request/url_fetcher_delegate.h" | 14 #include "net/url_request/url_fetcher_delegate.h" |
| 15 #include "remoting/test/app_remoting_service_urls.h" | 15 #include "remoting/test/app_remoting_service_urls.h" |
| 16 #include "remoting/test/remote_host_info.h" | 16 #include "remoting/test/remote_host_info.h" |
| 17 | 17 |
| 18 namespace net { | 18 namespace net { |
| 19 class UrlFetcher; | 19 class UrlFetcher; |
| 20 } | 20 } |
| 21 namespace remoting { | 21 namespace remoting { |
| 22 class URLRequestContextGetter; | 22 class URLRequestContextGetter; |
| 23 } | 23 } |
| (...skipping 21 matching lines...) Expand all Loading... |
| 45 virtual bool RetrieveRemoteHostInfo(const std::string& application_id, | 45 virtual bool RetrieveRemoteHostInfo(const std::string& application_id, |
| 46 const std::string& access_token, | 46 const std::string& access_token, |
| 47 ServiceEnvironment service_environment, | 47 ServiceEnvironment service_environment, |
| 48 const RemoteHostInfoCallback& callback); | 48 const RemoteHostInfoCallback& callback); |
| 49 | 49 |
| 50 private: | 50 private: |
| 51 // net::URLFetcherDelegate interface. | 51 // net::URLFetcherDelegate interface. |
| 52 void OnURLFetchComplete(const net::URLFetcher* source) override; | 52 void OnURLFetchComplete(const net::URLFetcher* source) override; |
| 53 | 53 |
| 54 // Holds the URLFetcher for the RemoteHostInfo request. | 54 // Holds the URLFetcher for the RemoteHostInfo request. |
| 55 scoped_ptr<net::URLFetcher> request_; | 55 std::unique_ptr<net::URLFetcher> request_; |
| 56 | 56 |
| 57 // Provides application-specific context for the network request. | 57 // Provides application-specific context for the network request. |
| 58 scoped_refptr<remoting::URLRequestContextGetter> request_context_getter_; | 58 scoped_refptr<remoting::URLRequestContextGetter> request_context_getter_; |
| 59 | 59 |
| 60 // Caller-supplied callback used to return remote host info on success. | 60 // Caller-supplied callback used to return remote host info on success. |
| 61 RemoteHostInfoCallback remote_host_info_callback_; | 61 RemoteHostInfoCallback remote_host_info_callback_; |
| 62 | 62 |
| 63 DISALLOW_COPY_AND_ASSIGN(RemoteHostInfoFetcher); | 63 DISALLOW_COPY_AND_ASSIGN(RemoteHostInfoFetcher); |
| 64 }; | 64 }; |
| 65 | 65 |
| 66 } // namespace test | 66 } // namespace test |
| 67 } // namespace remoting | 67 } // namespace remoting |
| 68 | 68 |
| 69 #endif // REMOTING_TEST_REMOTE_HOST_INFO_FETCHER_H_ | 69 #endif // REMOTING_TEST_REMOTE_HOST_INFO_FETCHER_H_ |
| OLD | NEW |