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

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

Issue 2380683008: Fix resource leak on extension window closing. (Closed)
Patch Set: Address comments. 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
« no previous file with comments | « chrome/browser/chromeos/arc/arc_auth_service.cc ('k') | chrome/browser/chromeos/arc/arc_support_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..acd6bdaaf1d70cfe5b110704fa5bb27dddcc6e93 100644
--- a/chrome/browser/chromeos/arc/arc_support_host.h
+++ b/chrome/browser/chromeos/arc/arc_support_host.h
@@ -25,12 +25,16 @@ 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;
scoped_refptr<base::SingleThreadTaskRunner> task_runner() const override;
// Overrides arc::ArcAuthService::Observer:
+ // TODO(hidehiko): Get rid of Observer interface.
void OnOptInUIClose() override;
void OnOptInUIShowPage(arc::ArcAuthService::UIPage page,
const base::string16& status) override;
@@ -60,6 +64,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.
« no previous file with comments | « chrome/browser/chromeos/arc/arc_auth_service.cc ('k') | chrome/browser/chromeos/arc/arc_support_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698