Index: net/base/network_delegate.h |
diff --git a/net/base/network_delegate.h b/net/base/network_delegate.h |
index 284728b40d6c5ab6352643c221e48945d6b11455..1154d0e8ad867f33cdbd450e61b8da97f50bee60 100644 |
--- a/net/base/network_delegate.h |
+++ b/net/base/network_delegate.h |
@@ -34,7 +34,9 @@ class NetworkDelegate : public base::NonThreadSafe { |
// checking on parameters. |
bool NotifyBeforeURLRequest(URLRequest* request, |
CompletionCallback* callback); |
- void NotifySendHttpRequest(HttpRequestHeaders* headers); |
+ bool NotifyBeforeSendHeaders(uint64 request_id, |
rvargas (doing something else)
2011/03/24 18:16:03
Given that this is part of the network interface,
Matt Perry
2011/03/24 22:10:53
Done.
|
+ HttpRequestHeaders* headers, |
+ CompletionCallback* callback); |
void NotifyResponseStarted(URLRequest* request); |
void NotifyReadCompleted(URLRequest* request, int bytes_read); |
@@ -46,18 +48,26 @@ class NetworkDelegate : public base::NonThreadSafe { |
// URLRequestJobManager::CreateJob() as a general override mechanism. |
URLRequestJob* MaybeCreateURLRequestJob(URLRequest* request); |
+ void NotifyURLRequestDestroyed(URLRequest* request); |
+ |
private: |
// This is the interface for subclasses of NetworkDelegate to implement. This |
// member functions will be called by the respective public notification |
// member function, which will perform basic sanity checking. |
- // Called before a request is sent. |
+ // Called before a request is sent. The callback can be called at any time, |
+ // but will have no effect if the request has already been cancelled or |
+ // deleted. |
virtual bool OnBeforeURLRequest(URLRequest* request, |
CompletionCallback* callback) = 0; |
// Called right before the HTTP headers are sent. Allows the delegate to |
- // read/write |headers| before they get sent out. |
- virtual void OnSendHttpRequest(HttpRequestHeaders* headers) = 0; |
+ // read/write |headers| before they get sent out. The callback can be called |
+ // at any time, but will have no effect if the transaction handling this |
+ // request has been cancelled. |
+ virtual bool OnBeforeSendHeaders(uint64 request_id, |
+ HttpRequestHeaders* headers, |
+ CompletionCallback* callback) = 0; |
// This corresponds to URLRequestDelegate::OnResponseStarted. |
virtual void OnResponseStarted(URLRequest* request) = 0; |
@@ -68,6 +78,9 @@ class NetworkDelegate : public base::NonThreadSafe { |
// Called before a request is sent and before a URLRequestJob is created to |
// handle the request. |
virtual URLRequestJob* OnMaybeCreateURLRequestJob(URLRequest* request) = 0; |
+ |
+ // Called when an URLRequest is being destroyed. |
+ virtual void OnURLRequestDestroyed(URLRequest* request) = 0; |
}; |
} // namespace net |