| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_SAVE_FILE_RESOURCE_HANDLER_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_SAVE_FILE_RESOURCE_HANDLER_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_SAVE_FILE_RESOURCE_HANDLER_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_SAVE_FILE_RESOURCE_HANDLER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 | 23 |
| 24 // ResourceHandler Implementation: | 24 // ResourceHandler Implementation: |
| 25 virtual bool OnUploadProgress(int request_id, | 25 virtual bool OnUploadProgress(int request_id, |
| 26 uint64 position, | 26 uint64 position, |
| 27 uint64 size) OVERRIDE; | 27 uint64 size) OVERRIDE; |
| 28 | 28 |
| 29 // Saves the redirected URL to final_url_, we need to use the original | 29 // Saves the redirected URL to final_url_, we need to use the original |
| 30 // URL to match original request. | 30 // URL to match original request. |
| 31 virtual bool OnRequestRedirected(int request_id, | 31 virtual bool OnRequestRedirected(int request_id, |
| 32 const GURL& url, | 32 const GURL& url, |
| 33 ResourceResponse* response, | 33 content::ResourceResponse* response, |
| 34 bool* defer) OVERRIDE; | 34 bool* defer) OVERRIDE; |
| 35 | 35 |
| 36 // Sends the download creation information to the download thread. | 36 // Sends the download creation information to the download thread. |
| 37 virtual bool OnResponseStarted(int request_id, | 37 virtual bool OnResponseStarted(int request_id, |
| 38 ResourceResponse* response) OVERRIDE; | 38 content::ResourceResponse* response) OVERRIDE; |
| 39 | 39 |
| 40 // Pass-through implementation. | 40 // Pass-through implementation. |
| 41 virtual bool OnWillStart(int request_id, | 41 virtual bool OnWillStart(int request_id, |
| 42 const GURL& url, | 42 const GURL& url, |
| 43 bool* defer) OVERRIDE; | 43 bool* defer) OVERRIDE; |
| 44 | 44 |
| 45 // Creates a new buffer, which will be handed to the download thread for file | 45 // Creates a new buffer, which will be handed to the download thread for file |
| 46 // writing and deletion. | 46 // writing and deletion. |
| 47 virtual bool OnWillRead(int request_id, | 47 virtual bool OnWillRead(int request_id, |
| 48 net::IOBuffer** buf, | 48 net::IOBuffer** buf, |
| (...skipping 30 matching lines...) Expand all Loading... |
| 79 GURL final_url_; | 79 GURL final_url_; |
| 80 int64 content_length_; | 80 int64 content_length_; |
| 81 SaveFileManager* save_manager_; | 81 SaveFileManager* save_manager_; |
| 82 | 82 |
| 83 static const int kReadBufSize = 32768; // bytes | 83 static const int kReadBufSize = 32768; // bytes |
| 84 | 84 |
| 85 DISALLOW_COPY_AND_ASSIGN(SaveFileResourceHandler); | 85 DISALLOW_COPY_AND_ASSIGN(SaveFileResourceHandler); |
| 86 }; | 86 }; |
| 87 | 87 |
| 88 #endif // CONTENT_BROWSER_RENDERER_HOST_SAVE_FILE_RESOURCE_HANDLER_H_ | 88 #endif // CONTENT_BROWSER_RENDERER_HOST_SAVE_FILE_RESOURCE_HANDLER_H_ |
| OLD | NEW |