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

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

Issue 2164113002: Remove ResourceHandler::OnBeforeNetworkStart (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Oops Created 4 years, 5 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 #include "content/browser/download/save_file_resource_handler.h" 5 #include "content/browser/download/save_file_resource_handler.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 BrowserThread::PostTask( 53 BrowserThread::PostTask(
54 BrowserThread::FILE, FROM_HERE, 54 BrowserThread::FILE, FROM_HERE,
55 base::Bind(&SaveFileManager::StartSave, save_manager_, info)); 55 base::Bind(&SaveFileManager::StartSave, save_manager_, info));
56 return true; 56 return true;
57 } 57 }
58 58
59 bool SaveFileResourceHandler::OnWillStart(const GURL& url, bool* defer) { 59 bool SaveFileResourceHandler::OnWillStart(const GURL& url, bool* defer) {
60 return true; 60 return true;
61 } 61 }
62 62
63 bool SaveFileResourceHandler::OnBeforeNetworkStart(const GURL& url,
64 bool* defer) {
65 return true;
66 }
67
68 bool SaveFileResourceHandler::OnWillRead(scoped_refptr<net::IOBuffer>* buf, 63 bool SaveFileResourceHandler::OnWillRead(scoped_refptr<net::IOBuffer>* buf,
69 int* buf_size, 64 int* buf_size,
70 int min_size) { 65 int min_size) {
71 DCHECK(buf && buf_size); 66 DCHECK(buf && buf_size);
72 if (!read_buffer_.get()) { 67 if (!read_buffer_.get()) {
73 *buf_size = min_size < 0 ? kReadBufSize : min_size; 68 *buf_size = min_size < 0 ? kReadBufSize : min_size;
74 read_buffer_ = new net::IOBuffer(*buf_size); 69 read_buffer_ = new net::IOBuffer(*buf_size);
75 } 70 }
76 *buf = read_buffer_.get(); 71 *buf = read_buffer_.get();
77 return true; 72 return true;
(...skipping 26 matching lines...) Expand all
104 void SaveFileResourceHandler::OnDataDownloaded(int bytes_downloaded) { 99 void SaveFileResourceHandler::OnDataDownloaded(int bytes_downloaded) {
105 NOTREACHED(); 100 NOTREACHED();
106 } 101 }
107 102
108 void SaveFileResourceHandler::set_content_length( 103 void SaveFileResourceHandler::set_content_length(
109 const std::string& content_length) { 104 const std::string& content_length) {
110 base::StringToInt64(content_length, &content_length_); 105 base::StringToInt64(content_length, &content_length_);
111 } 106 }
112 107
113 } // namespace content 108 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/download/save_file_resource_handler.h ('k') | content/browser/loader/async_resource_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698