// Note: Any change to the danger type strings, should be accompanied by a
// corresponding change to downloads.json.
-const char* kDangerStrings[] = {
+const char* const kDangerStrings[] = {
kDangerSafe,
kDangerFile,
kDangerUrl,
// Note: Any change to the state strings, should be accompanied by a
// corresponding change to downloads.json.
-const char* kStateStrings[] = {
+const char* const kStateStrings[] = {
kStateInProgress,
kStateComplete,
kStateInterrupted,
public:
DownloadFileIconExtractorImpl() {}
- virtual ~DownloadFileIconExtractorImpl() {}
+ ~DownloadFileIconExtractorImpl() override {}
+
+ bool ExtractIconURLForPath(const base::FilePath& path,
+ float scale,
+ IconLoader::IconSize icon_size,
+ IconURLCallback callback) override;
- virtual bool ExtractIconURLForPath(const base::FilePath& path,
- float scale,
- IconLoader::IconSize icon_size,
- IconURLCallback callback) OVERRIDE;
private:
void OnIconLoadComplete(
float scale, const IconURLCallback& callback, gfx::Image* icon);
typedef base::hash_map<std::string, DownloadQuery::FilterType> FilterTypeMap;
-void InitFilterTypeMap(FilterTypeMap& filter_types) {
+void InitFilterTypeMap(FilterTypeMap* filter_types_ptr) {
+ FilterTypeMap& filter_types = *filter_types_ptr;
filter_types[kBytesReceivedKey] = DownloadQuery::FILTER_BYTES_RECEIVED;
filter_types[kExistsKey] = DownloadQuery::FILTER_EXISTS;
filter_types[kFilenameKey] = DownloadQuery::FILTER_FILENAME;
typedef base::hash_map<std::string, DownloadQuery::SortType> SortTypeMap;
-void InitSortTypeMap(SortTypeMap& sorter_types) {
+void InitSortTypeMap(SortTypeMap* sorter_types_ptr) {
+ SortTypeMap& sorter_types = *sorter_types_ptr;
sorter_types[kBytesReceivedKey] = DownloadQuery::SORT_BYTES_RECEIVED;
sorter_types[kDangerKey] = DownloadQuery::SORT_DANGER;
sorter_types[kEndTimeKey] = DownloadQuery::SORT_END_TIME;
// comparisons.
static base::LazyInstance<SortTypeMap> sorter_types =
LAZY_INSTANCE_INITIALIZER;
- if (sorter_types.Get().size() == 0)
- InitSortTypeMap(sorter_types.Get());
+ if (sorter_types.Get().empty())
+ InitSortTypeMap(sorter_types.Pointer());
for (std::vector<std::string>::const_iterator iter = order_by_strs.begin();
iter != order_by_strs.end(); ++iter) {
// comparisons.
static base::LazyInstance<FilterTypeMap> filter_types =
LAZY_INSTANCE_INITIALIZER;
- if (filter_types.Get().size() == 0)
- InitFilterTypeMap(filter_types.Get());
+ if (filter_types.Get().empty())
+ InitFilterTypeMap(filter_types.Pointer());
DownloadQuery query_out;
download_item->SetUserData(kKey, this);
}
- virtual ~ExtensionDownloadsEventRouterData() {
+ ~ExtensionDownloadsEventRouterData() override {
if (updated_ > 0) {
UMA_HISTOGRAM_PERCENTAGE("Download.OnChanged",
(changed_fired_ * 100 / updated_));
manager_->AddObserver(this);
}
- virtual ~ManagerDestructionObserver() {
- manager_->RemoveObserver(this);
- }
+ ~ManagerDestructionObserver() override { manager_->RemoveObserver(this); }
- virtual void ManagerGoingDown(DownloadManager* manager) OVERRIDE {
+ void ManagerGoingDown(DownloadManager* manager) override {
manager_file_existence_last_checked_->erase(manager);
if (manager_file_existence_last_checked_->size() == 0) {
delete manager_file_existence_last_checked_;