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

Side by Side Diff: content/browser/download/save_file_resource_handler.h

Issue 2668603003: Make ResourceHandler::OnWillRead able to complete asynchronously. (Closed)
Patch Set: Response to comments Created 3 years, 9 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 unified diff | Download patch
OLDNEW
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 <stdint.h> 8 #include <stdint.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 void OnResponseStarted( 60 void OnResponseStarted(
61 ResourceResponse* response, 61 ResourceResponse* response,
62 std::unique_ptr<ResourceController> controller) override; 62 std::unique_ptr<ResourceController> controller) override;
63 63
64 // Pass-through implementation. 64 // Pass-through implementation.
65 void OnWillStart(const GURL& url, 65 void OnWillStart(const GURL& url,
66 std::unique_ptr<ResourceController> controller) override; 66 std::unique_ptr<ResourceController> controller) override;
67 67
68 // Creates a new buffer, which will be handed to the download thread for file 68 // Creates a new buffer, which will be handed to the download thread for file
69 // writing and deletion. 69 // writing and deletion.
70 bool OnWillRead(scoped_refptr<net::IOBuffer>* buf, 70 void OnWillRead(scoped_refptr<net::IOBuffer>* buf,
71 int* buf_size) override; 71 int* buf_size,
72 std::unique_ptr<ResourceController> controller) override;
72 73
73 // Passes the buffer to the download file writer. 74 // Passes the buffer to the download file writer.
74 void OnReadCompleted(int bytes_read, 75 void OnReadCompleted(int bytes_read,
75 std::unique_ptr<ResourceController> controller) override; 76 std::unique_ptr<ResourceController> controller) override;
76 77
77 void OnResponseCompleted( 78 void OnResponseCompleted(
78 const net::URLRequestStatus& status, 79 const net::URLRequestStatus& status,
79 std::unique_ptr<ResourceController> controller) override; 80 std::unique_ptr<ResourceController> controller) override;
80 81
81 // N/A to this flavor of SaveFileResourceHandler. 82 // N/A to this flavor of SaveFileResourceHandler.
(...skipping 23 matching lines...) Expand all
105 AuthorizationState authorization_state_; 106 AuthorizationState authorization_state_;
106 107
107 static const int kReadBufSize = 32768; // bytes 108 static const int kReadBufSize = 32768; // bytes
108 109
109 DISALLOW_COPY_AND_ASSIGN(SaveFileResourceHandler); 110 DISALLOW_COPY_AND_ASSIGN(SaveFileResourceHandler);
110 }; 111 };
111 112
112 } // namespace content 113 } // namespace content
113 114
114 #endif // CONTENT_BROWSER_DOWNLOAD_SAVE_FILE_RESOURCE_HANDLER_H_ 115 #endif // CONTENT_BROWSER_DOWNLOAD_SAVE_FILE_RESOURCE_HANDLER_H_
OLDNEW
« no previous file with comments | « content/browser/download/download_resource_handler.cc ('k') | content/browser/download/save_file_resource_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698