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

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

Issue 6276002: Abstracts SHA256 context for NSS / OpenSSL. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Moves to SecureHash (and other comments) Created 9 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 | Annotate | Revision Log
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 <string> 9 #include <string>
10 10
11 #include "base/file_path.h" 11 #include "base/file_path.h"
12 #include "base/linked_ptr.h" 12 #include "base/linked_ptr.h"
13 #include "base/scoped_ptr.h" 13 #include "base/scoped_ptr.h"
14 #include "base/third_party/nss/blapi.h"
15 #include "chrome/browser/power_save_blocker.h" 14 #include "chrome/browser/power_save_blocker.h"
16 #include "googleurl/src/gurl.h" 15 #include "googleurl/src/gurl.h"
17 16
17 namespace base {
18 class SecureHash;
19 }
18 namespace net { 20 namespace net {
19 class FileStream; 21 class FileStream;
20 } 22 }
21 23
22 // File being downloaded and saved to disk. This is a base class 24 // File being downloaded and saved to disk. This is a base class
23 // for DownloadFile and SaveFile, which keep more state information. 25 // for DownloadFile and SaveFile, which keep more state information.
24 class BaseFile { 26 class BaseFile {
25 public: 27 public:
26 BaseFile(const FilePath& full_path, 28 BaseFile(const FilePath& full_path,
27 const GURL& source_url, 29 const GURL& source_url,
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 int64 bytes_so_far_; 90 int64 bytes_so_far_;
89 91
90 // RAII handle to keep the system from sleeping while we're downloading. 92 // RAII handle to keep the system from sleeping while we're downloading.
91 PowerSaveBlocker power_save_blocker_; 93 PowerSaveBlocker power_save_blocker_;
92 94
93 // Indicates if sha256 hash should be calculated for the file. 95 // Indicates if sha256 hash should be calculated for the file.
94 bool calculate_hash_; 96 bool calculate_hash_;
95 97
96 // Used to calculate sha256 hash for the file when calculate_hash_ 98 // Used to calculate sha256 hash for the file when calculate_hash_
97 // is set. 99 // is set.
98 scoped_ptr<SHA256Context> sha_context_; 100 scoped_ptr<base::SecureHash> secure_hash_;
99 101
100 unsigned char sha256_hash_[kSha256HashLen]; 102 unsigned char sha256_hash_[kSha256HashLen];
101 103
102 DISALLOW_COPY_AND_ASSIGN(BaseFile); 104 DISALLOW_COPY_AND_ASSIGN(BaseFile);
103 }; 105 };
104 106
105 #endif // CHROME_BROWSER_DOWNLOAD_BASE_FILE_H_ 107 #endif // CHROME_BROWSER_DOWNLOAD_BASE_FILE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698