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

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

Issue 2674573011: [DIAL] Break circular dependency in DialFetchDeviceDescriptionFunction. (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/dial/dial_api.cc
diff --git a/chrome/browser/extensions/api/dial/dial_api.cc b/chrome/browser/extensions/api/dial/dial_api.cc
index 6099c0277d891a24400da675b77269a342d7dfe3..783992bf2befac1cd57264254d3728ba5dc9f878 100644
--- a/chrome/browser/extensions/api/dial/dial_api.cc
+++ b/chrome/browser/extensions/api/dial/dial_api.cc
@@ -240,6 +240,9 @@ void DialFetchDeviceDescriptionFunction::MaybeStartFetch(const GURL& url) {
void DialFetchDeviceDescriptionFunction::OnFetchComplete(
const api::dial::DialDeviceDescriptionData& result) {
+ // Destroy the DeviceDescriptionFetcher since it still contains a reference
+ // to |this| in its un-invoked callback.
+ device_description_fetcher_.reset();
api::dial::DialDeviceDescription device_description;
device_description.device_label = params_->device_label;
device_description.app_url = result.app_url.spec();
@@ -250,6 +253,9 @@ void DialFetchDeviceDescriptionFunction::OnFetchComplete(
void DialFetchDeviceDescriptionFunction::OnFetchError(
const std::string& message) {
+ // Destroy the DeviceDescriptionFetcher since it still contains a reference
+ // to |this| in its un-invoked callback.
+ device_description_fetcher_.reset();
SetError(message);
SendResponse(false);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698