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

Side by Side Diff: chrome/browser/extensions/api/downloads/downloads_api.cc

Issue 2839373003: struct UnloadedExtensionInfo -> enum UnloadedExtensionInfoReason (Closed)
Patch Set: Rebase Created 3 years, 7 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
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 "chrome/browser/extensions/api/downloads/downloads_api.h" 5 #include "chrome/browser/extensions/api/downloads/downloads_api.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <memory> 9 #include <memory>
10 #include <set> 10 #include <set>
(...skipping 1890 matching lines...) Expand 10 before | Expand all | Expand 10 after
1901 &notification_source); 1901 &notification_source);
1902 content::NotificationService::current()->Notify( 1902 content::NotificationService::current()->Notify(
1903 extensions::NOTIFICATION_EXTENSION_DOWNLOADS_EVENT, 1903 extensions::NOTIFICATION_EXTENSION_DOWNLOADS_EVENT,
1904 content_source, 1904 content_source,
1905 content::Details<std::string>(&json_args)); 1905 content::Details<std::string>(&json_args));
1906 } 1906 }
1907 1907
1908 void ExtensionDownloadsEventRouter::OnExtensionUnloaded( 1908 void ExtensionDownloadsEventRouter::OnExtensionUnloaded(
1909 content::BrowserContext* browser_context, 1909 content::BrowserContext* browser_context,
1910 const Extension* extension, 1910 const Extension* extension,
1911 UnloadedExtensionInfo::Reason reason) { 1911 UnloadedExtensionReason reason) {
1912 DCHECK_CURRENTLY_ON(BrowserThread::UI); 1912 DCHECK_CURRENTLY_ON(BrowserThread::UI);
1913 std::set<const Extension*>::iterator iter = 1913 std::set<const Extension*>::iterator iter =
1914 shelf_disabling_extensions_.find(extension); 1914 shelf_disabling_extensions_.find(extension);
1915 if (iter != shelf_disabling_extensions_.end()) 1915 if (iter != shelf_disabling_extensions_.end())
1916 shelf_disabling_extensions_.erase(iter); 1916 shelf_disabling_extensions_.erase(iter);
1917 } 1917 }
1918 1918
1919 void ExtensionDownloadsEventRouter::CheckForHistoryFilesRemoval() { 1919 void ExtensionDownloadsEventRouter::CheckForHistoryFilesRemoval() {
1920 static const int kFileExistenceRateLimitSeconds = 10; 1920 static const int kFileExistenceRateLimitSeconds = 10;
1921 DownloadManager* manager = notifier_.GetManager(); 1921 DownloadManager* manager = notifier_.GetManager();
1922 if (!manager) 1922 if (!manager)
1923 return; 1923 return;
1924 base::Time now(base::Time::Now()); 1924 base::Time now(base::Time::Now());
1925 int delta = now.ToTimeT() - last_checked_removal_.ToTimeT(); 1925 int delta = now.ToTimeT() - last_checked_removal_.ToTimeT();
1926 if (delta <= kFileExistenceRateLimitSeconds) 1926 if (delta <= kFileExistenceRateLimitSeconds)
1927 return; 1927 return;
1928 last_checked_removal_ = now; 1928 last_checked_removal_ = now;
1929 manager->CheckForHistoryFilesRemoval(); 1929 manager->CheckForHistoryFilesRemoval();
1930 } 1930 }
1931 1931
1932 } // namespace extensions 1932 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698