Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1480)

Unified Diff: chrome/browser/extensions/api/dial/device_description_fetcher.cc

Issue 2702503003: [Dial] Refactor DialRegistry and DeviceDescriptionFetcher so they can be used by MediaSinkService (Closed)
Patch Set: resolve code review comments from Derek and Mark Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..8ee7deeed4d3ef90c930b602ea1d8ef4f06162c8 100644
--- a/chrome/browser/extensions/api/dial/device_description_fetcher.cc
+++ b/chrome/browser/extensions/api/dial/device_description_fetcher.cc
@@ -28,24 +28,25 @@ namespace dial {
DeviceDescriptionFetcher::DeviceDescriptionFetcher(
const GURL& device_description_url,
- Profile* profile,
+ net::URLRequestContextGetter* request_context,
+ BrowserThread::ID thread_id,
imcheng 2017/03/06 20:56:30 thread_id can be removed now.
zhaobin 2017/03/07 00:13:18 Done.
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(thread_checker_.CalledOnValidThread());
imcheng 2017/03/06 20:56:30 this DCHECK is not necessary since it's just been
zhaobin 2017/03/07 00:13:18 Done.
+ 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_);
fetcher_->Start();
}

Powered by Google App Engine
This is Rietveld 408576698