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

Side by Side Diff: chrome/browser/download/base_file.h

Issue 3245005: GTTF: Clean up DownloadFileManager (Closed)
Patch Set: fixes Created 10 years, 3 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
« no previous file with comments | « no previous file | chrome/browser/download/base_file.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 CHROME_BROWSER_DOWNLOAD_BASE_FILE_H_ 5 #ifndef CHROME_BROWSER_DOWNLOAD_BASE_FILE_H_
6 #define CHROME_BROWSER_DOWNLOAD_BASE_FILE_H_ 6 #define CHROME_BROWSER_DOWNLOAD_BASE_FILE_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/linked_ptr.h" 10 #include "base/linked_ptr.h"
11 #include "chrome/browser/power_save_blocker.h" 11 #include "chrome/browser/power_save_blocker.h"
12 #include "googleurl/src/gurl.h" 12 #include "googleurl/src/gurl.h"
13 13
14 namespace net { 14 namespace net {
15 class FileStream; 15 class FileStream;
16 } 16 }
17 17
18 // File being downloaded and saved to disk. This is a base class 18 // File being downloaded and saved to disk. This is a base class
19 // for DownloadFile and SaveFile, which keep more state information. 19 // for DownloadFile and SaveFile, which keep more state information.
20 class BaseFile { 20 class BaseFile {
21 public: 21 public:
22 BaseFile(const FilePath& full_path, 22 BaseFile(const FilePath& full_path,
23 const GURL& source_url, 23 const GURL& source_url,
24 const GURL& referrer_url, 24 const GURL& referrer_url,
25 int64 received_bytes,
25 const linked_ptr<net::FileStream>& file_stream); 26 const linked_ptr<net::FileStream>& file_stream);
26 ~BaseFile(); 27 ~BaseFile();
27 28
28 bool Initialize(); 29 bool Initialize();
29 30
30 // Write a new chunk of data to the file. Returns true on success (all bytes 31 // Write a new chunk of data to the file. Returns true on success (all bytes
31 // written to the file). 32 // written to the file).
32 bool AppendDataToFile(const char* data, size_t data_len); 33 bool AppendDataToFile(const char* data, size_t data_len);
33 34
34 // Rename the download file. Returns true on success. 35 // Rename the download file. Returns true on success.
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 // Amount of data received up so far, in bytes. 74 // Amount of data received up so far, in bytes.
74 int64 bytes_so_far_; 75 int64 bytes_so_far_;
75 76
76 // RAII handle to keep the system from sleeping while we're downloading. 77 // RAII handle to keep the system from sleeping while we're downloading.
77 PowerSaveBlocker power_save_blocker_; 78 PowerSaveBlocker power_save_blocker_;
78 79
79 DISALLOW_COPY_AND_ASSIGN(BaseFile); 80 DISALLOW_COPY_AND_ASSIGN(BaseFile);
80 }; 81 };
81 82
82 #endif // CHROME_BROWSER_DOWNLOAD_BASE_FILE_H_ 83 #endif // CHROME_BROWSER_DOWNLOAD_BASE_FILE_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/download/base_file.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698