| Index: content/browser/download/save_file_resource_handler.h
|
| diff --git a/content/browser/download/save_file_resource_handler.h b/content/browser/download/save_file_resource_handler.h
|
| index e559e44a63e8a79e330ae94f269eb7e1e79a891e..2644dcc124fe32f5f76d83d3d253ea84194796e8 100644
|
| --- a/content/browser/download/save_file_resource_handler.h
|
| +++ b/content/browser/download/save_file_resource_handler.h
|
| @@ -25,13 +25,26 @@ class SaveFileManager;
|
| // Forwards data to the save thread.
|
| class SaveFileResourceHandler : public ResourceHandler {
|
| public:
|
| + // Unauthorized requests are cancelled from OnWillStart callback.
|
| + //
|
| + // This way of handling unauthorized requests allows unified handling of all
|
| + // SaveFile requests - communicating the failure to OnResponseCompleted
|
| + // happens in a generic, typical way, reusing common infrastructure code
|
| + // (rather than forcing an ad-hoc, Save-File-specific call to
|
| + // OnResponseCompleted from ResourceDispatcherHostImpl::BeginSaveFile).
|
| + enum class AuthorizationState {
|
| + AUTHORIZED,
|
| + NOT_AUTHORIZED,
|
| + };
|
| +
|
| SaveFileResourceHandler(net::URLRequest* request,
|
| SaveItemId save_item_id,
|
| SavePackageId save_package_id,
|
| int render_process_host_id,
|
| int render_frame_routing_id,
|
| const GURL& url,
|
| - SaveFileManager* manager);
|
| + SaveFileManager* manager,
|
| + AuthorizationState authorization_state);
|
| ~SaveFileResourceHandler() override;
|
|
|
| // ResourceHandler Implementation:
|
| @@ -88,6 +101,8 @@ class SaveFileResourceHandler : public ResourceHandler {
|
| int64_t content_length_;
|
| SaveFileManager* save_manager_;
|
|
|
| + AuthorizationState authorization_state_;
|
| +
|
| static const int kReadBufSize = 32768; // bytes
|
|
|
| DISALLOW_COPY_AND_ASSIGN(SaveFileResourceHandler);
|
|
|