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

Side by Side Diff: chrome/installer/util/installer_state.h

Issue 1878313003: Convert //chrome/installer from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert decompress.cc in mini_installer. 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 | « chrome/installer/util/installation_state.h ('k') | chrome/installer/util/installer_state.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 CHROME_INSTALLER_UTIL_INSTALLER_STATE_H_ 5 #ifndef CHROME_INSTALLER_UTIL_INSTALLER_STATE_H_
6 #define CHROME_INSTALLER_UTIL_INSTALLER_STATE_H_ 6 #define CHROME_INSTALLER_UTIL_INSTALLER_STATE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory>
10 #include <set> 11 #include <set>
11 #include <string> 12 #include <string>
12 #include <vector> 13 #include <vector>
13 14
14 #include "base/files/file_path.h" 15 #include "base/files/file_path.h"
15 #include "base/logging.h" 16 #include "base/logging.h"
16 #include "base/macros.h" 17 #include "base/macros.h"
17 #include "base/memory/scoped_ptr.h"
18 #include "base/memory/scoped_vector.h" 18 #include "base/memory/scoped_vector.h"
19 #include "base/strings/string16.h" 19 #include "base/strings/string16.h"
20 #include "base/version.h" 20 #include "base/version.h"
21 #include "build/build_config.h" 21 #include "build/build_config.h"
22 #include "chrome/installer/util/browser_distribution.h" 22 #include "chrome/installer/util/browser_distribution.h"
23 #include "chrome/installer/util/product.h" 23 #include "chrome/installer/util/product.h"
24 #include "chrome/installer/util/util_constants.h" 24 #include "chrome/installer/util/util_constants.h"
25 25
26 #if defined(OS_WIN) 26 #if defined(OS_WIN)
27 #include <windows.h> // NOLINT 27 #include <windows.h> // NOLINT
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 // Adds a product constructed on the basis of |state|, setting this object's 87 // Adds a product constructed on the basis of |state|, setting this object's
88 // msi flag if |state| is msi-installed. Returns the product that was added, 88 // msi flag if |state| is msi-installed. Returns the product that was added,
89 // or NULL if |state| is incompatible with this object. Ownership is not 89 // or NULL if |state| is incompatible with this object. Ownership is not
90 // passed to the caller. 90 // passed to the caller.
91 Product* AddProductFromState(BrowserDistribution::Type type, 91 Product* AddProductFromState(BrowserDistribution::Type type,
92 const ProductState& state); 92 const ProductState& state);
93 93
94 // Returns the product that was added, or NULL if |product| is incompatible 94 // Returns the product that was added, or NULL if |product| is incompatible
95 // with this object. Ownership of |product| is taken by this object, while 95 // with this object. Ownership of |product| is taken by this object, while
96 // ownership of the return value is not passed to the caller. 96 // ownership of the return value is not passed to the caller.
97 Product* AddProduct(scoped_ptr<Product>* product); 97 Product* AddProduct(std::unique_ptr<Product>* product);
98 98
99 // Removes |product| from the set of products to be operated on. The object 99 // Removes |product| from the set of products to be operated on. The object
100 // pointed to by |product| is freed. Returns false if |product| is not 100 // pointed to by |product| is freed. Returns false if |product| is not
101 // present in the set. 101 // present in the set.
102 bool RemoveProduct(const Product* product); 102 bool RemoveProduct(const Product* product);
103 103
104 // The level (user or system) of this operation. 104 // The level (user or system) of this operation.
105 Level level() const { return level_; } 105 Level level() const { return level_; }
106 106
107 // The package type (single or multi) of this operation. 107 // The package type (single or multi) of this operation.
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 void Clear(); 234 void Clear();
235 235
236 // Returns true if any file corresponding to a bit in |file_bits| (from the 236 // Returns true if any file corresponding to a bit in |file_bits| (from the
237 // enum above) for the currently installed version exists and is in use. 237 // enum above) for the currently installed version exists and is in use.
238 bool AnyExistsAndIsInUse(const InstallationState& machine_state, 238 bool AnyExistsAndIsInUse(const InstallationState& machine_state,
239 uint32_t file_bits) const; 239 uint32_t file_bits) const;
240 base::FilePath GetDefaultProductInstallPath(BrowserDistribution* dist) const; 240 base::FilePath GetDefaultProductInstallPath(BrowserDistribution* dist) const;
241 bool CanAddProduct(const Product& product, 241 bool CanAddProduct(const Product& product,
242 const base::FilePath* product_dir) const; 242 const base::FilePath* product_dir) const;
243 Product* AddProductInDirectory(const base::FilePath* product_dir, 243 Product* AddProductInDirectory(const base::FilePath* product_dir,
244 scoped_ptr<Product>* product); 244 std::unique_ptr<Product>* product);
245 Product* AddProductFromPreferences( 245 Product* AddProductFromPreferences(
246 BrowserDistribution::Type distribution_type, 246 BrowserDistribution::Type distribution_type,
247 const MasterPreferences& prefs, 247 const MasterPreferences& prefs,
248 const InstallationState& machine_state); 248 const InstallationState& machine_state);
249 bool IsMultiInstallUpdate(const MasterPreferences& prefs, 249 bool IsMultiInstallUpdate(const MasterPreferences& prefs,
250 const InstallationState& machine_state); 250 const InstallationState& machine_state);
251 251
252 // Enumerates all files named one of 252 // Enumerates all files named one of
253 // [chrome.exe, old_chrome.exe, new_chrome.exe] in target_path_ and 253 // [chrome.exe, old_chrome.exe, new_chrome.exe] in target_path_ and
254 // returns their version numbers in a set. 254 // returns their version numbers in a set.
(...skipping 22 matching lines...) Expand all
277 bool background_mode_; 277 bool background_mode_;
278 bool verbose_logging_; 278 bool verbose_logging_;
279 279
280 private: 280 private:
281 DISALLOW_COPY_AND_ASSIGN(InstallerState); 281 DISALLOW_COPY_AND_ASSIGN(InstallerState);
282 }; // class InstallerState 282 }; // class InstallerState
283 283
284 } // namespace installer 284 } // namespace installer
285 285
286 #endif // CHROME_INSTALLER_UTIL_INSTALLER_STATE_H_ 286 #endif // CHROME_INSTALLER_UTIL_INSTALLER_STATE_H_
OLDNEW
« no previous file with comments | « chrome/installer/util/installation_state.h ('k') | chrome/installer/util/installer_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698