Index: chrome/browser/webdata/web_data_request_manager.h |
diff --git a/chrome/browser/webdata/web_data_request_manager.h b/chrome/browser/webdata/web_data_request_manager.h |
index eab0c9bd1b7578cc6a215910d463fd1df0eff056..45387686c93d68463e7bb51fa865b1a15903bf32 100644 |
--- a/chrome/browser/webdata/web_data_request_manager.h |
+++ b/chrome/browser/webdata/web_data_request_manager.h |
@@ -42,6 +42,9 @@ class WebDataRequest { |
// Retrieves the |consumer_| set in the constructor. |
WebDataServiceConsumer* GetConsumer() const; |
+ // Retrieves the original message loop the of the request. |
+ MessageLoop* GetMessageLoop() const; |
+ |
// Returns |true| if the request was cancelled via the |Cancel()| method. |
bool IsCancelled() const; |
@@ -49,11 +52,6 @@ class WebDataRequest { |
// our consumer_ reference is invalid. |
void Cancel(); |
- // Invoked by the service when this request has been completed. |
- // This will notify the service in whatever thread was used to create this |
- // request. |
- void RequestComplete(); |
- |
// The result is owned by the request. |
void SetResult(scoped_ptr<WDTypedResult> r); |
const WDTypedResult* GetResult() const; |
@@ -62,6 +60,9 @@ class WebDataRequest { |
// Used to notify service of request completion. |
scoped_refptr<WebDataService> service_; |
+ // Used to notify manager if request is cancelled. |
+ WebDataRequestManager* manager_; |
+ |
// Tracks loop that the request originated on. |
MessageLoop* message_loop_; |
@@ -95,11 +96,19 @@ class WebDataRequestManager { |
~WebDataRequestManager(); |
- // Cancel any pending request. |
+ // Tries to cancel request, returns true if request was found and |
+ // cancelled successfully -- used for clean up of WebDataRequest references. |
+ bool MaybeCancelRequest(WebDataServiceBase::Handle h); |
+ |
+ // Cancel any pending request (expects pending_requests_ map to contain |h|). |
erikwright (departed)
2013/01/16 19:00:23
replace 'expects' with something more explicit. Do
|
void CancelRequest(WebDataServiceBase::Handle h); |
- // Invoked by request implementations when a request has been processed. |
- void RequestCompleted(WebDataServiceBase::Handle h); |
+ // Invoked by the WebDataService when |request| has been completed. |
+ void RequestCompleted(scoped_ptr<WebDataRequest> request); |
+ |
+ // This will notify the consumer in whatever thread was used to create this |
+ // request. |
+ void RequestCompletedOnThread(scoped_ptr<WebDataRequest> request); |
erikwright (departed)
2013/01/16 19:00:23
This can be private, right?
|
// Register the request as a pending request. |
void RegisterRequest(WebDataRequest* request); |