Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5357)

Unified Diff: chrome/browser/renderer_host/redirect_to_file_resource_handler.h

Issue 6532073: Move core pieces of browser\renderer_host to src\content. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/renderer_host/redirect_to_file_resource_handler.h
===================================================================
--- chrome/browser/renderer_host/redirect_to_file_resource_handler.h (revision 75488)
+++ chrome/browser/renderer_host/redirect_to_file_resource_handler.h (working copy)
@@ -5,85 +5,7 @@
#ifndef CHROME_BROWSER_RENDERER_HOST_REDIRECT_TO_FILE_RESOURCE_HANDLER_H_
#define CHROME_BROWSER_RENDERER_HOST_REDIRECT_TO_FILE_RESOURCE_HANDLER_H_
-#include "base/file_path.h"
-#include "base/platform_file.h"
-#include "base/ref_counted.h"
-#include "base/scoped_callback_factory.h"
-#include "base/scoped_ptr.h"
-#include "chrome/browser/renderer_host/resource_handler.h"
-#include "net/base/completion_callback.h"
+// TODO(jam): remove this file when all files have been converted.
+#include "content/browser/renderer_host/redirect_to_file_resource_handler.h"
-class RefCountedPlatformFile;
-class ResourceDispatcherHost;
-
-namespace net {
-class FileStream;
-class GrowableIOBuffer;
-}
-
-namespace webkit_blob {
-class DeletableFileReference;
-}
-
-// Redirects network data to a file. This is intended to be layered in front
-// of either the AsyncResourceHandler or the SyncResourceHandler.
-class RedirectToFileResourceHandler : public ResourceHandler {
- public:
- RedirectToFileResourceHandler(
- ResourceHandler* next_handler,
- int process_id,
- ResourceDispatcherHost* resource_dispatcher_host);
-
- // ResourceHandler implementation:
- virtual bool OnUploadProgress(int request_id, uint64 position, uint64 size);
- virtual bool OnRequestRedirected(int request_id, const GURL& new_url,
- ResourceResponse* response, bool* defer);
- virtual bool OnResponseStarted(int request_id, ResourceResponse* response);
- virtual bool OnWillStart(int request_id, const GURL& url, bool* defer);
- virtual bool OnWillRead(int request_id, net::IOBuffer** buf, int* buf_size,
- int min_size);
- virtual bool OnReadCompleted(int request_id, int* bytes_read);
- virtual bool OnResponseCompleted(int request_id,
- const net::URLRequestStatus& status,
- const std::string& security_info);
- virtual void OnRequestClosed();
-
- private:
- virtual ~RedirectToFileResourceHandler();
- void DidCreateTemporaryFile(base::PlatformFileError error_code,
- base::PassPlatformFile file_handle,
- FilePath file_path);
- void DidWriteToFile(int result);
- bool WriteMore();
- bool BufIsFull() const;
-
- base::ScopedCallbackFactory<RedirectToFileResourceHandler> callback_factory_;
-
- ResourceDispatcherHost* host_;
- scoped_refptr<ResourceHandler> next_handler_;
- int process_id_;
- int request_id_;
-
- // We allocate a single, fixed-size IO buffer (buf_) used to read from the
- // network (buf_write_pending_ is true while the system is copying data into
- // buf_), and then write this buffer out to disk (write_callback_pending_ is
- // true while writing to disk). Reading from the network is suspended while
- // the buffer is full (BufIsFull returns true). The write_cursor_ member
- // tracks the offset into buf_ that we are writing to disk.
-
- scoped_refptr<net::GrowableIOBuffer> buf_;
- bool buf_write_pending_;
- int write_cursor_;
-
- scoped_ptr<net::FileStream> file_stream_;
- net::CompletionCallbackImpl<RedirectToFileResourceHandler> write_callback_;
- bool write_callback_pending_;
-
- // We create a DeletableFileReference for the temp file created as
- // a result of the download.
- scoped_refptr<webkit_blob::DeletableFileReference> deletable_file_;
-
- DISALLOW_COPY_AND_ASSIGN(RedirectToFileResourceHandler);
-};
-
#endif // CHROME_BROWSER_RENDERER_HOST_REDIRECT_TO_FILE_RESOURCE_HANDLER_H_

Powered by Google App Engine
This is Rietveld 408576698