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

Side by Side Diff: content/browser/download/download_item_impl.h

Issue 8571023: Implemented ExternalData interface on DownloadItem and used it for SafeBrowsing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Synced up to near TOT. Created 9 years 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_ 5 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_
6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_ 6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 virtual DownloadStateInfo GetStateInfo() const OVERRIDE; 195 virtual DownloadStateInfo GetStateInfo() const OVERRIDE;
196 virtual content::BrowserContext* BrowserContext() const OVERRIDE; 196 virtual content::BrowserContext* BrowserContext() const OVERRIDE;
197 virtual TabContents* GetTabContents() const OVERRIDE; 197 virtual TabContents* GetTabContents() const OVERRIDE;
198 virtual FilePath GetTargetFilePath() const OVERRIDE; 198 virtual FilePath GetTargetFilePath() const OVERRIDE;
199 virtual FilePath GetFileNameToReportUser() const OVERRIDE; 199 virtual FilePath GetFileNameToReportUser() const OVERRIDE;
200 virtual FilePath GetUserVerifiedFilePath() const OVERRIDE; 200 virtual FilePath GetUserVerifiedFilePath() const OVERRIDE;
201 virtual bool NeedsRename() const OVERRIDE; 201 virtual bool NeedsRename() const OVERRIDE;
202 virtual void OffThreadCancel(DownloadFileManager* file_manager) OVERRIDE; 202 virtual void OffThreadCancel(DownloadFileManager* file_manager) OVERRIDE;
203 virtual std::string DebugString(bool verbose) const OVERRIDE; 203 virtual std::string DebugString(bool verbose) const OVERRIDE;
204 virtual void MockDownloadOpenForTesting() OVERRIDE; 204 virtual void MockDownloadOpenForTesting() OVERRIDE;
205 virtual ExternalData* GetExternalData(const void* key) OVERRIDE;
206 virtual void SetExternalData(const void* key, ExternalData* data) OVERRIDE;
205 207
206 private: 208 private:
207 // Construction common to all constructors. |active| should be true for new 209 // Construction common to all constructors. |active| should be true for new
208 // downloads and false for downloads from the history. 210 // downloads and false for downloads from the history.
209 void Init(bool active); 211 void Init(bool active);
210 212
211 // Internal helper for maintaining consistent received and total sizes. 213 // Internal helper for maintaining consistent received and total sizes.
212 void UpdateSize(int64 size); 214 void UpdateSize(int64 size);
213 215
214 // Called when the entire download operation (including renaming etc) 216 // Called when the entire download operation (including renaming etc)
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 // be treated as though the user opened it. 347 // be treated as though the user opened it.
346 bool opened_; 348 bool opened_;
347 349
348 // Do we actual open downloads when requested? For testing purposes 350 // Do we actual open downloads when requested? For testing purposes
349 // only. 351 // only.
350 bool open_enabled_; 352 bool open_enabled_;
351 353
352 // Did the delegate delay calling Complete on this download? 354 // Did the delegate delay calling Complete on this download?
353 bool delegate_delayed_complete_; 355 bool delegate_delayed_complete_;
354 356
357 // External Data storage. All objects in the store
358 // are owned by the DownloadItemImpl.
359 std::map<const void*, ExternalData*> external_data_map_;
360
355 DISALLOW_COPY_AND_ASSIGN(DownloadItemImpl); 361 DISALLOW_COPY_AND_ASSIGN(DownloadItemImpl);
356 }; 362 };
357 363
358 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_ 364 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698