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

Side by Side Diff: chrome/browser/resource_dispatcher_host.cc

Issue 6043: Added dangerous download prompting. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 2 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 // See http://wiki.corp.google.com/twiki/bin/view/Main/ChromeMultiProcessResourc eLoading 5 // See http://wiki.corp.google.com/twiki/bin/view/Main/ChromeMultiProcessResourc eLoading
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "chrome/browser/resource_dispatcher_host.h" 9 #include "chrome/browser/resource_dispatcher_host.h"
10 10
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 info->received_bytes = 0; 295 info->received_bytes = 0;
296 info->total_bytes = content_length_; 296 info->total_bytes = content_length_;
297 info->state = DownloadItem::IN_PROGRESS; 297 info->state = DownloadItem::IN_PROGRESS;
298 info->download_id = download_id_; 298 info->download_id = download_id_;
299 info->render_process_id = global_id_.render_process_host_id; 299 info->render_process_id = global_id_.render_process_host_id;
300 info->render_view_id = render_view_id_; 300 info->render_view_id = render_view_id_;
301 info->request_id = global_id_.request_id; 301 info->request_id = global_id_.request_id;
302 info->content_disposition = content_disposition_; 302 info->content_disposition = content_disposition_;
303 info->mime_type = response->response_head.mime_type; 303 info->mime_type = response->response_head.mime_type;
304 info->save_as = save_as_; 304 info->save_as = save_as_;
305 info->is_dangerous = false;
305 download_manager_->file_loop()->PostTask(FROM_HERE, 306 download_manager_->file_loop()->PostTask(FROM_HERE,
306 NewRunnableMethod(download_manager_, 307 NewRunnableMethod(download_manager_,
307 &DownloadFileManager::StartDownload, 308 &DownloadFileManager::StartDownload,
308 info)); 309 info));
309 return true; 310 return true;
310 } 311 }
311 312
312 // Create a new buffer, which will be handed to the download thread for file 313 // Create a new buffer, which will be handed to the download thread for file
313 // writing and deletion. 314 // writing and deletion.
314 bool OnWillRead(int request_id, char** buf, int* buf_size, int min_size) { 315 bool OnWillRead(int request_id, char** buf, int* buf_size, int min_size) {
(...skipping 1986 matching lines...) Expand 10 before | Expand all | Expand 10 after
2301 bool too_much_time_passed = time_since_last > kOneSecond; 2302 bool too_much_time_passed = time_since_last > kOneSecond;
2302 2303
2303 if (is_finished || enough_new_progress || too_much_time_passed) { 2304 if (is_finished || enough_new_progress || too_much_time_passed) {
2304 info->event_handler->OnUploadProgress(info->request_id, position, size); 2305 info->event_handler->OnUploadProgress(info->request_id, position, size);
2305 info->waiting_for_upload_progress_ack = true; 2306 info->waiting_for_upload_progress_ack = true;
2306 info->last_upload_ticks = TimeTicks::Now(); 2307 info->last_upload_ticks = TimeTicks::Now();
2307 info->last_upload_position = position; 2308 info->last_upload_position = position;
2308 } 2309 }
2309 } 2310 }
2310 2311
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698