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

Unified Diff: chrome/browser/chromeos/arc/arc_support_host.h

Issue 2380683008: Fix resource leak on extension window closing. (Closed)
Patch Set: Created 4 years, 3 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/chromeos/arc/arc_support_host.h
diff --git a/chrome/browser/chromeos/arc/arc_support_host.h b/chrome/browser/chromeos/arc/arc_support_host.h
index 724971bd121dae144f97f8beda361830b607119e..972a6f8fc92c685792265d3a2d1e1cf0710389d5 100644
--- a/chrome/browser/chromeos/arc/arc_support_host.h
+++ b/chrome/browser/chromeos/arc/arc_support_host.h
@@ -25,6 +25,9 @@ class ArcSupportHost : public extensions::NativeMessageHost,
~ArcSupportHost() override;
+ // Requests to close the extension window.
+ void Close();
+
// Overrides NativeMessageHost:
void Start(Client* client) override;
void OnMessage(const std::string& request_string) override;
@@ -60,6 +63,15 @@ class ArcSupportHost : public extensions::NativeMessageHost,
// Unowned pointer.
Client* client_ = nullptr;
+ // Keep if Close() is requested from the browser.
+ // TODO(hidehiko): Remove this. This is temporarily introduced for checking
+ // if ArcAuthService::CancelAuthCode() needs to be invoked or not.
+ // ArcAuthService should know its own state and the transition so moving to
+ // there should simplify the structure. However, it is blocked by the current
+ // dependency. For the clean up, more refactoring is needed, which can be
+ // bigger changes.
+ bool close_requested_ = false;
+
// Used to track metrics preference.
PrefChangeRegistrar pref_local_change_registrar_;
// Used to track backup&restore and location service preference.

Powered by Google App Engine
This is Rietveld 408576698