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

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

Issue 18006003: Consistently use notifications from component updater w/ on-demand PNaCl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review Created 7 years, 5 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
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 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/version.h" 11 #include "base/version.h"
12 #include "googleurl/src/gurl.h" 12 #include "googleurl/src/gurl.h"
13 13
14 namespace net { 14 namespace net {
15 class URLRequestContextGetter; 15 class URLRequestContextGetter;
16 } 16 }
17 17
18 namespace base { 18 namespace base {
19 class DictionaryValue; 19 class DictionaryValue;
20 class FilePath; 20 class FilePath;
21 } 21 }
22 22
23 namespace content {
24 class NotificationSource;
25 }
26
23 class ComponentPatcher; 27 class ComponentPatcher;
24 28
25 // Component specific installers must derive from this class and implement 29 // Component specific installers must derive from this class and implement
26 // OnUpdateError() and Install(). A valid instance of this class must be 30 // OnUpdateError() and Install(). A valid instance of this class must be
27 // given to ComponentUpdateService::RegisterComponent(). 31 // given to ComponentUpdateService::RegisterComponent().
28 class ComponentInstaller { 32 class ComponentInstaller {
29 public : 33 public :
30 // Called by the component updater on the UI thread when there was a 34 // Called by the component updater on the UI thread when there was a
31 // problem unpacking or verifying the component. |error| is a non-zero 35 // problem unpacking or verifying the component. |error| is a non-zero
32 // value which is only meaningful to the component updater. 36 // value which is only meaningful to the component updater.
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 // registered component, soon. If an update or check is already in progress, 153 // registered component, soon. If an update or check is already in progress,
150 // returns |kInProgress|. The same component cannot be checked repeatedly 154 // returns |kInProgress|. The same component cannot be checked repeatedly
151 // in a short interval either (returns |kError| if so). 155 // in a short interval either (returns |kError| if so).
152 // There is no guarantee that the item will actually be updated, 156 // There is no guarantee that the item will actually be updated,
153 // since another item may be chosen to be updated. Since there is 157 // since another item may be chosen to be updated. Since there is
154 // no time guarantee, there is no notification if the item is not updated. 158 // no time guarantee, there is no notification if the item is not updated.
155 // However, the ComponentInstaller should know if an update succeeded 159 // However, the ComponentInstaller should know if an update succeeded
156 // via the Install() hook. 160 // via the Install() hook.
157 virtual Status CheckForUpdateSoon(const CrxComponent& component) = 0; 161 virtual Status CheckForUpdateSoon(const CrxComponent& component) = 0;
158 162
163 // Return true if a NOTIFICATION_COMPONENT_UPDATE_FOUND or
164 // NOTIFICATION_COMPONENT_UPDATE_READY is for the given component.
165 static bool IsUpdateNotificationForComponent(
166 const content::NotificationSource& src,
167 const CrxComponent& component);
Sorin Jianu 2013/07/03 21:17:32 This static member seems out of place in the defin
jvoung (off chromium) 2013/07/03 22:51:51 Ah good point. Changed to non-static.
168
159 virtual ~ComponentUpdateService() {} 169 virtual ~ComponentUpdateService() {}
160 }; 170 };
161 171
162 // Creates the component updater. You must pass a valid |config| allocated on 172 // Creates the component updater. You must pass a valid |config| allocated on
163 // the heap which the component updater will own. 173 // the heap which the component updater will own.
164 ComponentUpdateService* ComponentUpdateServiceFactory( 174 ComponentUpdateService* ComponentUpdateServiceFactory(
165 ComponentUpdateService::Configurator* config); 175 ComponentUpdateService::Configurator* config);
166 176
167 #endif // CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_SERVICE_H_ 177 #endif // CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698