| Index: chrome/browser/extensions/api/dial/device_description_fetcher.h
|
| diff --git a/chrome/browser/extensions/api/dial/device_description_fetcher.h b/chrome/browser/extensions/api/dial/device_description_fetcher.h
|
| index 309dc88a60007e340790bdd540412560125c73d2..8a4a8f56745ccfc678df52a224f929a38617a246 100644
|
| --- a/chrome/browser/extensions/api/dial/device_description_fetcher.h
|
| +++ b/chrome/browser/extensions/api/dial/device_description_fetcher.h
|
| @@ -9,13 +9,14 @@
|
| #include <string>
|
|
|
| #include "base/callback.h"
|
| +#include "base/threading/thread_checker.h"
|
| +#include "content/public/browser/browser_thread.h"
|
| #include "net/url_request/url_fetcher_delegate.h"
|
| #include "url/gurl.h"
|
|
|
| -class Profile;
|
| -
|
| namespace net {
|
| class URLFetcher;
|
| +class URLRequestContextGetter;
|
| }
|
|
|
| namespace extensions {
|
| @@ -27,17 +28,18 @@ struct DialDeviceDescriptionData;
|
| // Used to make a single HTTP GET request with |device_description_url| to fetch
|
| // a uPnP device description from a DIAL device. If successful, |success_cb| is
|
| // invoked with the result; otherwise, |error_cb| is invoked with an error
|
| -// reason. This class is not thread safe and must be used on the UI thread.
|
| +// reason.
|
| +// This class is not thread safe.
|
| class DeviceDescriptionFetcher : public net::URLFetcherDelegate {
|
| public:
|
| // Used to identify the net::URLFetcher instance for tests.
|
| static constexpr int kURLFetcherIDForTest = 1;
|
|
|
| - // |profile| is unowned; the caller must ensure that this object does not
|
| - // outlive it.
|
| + // |request_context| is unowned; the caller must ensure that this object does
|
| + // not outlive it.
|
| DeviceDescriptionFetcher(
|
| const GURL& device_description_url,
|
| - Profile* profile,
|
| + net::URLRequestContextGetter* request_context,
|
| base::OnceCallback<void(const DialDeviceDescriptionData&)> success_cb,
|
| base::OnceCallback<void(const std::string&)> error_cb);
|
|
|
| @@ -60,7 +62,9 @@ class DeviceDescriptionFetcher : public net::URLFetcherDelegate {
|
| void ReportError(const std::string& message);
|
|
|
| const GURL device_description_url_;
|
| - Profile* const profile_;
|
| + const scoped_refptr<net::URLRequestContextGetter> request_context_;
|
| + base::ThreadChecker thread_checker_;
|
| +
|
| base::OnceCallback<void(const DialDeviceDescriptionData&)> success_cb_;
|
| base::OnceCallback<void(const std::string&)> error_cb_;
|
| std::unique_ptr<net::URLFetcher> fetcher_;
|
|
|