OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 CHROME_BROWSER_CHROMEOS_EXTENSIONS_INSTALL_LIMITER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_INSTALL_LIMITER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_INSTALL_LIMITER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_INSTALL_LIMITER_H_ |
7 | 7 |
8 #include <queue> | 8 #include <queue> |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 }; | 50 }; |
51 | 51 |
52 typedef std::queue<DeferredInstall> DeferredInstallList; | 52 typedef std::queue<DeferredInstall> DeferredInstallList; |
53 typedef std::set<scoped_refptr<CrxInstaller> > CrxInstallerSet; | 53 typedef std::set<scoped_refptr<CrxInstaller> > CrxInstallerSet; |
54 | 54 |
55 // Adds install info with size. If |size| is greater than a certain threshold, | 55 // Adds install info with size. If |size| is greater than a certain threshold, |
56 // it stores the install info into |deferred_installs_| to run it later. | 56 // it stores the install info into |deferred_installs_| to run it later. |
57 // Otherwise, it just runs the installer. | 57 // Otherwise, it just runs the installer. |
58 void AddWithSize(const scoped_refptr<CrxInstaller>& installer, | 58 void AddWithSize(const scoped_refptr<CrxInstaller>& installer, |
59 const base::FilePath& path, | 59 const base::FilePath& path, |
60 int64* size); | 60 int64 size); |
61 | 61 |
62 // Checks and runs deferred big app installs when appropriate. | 62 // Checks and runs deferred big app installs when appropriate. |
63 void CheckAndRunDeferrredInstalls(); | 63 void CheckAndRunDeferrredInstalls(); |
64 | 64 |
65 // Starts install using passed-in info and observes |installer|'s done | 65 // Starts install using passed-in info and observes |installer|'s done |
66 // notification. | 66 // notification. |
67 void RunInstall(const scoped_refptr<CrxInstaller>& installer, | 67 void RunInstall(const scoped_refptr<CrxInstaller>& installer, |
68 const base::FilePath& path); | 68 const base::FilePath& path); |
69 | 69 |
70 // content::NotificationObserver overrides: | 70 // content::NotificationObserver overrides: |
(...skipping 10 matching lines...) Expand all Loading... |
81 base::OneShotTimer<InstallLimiter> wait_timer_; | 81 base::OneShotTimer<InstallLimiter> wait_timer_; |
82 | 82 |
83 bool disabled_for_test_; | 83 bool disabled_for_test_; |
84 | 84 |
85 DISALLOW_COPY_AND_ASSIGN(InstallLimiter); | 85 DISALLOW_COPY_AND_ASSIGN(InstallLimiter); |
86 }; | 86 }; |
87 | 87 |
88 } // namespace extensions | 88 } // namespace extensions |
89 | 89 |
90 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_INSTALL_LIMITER_H_ | 90 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_INSTALL_LIMITER_H_ |
OLD | NEW |