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

Unified Diff: content/browser/cancelable_request.h

Issue 6994005: Fix password automation hooks to get pyauto test testSavePassword working. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Disabling a single pyauto passwords test. Created 9 years, 7 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: content/browser/cancelable_request.h
diff --git a/content/browser/cancelable_request.h b/content/browser/cancelable_request.h
index 009ca98bf84e591ccabd65391f985eb0184860c2..3c68005286f4bd7af0f1ff8c8d5e2afcc1b8f221 100644
--- a/content/browser/cancelable_request.h
+++ b/content/browser/cancelable_request.h
@@ -139,6 +139,10 @@ class CancelableRequestProvider {
// which will also set some state on the request).
void RequestCompleted(Handle handle);
+ // Identifies whether or not the specified request has already been completed
+ // or canceled, according to whether it exists in |completed_requests_|.
+ bool IsRequestCompleted(Handle handle);
+
private:
typedef std::map<Handle, scoped_refptr<CancelableRequestBase> >
CancelableRequestMap;
@@ -153,6 +157,9 @@ class CancelableRequestProvider {
// Lists all outstanding requests. Protected by the |lock_|.
CancelableRequestMap pending_requests_;
+ // Lists all completed or canceled requests. Protected by the |lock_|.
+ CancelableRequestMap completed_requests_;
+
// The next handle value we will return. Protected by the |lock_|.
int next_handle_;
@@ -541,8 +548,10 @@ class CancelableRequestBase
// Tells the provider that the request is complete, which then tells the
// consumer.
void NotifyCompleted() const {
- provider_->RequestCompleted(handle());
- consumer_->DidExecute(provider_, handle_);
+ if (!provider_->IsRequestCompleted(handle())) {
+ provider_->RequestCompleted(handle());
+ consumer_->DidExecute(provider_, handle_);
+ }
}
// Cover method for CancelableRequestConsumerBase::WillExecute.

Powered by Google App Engine
This is Rietveld 408576698