From eba4b810a15cc813333aa24e21a451f649214079 Mon Sep 17 00:00:00 2001 From: "simonmorris@chromium.org" Date: Tue, 30 Oct 2012 23:31:40 +0000 Subject: [Chromoting] Make the AuthCodeGetter component of the Windows host configurer use ScopedComPtr correctly. BUG=158611 Review URL: https://chromiumcodereview.appspot.com/11343050 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@165061 0039d316-1c4b-4281-b951-d872f2087c98 --- remoting/host/setup/win/auth_code_getter.cc | 10 ++++------ remoting/host/setup/win/auth_code_getter.h | 2 -- 2 files changed, 4 insertions(+), 8 deletions(-) (limited to 'remoting/host/setup/win') diff --git a/remoting/host/setup/win/auth_code_getter.cc b/remoting/host/setup/win/auth_code_getter.cc index 89ce104..6b3944d 100644 --- a/remoting/host/setup/win/auth_code_getter.cc +++ b/remoting/host/setup/win/auth_code_getter.cc @@ -18,7 +18,6 @@ namespace remoting { AuthCodeGetter::AuthCodeGetter() : browser_(NULL), - browser_running_(false), timer_interval_(base::TimeDelta::FromMilliseconds(kUrlPollIntervalMs)) { } @@ -28,7 +27,7 @@ AuthCodeGetter::~AuthCodeGetter() { void AuthCodeGetter::GetAuthCode( base::Callback on_auth_code) { - if (browser_running_) { + if (browser_) { on_auth_code.Run(""); return; } @@ -39,7 +38,6 @@ void AuthCodeGetter::GetAuthCode( on_auth_code_.Run(""); return; } - browser_running_ = true; base::win::ScopedBstr url(UTF8ToWide( GetOauthStartUrl(GetDefaultOauthRedirectUrl())).c_str()); base::win::ScopedVariant empty_variant; @@ -69,7 +67,7 @@ void AuthCodeGetter::OnTimer() { bool AuthCodeGetter::TestBrowserUrl(std::string* auth_code) { *auth_code = ""; - if (!browser_running_) { + if (!browser_) { return true; } base::win::ScopedBstr url; @@ -88,9 +86,9 @@ bool AuthCodeGetter::TestBrowserUrl(std::string* auth_code) { } void AuthCodeGetter::KillBrowser() { - if (browser_running_) { + if (browser_) { browser_->Quit(); - browser_running_ = false; + browser_.Release(); } } diff --git a/remoting/host/setup/win/auth_code_getter.h b/remoting/host/setup/win/auth_code_getter.h index 2e09922..5cb9d81 100644 --- a/remoting/host/setup/win/auth_code_getter.h +++ b/remoting/host/setup/win/auth_code_getter.h @@ -43,8 +43,6 @@ class AuthCodeGetter : public base::NonThreadSafe { base::Callback on_auth_code_; // The browser through which the user requests an authorization code. base::win::ScopedComPtr browser_; - // Whether the browser is running. - bool browser_running_; // A timer used to poll the browser's URL. base::OneShotTimer timer_; // The interval at which the timer fires. -- cgit v1.1