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

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

Issue 21355004: [Downloads] Move client guid for AV scanning of downloaded files to chrome/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 4 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
« no previous file with comments | « content/browser/download/base_file.h ('k') | content/browser/download/base_file_win.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) 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/base_file.h" 5 #include "content/browser/download/base_file.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/format_macros.h" 9 #include "base/format_macros.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 204
205 void BaseFile::Finish() { 205 void BaseFile::Finish() {
206 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); 206 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
207 207
208 if (calculate_hash_) 208 if (calculate_hash_)
209 secure_hash_->Finish(sha256_hash_, kSha256HashLen); 209 secure_hash_->Finish(sha256_hash_, kSha256HashLen);
210 210
211 Close(); 211 Close();
212 } 212 }
213 213
214 void BaseFile::SetClientGuid(const std::string& guid) {
215 client_guid_ = guid;
216 }
217
214 // OS_WIN, OS_MACOSX and OS_LINUX have specialized implementations. 218 // OS_WIN, OS_MACOSX and OS_LINUX have specialized implementations.
215 #if !defined(OS_WIN) && !defined(OS_MACOSX) && !defined(OS_LINUX) 219 #if !defined(OS_WIN) && !defined(OS_MACOSX) && !defined(OS_LINUX)
216 DownloadInterruptReason BaseFile::AnnotateWithSourceInformation() { 220 DownloadInterruptReason BaseFile::AnnotateWithSourceInformation() {
217 return DOWNLOAD_INTERRUPT_REASON_NONE; 221 return DOWNLOAD_INTERRUPT_REASON_NONE;
218 } 222 }
219 #endif 223 #endif
220 224
221 bool BaseFile::GetHash(std::string* hash) { 225 bool BaseFile::GetHash(std::string* hash) {
222 DCHECK(!detached_); 226 DCHECK(!detached_);
223 hash->assign(reinterpret_cast<const char*>(sha256_hash_), 227 hash->assign(reinterpret_cast<const char*>(sha256_hash_),
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 const char* operation, 362 const char* operation,
359 int os_error, 363 int os_error,
360 DownloadInterruptReason reason) { 364 DownloadInterruptReason reason) {
361 bound_net_log_.AddEvent( 365 bound_net_log_.AddEvent(
362 net::NetLog::TYPE_DOWNLOAD_FILE_ERROR, 366 net::NetLog::TYPE_DOWNLOAD_FILE_ERROR,
363 base::Bind(&FileInterruptedNetLogCallback, operation, os_error, reason)); 367 base::Bind(&FileInterruptedNetLogCallback, operation, os_error, reason));
364 return reason; 368 return reason;
365 } 369 }
366 370
367 } // namespace content 371 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/download/base_file.h ('k') | content/browser/download/base_file_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698