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

Unified Diff: chrome/service/gaia/service_gaia_authenticator.cc

Issue 10065040: RefCounted types should not have public destructors, chrome/ remaining parts (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Implementation fixes Created 8 years, 8 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/service/gaia/service_gaia_authenticator.cc
diff --git a/chrome/service/gaia/service_gaia_authenticator.cc b/chrome/service/gaia/service_gaia_authenticator.cc
index a77f224f46c247176ba6fbf1e709a3dd66b38185..ee9a6a0a2104ac4bf0815ac78bceed32aaa3d053 100644
--- a/chrome/service/gaia/service_gaia_authenticator.cc
+++ b/chrome/service/gaia/service_gaia_authenticator.cc
@@ -21,7 +21,19 @@ ServiceGaiaAuthenticator::ServiceGaiaAuthenticator(
http_response_code_(0) {
}
-ServiceGaiaAuthenticator::~ServiceGaiaAuthenticator() {
+// content::URLFetcherDelegate implementation
+void ServiceGaiaAuthenticator::OnURLFetchComplete(
+ const content::URLFetcher* source) {
+ DCHECK(io_message_loop_proxy_->BelongsToCurrentThread());
+ http_response_code_ = source->GetResponseCode();
+ source->GetResponseAsString(&response_data_);
+ delete source;
+ // Add an extra reference because we want http_post_completed_ to remain
+ // valid until after Signal() returns.
+ scoped_refptr<ServiceGaiaAuthenticator> keep_alive(this);
+ // Wake the blocked thread in Post.
+ http_post_completed_.Signal();
+ // WARNING: DONT DO ANYTHING AFTER THIS CALL! |this| may be deleted!
}
bool ServiceGaiaAuthenticator::Post(const GURL& url,
@@ -61,6 +73,8 @@ int ServiceGaiaAuthenticator::GetBackoffDelaySeconds(
return ret;
}
+ServiceGaiaAuthenticator::~ServiceGaiaAuthenticator() {}
+
void ServiceGaiaAuthenticator::DoPost(const GURL& post_url,
const std::string& post_body) {
DCHECK(io_message_loop_proxy_->BelongsToCurrentThread());
@@ -71,18 +85,3 @@ void ServiceGaiaAuthenticator::DoPost(const GURL& post_url,
request->SetUploadData("application/x-www-form-urlencoded", post_body);
request->Start();
}
-
-// content::URLFetcherDelegate implementation
-void ServiceGaiaAuthenticator::OnURLFetchComplete(
- const content::URLFetcher* source) {
- DCHECK(io_message_loop_proxy_->BelongsToCurrentThread());
- http_response_code_ = source->GetResponseCode();
- source->GetResponseAsString(&response_data_);
- delete source;
- // Add an extra reference because we want http_post_completed_ to remain
- // valid until after Signal() returns.
- scoped_refptr<ServiceGaiaAuthenticator> keep_alive(this);
- // Wake the blocked thread in Post.
- http_post_completed_.Signal();
- // WARNING: DONT DO ANYTHING AFTER THIS CALL! |this| may be deleted!
-}

Powered by Google App Engine
This is Rietveld 408576698