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

Side by Side Diff: extensions/browser/updater/extension_downloader.h

Issue 1903713002: Revert of Rate limit programmatic update checks for extensions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « extensions/browser/event_router.h ('k') | extensions/browser/updater/extension_downloader.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef EXTENSIONS_BROWSER_UPDATER_EXTENSION_DOWNLOADER_H_ 5 #ifndef EXTENSIONS_BROWSER_UPDATER_EXTENSION_DOWNLOADER_H_
6 #define EXTENSIONS_BROWSER_UPDATER_EXTENSION_DOWNLOADER_H_ 6 #define EXTENSIONS_BROWSER_UPDATER_EXTENSION_DOWNLOADER_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
(...skipping 28 matching lines...) Expand all
39 39
40 struct UpdateDetails { 40 struct UpdateDetails {
41 UpdateDetails(const std::string& id, const base::Version& version); 41 UpdateDetails(const std::string& id, const base::Version& version);
42 ~UpdateDetails(); 42 ~UpdateDetails();
43 43
44 std::string id; 44 std::string id;
45 base::Version version; 45 base::Version version;
46 }; 46 };
47 47
48 class ExtensionCache; 48 class ExtensionCache;
49 class ExtensionDownloaderTestDelegate;
50 class ExtensionUpdaterTest; 49 class ExtensionUpdaterTest;
51 50
52 // A class that checks for updates of a given list of extensions, and downloads 51 // A class that checks for updates of a given list of extensions, and downloads
53 // the crx file when updates are found. It uses a |ExtensionDownloaderDelegate| 52 // the crx file when updates are found. It uses a |ExtensionDownloaderDelegate|
54 // that takes ownership of the downloaded crx files, and handles events during 53 // that takes ownership of the downloaded crx files, and handles events during
55 // the update check. 54 // the update check.
56 class ExtensionDownloader : public net::URLFetcherDelegate, 55 class ExtensionDownloader : public net::URLFetcherDelegate,
57 public OAuth2TokenService::Consumer { 56 public OAuth2TokenService::Consumer {
58 public: 57 public:
59 // A closure which constructs a new ExtensionDownloader to be owned by the 58 // A closure which constructs a new ExtensionDownloader to be owned by the
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 } 107 }
109 108
110 void set_ping_enabled_domain(const std::string& domain) { 109 void set_ping_enabled_domain(const std::string& domain) {
111 ping_enabled_domain_ = domain; 110 ping_enabled_domain_ = domain;
112 } 111 }
113 112
114 void set_enable_extra_update_metrics(bool enable) { 113 void set_enable_extra_update_metrics(bool enable) {
115 enable_extra_update_metrics_ = enable; 114 enable_extra_update_metrics_ = enable;
116 } 115 }
117 116
118 // Sets a test delegate to use by any instances of this class. The |delegate|
119 // should outlive all instances.
120 static void set_test_delegate(ExtensionDownloaderTestDelegate* delegate);
121
122 // These are needed for unit testing, to help identify the correct mock 117 // These are needed for unit testing, to help identify the correct mock
123 // URLFetcher objects. 118 // URLFetcher objects.
124 static const int kManifestFetcherId = 1; 119 static const int kManifestFetcherId = 1;
125 static const int kExtensionFetcherId = 2; 120 static const int kExtensionFetcherId = 2;
126 121
127 // Update AppID for extension blacklist. 122 // Update AppID for extension blacklist.
128 static const char kBlacklistAppID[]; 123 static const char kBlacklistAppID[];
129 124
130 static const int kMaxRetries = 10; 125 static const int kMaxRetries = 10;
131 126
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 328
334 // Used to create WeakPtrs to |this|. 329 // Used to create WeakPtrs to |this|.
335 base::WeakPtrFactory<ExtensionDownloader> weak_ptr_factory_; 330 base::WeakPtrFactory<ExtensionDownloader> weak_ptr_factory_;
336 331
337 DISALLOW_COPY_AND_ASSIGN(ExtensionDownloader); 332 DISALLOW_COPY_AND_ASSIGN(ExtensionDownloader);
338 }; 333 };
339 334
340 } // namespace extensions 335 } // namespace extensions
341 336
342 #endif // EXTENSIONS_BROWSER_UPDATER_EXTENSION_DOWNLOADER_H_ 337 #endif // EXTENSIONS_BROWSER_UPDATER_EXTENSION_DOWNLOADER_H_
OLDNEW
« no previous file with comments | « extensions/browser/event_router.h ('k') | extensions/browser/updater/extension_downloader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698