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

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 1892 matching lines...) Expand 10 before | Expand all | Expand 10 after
1903 &notification_source); 1903 &notification_source);
1904 content::NotificationService::current()->Notify( 1904 content::NotificationService::current()->Notify(
1905 extensions::NOTIFICATION_EXTENSION_DOWNLOADS_EVENT, 1905 extensions::NOTIFICATION_EXTENSION_DOWNLOADS_EVENT,
1906 content_source, 1906 content_source,
1907 content::Details<std::string>(&json_args)); 1907 content::Details<std::string>(&json_args));
1908 } 1908 }
1909 1909
1910 void ExtensionDownloadsEventRouter::OnExtensionUnloaded( 1910 void ExtensionDownloadsEventRouter::OnExtensionUnloaded(
1911 content::BrowserContext* browser_context, 1911 content::BrowserContext* browser_context,
1912 const Extension* extension, 1912 const Extension* extension,
1913 UnloadedExtensionInfo::Reason reason) { 1913 UnloadedExtensionReason reason) {
1914 DCHECK_CURRENTLY_ON(BrowserThread::UI); 1914 DCHECK_CURRENTLY_ON(BrowserThread::UI);
1915 std::set<const Extension*>::iterator iter = 1915 std::set<const Extension*>::iterator iter =
1916 shelf_disabling_extensions_.find(extension); 1916 shelf_disabling_extensions_.find(extension);
1917 if (iter != shelf_disabling_extensions_.end()) 1917 if (iter != shelf_disabling_extensions_.end())
1918 shelf_disabling_extensions_.erase(iter); 1918 shelf_disabling_extensions_.erase(iter);
1919 } 1919 }
1920 1920
1921 void ExtensionDownloadsEventRouter::CheckForHistoryFilesRemoval() { 1921 void ExtensionDownloadsEventRouter::CheckForHistoryFilesRemoval() {
1922 static const int kFileExistenceRateLimitSeconds = 10; 1922 static const int kFileExistenceRateLimitSeconds = 10;
1923 DownloadManager* manager = notifier_.GetManager(); 1923 DownloadManager* manager = notifier_.GetManager();
1924 if (!manager) 1924 if (!manager)
1925 return; 1925 return;
1926 base::Time now(base::Time::Now()); 1926 base::Time now(base::Time::Now());
1927 int delta = now.ToTimeT() - last_checked_removal_.ToTimeT(); 1927 int delta = now.ToTimeT() - last_checked_removal_.ToTimeT();
1928 if (delta <= kFileExistenceRateLimitSeconds) 1928 if (delta <= kFileExistenceRateLimitSeconds)
1929 return; 1929 return;
1930 last_checked_removal_ = now; 1930 last_checked_removal_ = now;
1931 manager->CheckForHistoryFilesRemoval(); 1931 manager->CheckForHistoryFilesRemoval();
1932 } 1932 }
1933 1933
1934 } // namespace extensions 1934 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698