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

Unified Diff: content/browser/cancelable_request.h

Issue 6646051: Fix DCHECK, memory leak, and refactor PasswordStore to use CancelableRequest (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Include password_store_consumer.h in mac/win unittests. Created 9 years, 9 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 9dc86d32da4119b7641472285205b992243b2adf..a27747f394b971df5cc876c401ea68826d47379a 100644
--- a/content/browser/cancelable_request.h
+++ b/content/browser/cancelable_request.h
@@ -127,7 +127,16 @@ class CancelableRequestProvider {
// handle must be for a valid pending (not yet complete or cancelled) request.
void CancelRequest(Handle handle);
+ // Provide factory method so Handle can be treated as opaque.
+ static Handle InvalidHandle();
+
+ // Provide validity method so Handle can be treated as opaque.
+ static bool HandleIsValid(Handle handle);
brettw 2011/03/22 21:43:41 Why not just have calling code compare to InvalidH
Sheridan Rawlins 2011/03/22 22:04:09 One could imagine Handles which are not equal to t
brettw 2011/03/22 22:11:08 I'm not sure what you're saying here.
Sheridan Rawlins 2011/03/23 00:39:52 I'm saying maybe there are multiple Invalid Handle
brettw 2011/03/23 01:49:00 Having complicated "multiple invalid handles" seem
Sheridan Rawlins 2011/03/23 03:16:50 I think you're describing Speculative Generality (
+
protected:
+ static const Handle kFirstHandle;
+ static const Handle kInvalidHandle;
+
// Adds a new request and initializes it. This is called by a derived class
// to add a new request. The request's Init() will be called (which is why
// the consumer is required. The handle to the new request is returned.

Powered by Google App Engine
This is Rietveld 408576698