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

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

Issue 129173002: Adds the new URLRequest::OnBeforeNetworkStart hook to the (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@defer_1_net
Patch Set: Created 6 years, 11 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 <string> 8 #include <string>
9 9
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 27 matching lines...) Expand all
38 // Sends the download creation information to the download thread. 38 // Sends the download creation information to the download thread.
39 virtual bool OnResponseStarted(int request_id, 39 virtual bool OnResponseStarted(int request_id,
40 ResourceResponse* response, 40 ResourceResponse* response,
41 bool* defer) OVERRIDE; 41 bool* defer) OVERRIDE;
42 42
43 // Pass-through implementation. 43 // Pass-through implementation.
44 virtual bool OnWillStart(int request_id, 44 virtual bool OnWillStart(int request_id,
45 const GURL& url, 45 const GURL& url,
46 bool* defer) OVERRIDE; 46 bool* defer) OVERRIDE;
47 47
48 // Pass-through implementation.
49 virtual bool OnBeforeNetworkStart(int request_id,
50 const GURL& url,
51 bool* defer) OVERRIDE;
52
48 // Creates a new buffer, which will be handed to the download thread for file 53 // Creates a new buffer, which will be handed to the download thread for file
49 // writing and deletion. 54 // writing and deletion.
50 virtual bool OnWillRead(int request_id, 55 virtual bool OnWillRead(int request_id,
51 scoped_refptr<net::IOBuffer>* buf, 56 scoped_refptr<net::IOBuffer>* buf,
52 int* buf_size, 57 int* buf_size,
53 int min_size) OVERRIDE; 58 int min_size) OVERRIDE;
54 59
55 // Passes the buffer to the download file writer. 60 // Passes the buffer to the download file writer.
56 virtual bool OnReadCompleted(int request_id, int bytes_read, 61 virtual bool OnReadCompleted(int request_id, int bytes_read,
57 bool* defer) OVERRIDE; 62 bool* defer) OVERRIDE;
(...skipping 27 matching lines...) Expand all
85 SaveFileManager* save_manager_; 90 SaveFileManager* save_manager_;
86 91
87 static const int kReadBufSize = 32768; // bytes 92 static const int kReadBufSize = 32768; // bytes
88 93
89 DISALLOW_COPY_AND_ASSIGN(SaveFileResourceHandler); 94 DISALLOW_COPY_AND_ASSIGN(SaveFileResourceHandler);
90 }; 95 };
91 96
92 } // namespace content 97 } // namespace content
93 98
94 #endif // CONTENT_BROWSER_DOWNLOAD_SAVE_FILE_RESOURCE_HANDLER_H_ 99 #endif // CONTENT_BROWSER_DOWNLOAD_SAVE_FILE_RESOURCE_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698