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

Side by Side Diff: chrome/browser/component_updater/pnacl/pnacl_component_installer.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_PNACL_PNACL_COMPONENT_INSTALLER_H_ 5 #ifndef CHROME_BROWSER_COMPONENT_UPDATER_PNACL_PNACL_COMPONENT_INSTALLER_H_
6 #define CHROME_BROWSER_COMPONENT_UPDATER_PNACL_PNACL_COMPONENT_INSTALLER_H_ 6 #define CHROME_BROWSER_COMPONENT_UPDATER_PNACL_PNACL_COMPONENT_INSTALLER_H_
7 7
8 #include <list> 8 #include <list>
9 9
10 #include "base/callback_forward.h" 10 #include "base/callback_forward.h"
(...skipping 29 matching lines...) Expand all
40 base::FilePath* installed_file) OVERRIDE; 40 base::FilePath* installed_file) OVERRIDE;
41 41
42 // Register a PNaCl component for the first time. 42 // Register a PNaCl component for the first time.
43 void RegisterPnaclComponent(ComponentUpdateService* cus, 43 void RegisterPnaclComponent(ComponentUpdateService* cus,
44 const CommandLine& command_line); 44 const CommandLine& command_line);
45 45
46 // Check the PNaCl version again and re-register with the component 46 // Check the PNaCl version again and re-register with the component
47 // updater service. 47 // updater service.
48 void ReRegisterPnacl(); 48 void ReRegisterPnacl();
49 49
50 CrxComponent GetCrxComponent();
Sorin Jianu 2013/07/03 21:17:32 could declare the function const.
jvoung (off chromium) 2013/07/03 22:51:51 Done. It does introduce a const-cast when taking
51
50 // Return true if PNaCl installs are separated by user. 52 // Return true if PNaCl installs are separated by user.
51 bool per_user() const { return per_user_; } 53 bool per_user() const { return per_user_; }
52 54
53 // If per_user, function to call when profile is changed. 55 // If per_user, function to call when profile is changed.
54 void OnProfileChange(); 56 void OnProfileChange();
55 57
56 // Return true if PNaCl updates are disabled. 58 // Return true if PNaCl updates are disabled.
57 bool updates_disabled() const { return updates_disabled_; } 59 bool updates_disabled() const { return updates_disabled_; }
58 60
59 // Determine the base directory for storing each version of PNaCl. 61 // Determine the base directory for storing each version of PNaCl.
(...skipping 17 matching lines...) Expand all
77 void CancelCallback(int callback_num); 79 void CancelCallback(int callback_num);
78 80
79 void NotifyAllWithResult(bool status); 81 void NotifyAllWithResult(bool status);
80 82
81 bool per_user_; 83 bool per_user_;
82 bool updates_disabled_; 84 bool updates_disabled_;
83 scoped_ptr<PnaclProfileObserver> profile_observer_; 85 scoped_ptr<PnaclProfileObserver> profile_observer_;
84 base::FilePath current_profile_path_; 86 base::FilePath current_profile_path_;
85 base::Version current_version_; 87 base::Version current_version_;
86 ComponentUpdateService* cus_; 88 ComponentUpdateService* cus_;
87 // Counter to issue identifiers to each callback.
88 int callback_nums_;
89 // List of callbacks to issue when an install completes successfully. 89 // List of callbacks to issue when an install completes successfully.
90 std::list<std::pair<InstallCallback, int> > install_callbacks_; 90 std::list<InstallCallback> install_callbacks_;
91 // Component updater service observer, to determine when an on-demand 91 // Component updater service observer, to determine when an on-demand
92 // install request failed. 92 // install request failed.
93 scoped_ptr<PnaclUpdaterObserver> updater_observer_; 93 scoped_ptr<PnaclUpdaterObserver> updater_observer_;
94 DISALLOW_COPY_AND_ASSIGN(PnaclComponentInstaller); 94 DISALLOW_COPY_AND_ASSIGN(PnaclComponentInstaller);
95 }; 95 };
96 96
97 // Returns true if this browser is compatible with the given Pnacl component 97 // Returns true if this browser is compatible with the given Pnacl component
98 // manifest, with the version specified in the manifest in |version_out|. 98 // manifest, with the version specified in the manifest in |version_out|.
99 bool CheckPnaclComponentManifest(const base::DictionaryValue& manifest, 99 bool CheckPnaclComponentManifest(const base::DictionaryValue& manifest,
100 base::Version* version_out); 100 base::Version* version_out);
101 101
102 // Ask the given component updater service to do a first-install for PNaCl. 102 // Ask the given component updater service to do a first-install for PNaCl.
103 // The |installed| callback will be run with |true| on success, 103 // The |installed| callback will be run with |true| on success,
104 // or run with |false| on an error. The callback is called on the UI thread. 104 // or run with |false| on an error. The callback is called on the UI thread.
105 void RequestFirstInstall(ComponentUpdateService* cus, 105 void RequestFirstInstall(ComponentUpdateService* cus,
106 PnaclComponentInstaller* pci, 106 PnaclComponentInstaller* pci,
107 const base::Callback<void(bool)>& installed); 107 const base::Callback<void(bool)>& installed);
108 108
109 #endif // CHROME_BROWSER_COMPONENT_UPDATER_PNACL_PNACL_COMPONENT_INSTALLER_H_ 109 #endif // CHROME_BROWSER_COMPONENT_UPDATER_PNACL_PNACL_COMPONENT_INSTALLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698