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

Side by Side Diff: chrome/browser/component_updater/component_updater_service.h

Issue 318143003: Make CUS interface more resilient by returning a copy of the data (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/component_updater/component_updater_service.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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_SERVICE_H_ 5 #ifndef CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_SERVICE_H_
6 #define CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_SERVICE_H_ 6 #define CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_SERVICE_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/gtest_prod_util.h" 11 #include "base/gtest_prod_util.h"
12 #include "base/memory/weak_ptr.h"
12 #include "base/version.h" 13 #include "base/version.h"
13 #include "url/gurl.h" 14 #include "url/gurl.h"
14 15
15 class ComponentsUI; 16 class ComponentsUI;
16 17
17 namespace base { 18 namespace base {
18 class DictionaryValue; 19 class DictionaryValue;
19 class FilePath; 20 class FilePath;
20 } 21 }
21 22
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 // Returns a list of registered components. 201 // Returns a list of registered components.
201 virtual std::vector<std::string> GetComponentIDs() const = 0; 202 virtual std::vector<std::string> GetComponentIDs() const = 0;
202 203
203 // Returns an interface for on-demand updates. On-demand updates are 204 // Returns an interface for on-demand updates. On-demand updates are
204 // proactively triggered outside the normal component update service schedule. 205 // proactively triggered outside the normal component update service schedule.
205 virtual OnDemandUpdater& GetOnDemandUpdater() = 0; 206 virtual OnDemandUpdater& GetOnDemandUpdater() = 0;
206 207
207 virtual ~ComponentUpdateService() {} 208 virtual ~ComponentUpdateService() {}
208 209
209 private: 210 private:
210 // Returns details about registered component. The object returned is owned 211 // Returns details about registered component.
211 // by this class. TODO(sorin): replace with a WeakPtr. 212 virtual base::WeakPtr<CrxUpdateItem> GetComponentDetails(
cpu_(ooo_6.6-7.5) 2014/06/09 23:12:57 This sparked an interesting discussion among few f
212 virtual CrxUpdateItem* GetComponentDetails(
213 const std::string& component_id) const = 0; 213 const std::string& component_id) const = 0;
214 214
215 friend class ::ComponentsUI; 215 friend class ::ComponentsUI;
216 FRIEND_TEST_ALL_PREFIXES(ComponentUpdaterTest, ResourceThrottleLiveNoUpdate); 216 FRIEND_TEST_ALL_PREFIXES(ComponentUpdaterTest, ResourceThrottleLiveNoUpdate);
217 }; 217 };
218 218
219 typedef ComponentUpdateService::Observer ServiceObserver; 219 typedef ComponentUpdateService::Observer ServiceObserver;
220 220
221 class OnDemandUpdater { 221 class OnDemandUpdater {
222 public: 222 public:
(...skipping 24 matching lines...) Expand all
247 const std::string& component_id) = 0; 247 const std::string& component_id) = 0;
248 }; 248 };
249 249
250 // Creates the component updater. You must pass a valid |config| allocated on 250 // Creates the component updater. You must pass a valid |config| allocated on
251 // the heap which the component updater will own. 251 // the heap which the component updater will own.
252 ComponentUpdateService* ComponentUpdateServiceFactory( 252 ComponentUpdateService* ComponentUpdateServiceFactory(
253 ComponentUpdateService::Configurator* config); 253 ComponentUpdateService::Configurator* config);
254 } // namespace component_updater 254 } // namespace component_updater
255 255
256 #endif // CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_SERVICE_H_ 256 #endif // CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_SERVICE_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/component_updater/component_updater_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698