| Index: chrome/browser/extensions/api/dial/device_description_fetcher.cc
|
| diff --git a/chrome/browser/extensions/api/dial/device_description_fetcher.cc b/chrome/browser/extensions/api/dial/device_description_fetcher.cc
|
| index 654fc3355c770bd83057e9b61b2abf9cfa3d9fe4..7be4b199367e06b3110989a1a54d1c6b8467991a 100644
|
| --- a/chrome/browser/extensions/api/dial/device_description_fetcher.cc
|
| +++ b/chrome/browser/extensions/api/dial/device_description_fetcher.cc
|
| @@ -2,9 +2,10 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| +#include "chrome/browser/extensions/api/dial/device_description_fetcher.h"
|
| +
|
| #include "base/strings/string_util.h"
|
| #include "base/strings/stringprintf.h"
|
| -#include "chrome/browser/extensions/api/dial/device_description_fetcher.h"
|
| #include "chrome/browser/extensions/api/dial/dial_device_data.h"
|
| #include "chrome/browser/profiles/profile.h"
|
| #include "content/public/browser/browser_thread.h"
|
| @@ -13,6 +14,7 @@
|
| #include "net/http/http_status_code.h"
|
| #include "net/http/http_util.h"
|
| #include "net/url_request/url_fetcher.h"
|
| +#include "net/url_request/url_request_context_getter.h"
|
|
|
| using content::BrowserThread;
|
|
|
| @@ -28,24 +30,23 @@ namespace dial {
|
|
|
| DeviceDescriptionFetcher::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)
|
| : device_description_url_(device_description_url),
|
| - profile_(profile),
|
| + request_context_(request_context),
|
| success_cb_(std::move(success_cb)),
|
| error_cb_(std::move(error_cb)) {
|
| - DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
| - DCHECK(profile_);
|
| + DCHECK(request_context_);
|
| DCHECK(device_description_url_.is_valid());
|
| }
|
|
|
| DeviceDescriptionFetcher::~DeviceDescriptionFetcher() {
|
| - DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
| + DCHECK(thread_checker_.CalledOnValidThread());
|
| }
|
|
|
| void DeviceDescriptionFetcher::Start() {
|
| - DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
| + DCHECK(thread_checker_.CalledOnValidThread());
|
| DCHECK(!fetcher_);
|
|
|
| // DIAL returns device descriptions via GET request.
|
| @@ -70,7 +71,7 @@ void DeviceDescriptionFetcher::Start() {
|
| fetcher_->SetMaxRetriesOn5xx(kMaxRetries);
|
| fetcher_->SetAutomaticallyRetryOnNetworkChanges(kMaxRetries);
|
|
|
| - fetcher_->SetRequestContext(profile_->GetRequestContext());
|
| + fetcher_->SetRequestContext(request_context_.get());
|
| fetcher_->Start();
|
| }
|
|
|
|
|