| 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_EXTENSIONS_API_DIAL_DEVICE_DESCRIPTION_FETCHER_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_DIAL_DEVICE_DESCRIPTION_FETCHER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_DIAL_DEVICE_DESCRIPTION_FETCHER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 // not outlive it. | 38 // not outlive it. |
| 39 DeviceDescriptionFetcher( | 39 DeviceDescriptionFetcher( |
| 40 const GURL& device_description_url, | 40 const GURL& device_description_url, |
| 41 net::URLRequestContextGetter* request_context, | 41 net::URLRequestContextGetter* request_context, |
| 42 content::BrowserThread::ID thread_id, | 42 content::BrowserThread::ID thread_id, |
| 43 base::OnceCallback<void(const DialDeviceDescriptionData&)> success_cb, | 43 base::OnceCallback<void(const DialDeviceDescriptionData&)> success_cb, |
| 44 base::OnceCallback<void(const std::string&)> error_cb); | 44 base::OnceCallback<void(const std::string&)> error_cb); |
| 45 | 45 |
| 46 ~DeviceDescriptionFetcher() override; | 46 ~DeviceDescriptionFetcher() override; |
| 47 | 47 |
| 48 const GURL& device_description_url() { return device_description_url_; } |
| 49 |
| 48 void Start(); | 50 void Start(); |
| 49 | 51 |
| 50 private: | 52 private: |
| 51 // net::URLFetcherDelegate implementation. | 53 // net::URLFetcherDelegate implementation. |
| 52 void OnURLFetchComplete(const net::URLFetcher* source) override; | 54 void OnURLFetchComplete(const net::URLFetcher* source) override; |
| 53 void OnURLFetchDownloadProgress(const net::URLFetcher* source, | 55 void OnURLFetchDownloadProgress(const net::URLFetcher* source, |
| 54 int64_t current, | 56 int64_t current, |
| 55 int64_t total, | 57 int64_t total, |
| 56 int64_t current_network_bytes) override; | 58 int64_t current_network_bytes) override; |
| 57 void OnURLFetchUploadProgress(const net::URLFetcher* source, | 59 void OnURLFetchUploadProgress(const net::URLFetcher* source, |
| (...skipping 10 matching lines...) Expand all Loading... |
| 68 base::OnceCallback<void(const DialDeviceDescriptionData&)> success_cb_; | 70 base::OnceCallback<void(const DialDeviceDescriptionData&)> success_cb_; |
| 69 base::OnceCallback<void(const std::string&)> error_cb_; | 71 base::OnceCallback<void(const std::string&)> error_cb_; |
| 70 std::unique_ptr<net::URLFetcher> fetcher_; | 72 std::unique_ptr<net::URLFetcher> fetcher_; |
| 71 }; | 73 }; |
| 72 | 74 |
| 73 } // namespace dial | 75 } // namespace dial |
| 74 } // namespace api | 76 } // namespace api |
| 75 } // namespace extensions | 77 } // namespace extensions |
| 76 | 78 |
| 77 #endif // CHROME_BROWSER_EXTENSIONS_API_DIAL_DEVICE_DESCRIPTION_FETCHER_H_ | 79 #endif // CHROME_BROWSER_EXTENSIONS_API_DIAL_DEVICE_DESCRIPTION_FETCHER_H_ |
| OLD | NEW |