| OLD | NEW |
| 1 // Copyright (c) 2017 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2017 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_BROWSER_EXTENSIONS_API_DIAL_DEVICE_DESCRIPTION_FETCHER_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_ROUTER_DISCOVERY_DIAL_DEVICE_DESCRIPTION_FETCHER_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_DIAL_DEVICE_DESCRIPTION_FETCHER_H_ | 6 #define CHROME_BROWSER_MEDIA_ROUTER_DISCOVERY_DIAL_DEVICE_DESCRIPTION_FETCHER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/threading/thread_checker.h" | 12 #include "base/threading/thread_checker.h" |
| 13 #include "content/public/browser/browser_thread.h" | 13 #include "content/public/browser/browser_thread.h" |
| 14 #include "net/url_request/url_fetcher_delegate.h" | 14 #include "net/url_request/url_fetcher_delegate.h" |
| 15 #include "url/gurl.h" | 15 #include "url/gurl.h" |
| 16 | 16 |
| 17 namespace net { | 17 namespace net { |
| 18 class URLFetcher; | 18 class URLFetcher; |
| 19 class URLRequestContextGetter; | 19 class URLRequestContextGetter; |
| 20 } | 20 } |
| 21 | 21 |
| 22 namespace extensions { | 22 namespace media_router { |
| 23 namespace api { | |
| 24 namespace dial { | |
| 25 | 23 |
| 26 struct DialDeviceDescriptionData; | 24 struct DialDeviceDescriptionData; |
| 27 | 25 |
| 28 // Used to make a single HTTP GET request with |device_description_url| to fetch | 26 // Used to make a single HTTP GET request with |device_description_url| to fetch |
| 29 // a uPnP device description from a DIAL device. If successful, |success_cb| is | 27 // a uPnP device description from a DIAL device. If successful, |success_cb| is |
| 30 // invoked with the result; otherwise, |error_cb| is invoked with an error | 28 // invoked with the result; otherwise, |error_cb| is invoked with an error |
| 31 // reason. | 29 // reason. |
| 32 // This class is not thread safe. | 30 // This class is not thread safe. |
| 33 class DeviceDescriptionFetcher : public net::URLFetcherDelegate { | 31 class DeviceDescriptionFetcher : public net::URLFetcherDelegate { |
| 34 public: | 32 public: |
| (...skipping 28 matching lines...) Expand all Loading... |
| 63 | 61 |
| 64 const GURL device_description_url_; | 62 const GURL device_description_url_; |
| 65 const scoped_refptr<net::URLRequestContextGetter> request_context_; | 63 const scoped_refptr<net::URLRequestContextGetter> request_context_; |
| 66 base::ThreadChecker thread_checker_; | 64 base::ThreadChecker thread_checker_; |
| 67 | 65 |
| 68 base::OnceCallback<void(const DialDeviceDescriptionData&)> success_cb_; | 66 base::OnceCallback<void(const DialDeviceDescriptionData&)> success_cb_; |
| 69 base::OnceCallback<void(const std::string&)> error_cb_; | 67 base::OnceCallback<void(const std::string&)> error_cb_; |
| 70 std::unique_ptr<net::URLFetcher> fetcher_; | 68 std::unique_ptr<net::URLFetcher> fetcher_; |
| 71 }; | 69 }; |
| 72 | 70 |
| 73 } // namespace dial | 71 } // namespace media_router |
| 74 } // namespace api | |
| 75 } // namespace extensions | |
| 76 | 72 |
| 77 #endif // CHROME_BROWSER_EXTENSIONS_API_DIAL_DEVICE_DESCRIPTION_FETCHER_H_ | 73 #endif // CHROME_BROWSER_MEDIA_ROUTER_DISCOVERY_DIAL_DEVICE_DESCRIPTION_FETCHER
_H_ |
| OLD | NEW |