| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_DOWNLOAD_SAVE_FILE_RESOURCE_HANDLER_H_ | 5 #ifndef CONTENT_BROWSER_DOWNLOAD_SAVE_FILE_RESOURCE_HANDLER_H_ |
| 6 #define CONTENT_BROWSER_DOWNLOAD_SAVE_FILE_RESOURCE_HANDLER_H_ | 6 #define CONTENT_BROWSER_DOWNLOAD_SAVE_FILE_RESOURCE_HANDLER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 class SaveFileResourceHandler : public ResourceHandler { | 22 class SaveFileResourceHandler : public ResourceHandler { |
| 23 public: | 23 public: |
| 24 SaveFileResourceHandler(net::URLRequest* request, | 24 SaveFileResourceHandler(net::URLRequest* request, |
| 25 int render_process_host_id, | 25 int render_process_host_id, |
| 26 int render_frame_id, | 26 int render_frame_id, |
| 27 const GURL& url, | 27 const GURL& url, |
| 28 SaveFileManager* manager); | 28 SaveFileManager* manager); |
| 29 ~SaveFileResourceHandler() override; | 29 ~SaveFileResourceHandler() override; |
| 30 | 30 |
| 31 // ResourceHandler Implementation: | 31 // ResourceHandler Implementation: |
| 32 bool OnUploadProgress(uint64 position, uint64 size) override; | |
| 33 | 32 |
| 34 // Saves the redirected URL to final_url_, we need to use the original | 33 // Saves the redirected URL to final_url_, we need to use the original |
| 35 // URL to match original request. | 34 // URL to match original request. |
| 36 bool OnRequestRedirected(const net::RedirectInfo& redirect_info, | 35 bool OnRequestRedirected(const net::RedirectInfo& redirect_info, |
| 37 ResourceResponse* response, | 36 ResourceResponse* response, |
| 38 bool* defer) override; | 37 bool* defer) override; |
| 39 | 38 |
| 40 // Sends the download creation information to the download thread. | 39 // Sends the download creation information to the download thread. |
| 41 bool OnResponseStarted(ResourceResponse* response, bool* defer) override; | 40 bool OnResponseStarted(ResourceResponse* response, bool* defer) override; |
| 42 | 41 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 SaveFileManager* save_manager_; | 82 SaveFileManager* save_manager_; |
| 84 | 83 |
| 85 static const int kReadBufSize = 32768; // bytes | 84 static const int kReadBufSize = 32768; // bytes |
| 86 | 85 |
| 87 DISALLOW_COPY_AND_ASSIGN(SaveFileResourceHandler); | 86 DISALLOW_COPY_AND_ASSIGN(SaveFileResourceHandler); |
| 88 }; | 87 }; |
| 89 | 88 |
| 90 } // namespace content | 89 } // namespace content |
| 91 | 90 |
| 92 #endif // CONTENT_BROWSER_DOWNLOAD_SAVE_FILE_RESOURCE_HANDLER_H_ | 91 #endif // CONTENT_BROWSER_DOWNLOAD_SAVE_FILE_RESOURCE_HANDLER_H_ |
| OLD | NEW |