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

Side by Side Diff: chrome/installer/setup/setup_util.h

Issue 15908002: Differential updates for components. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 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
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 // This file declares util functions for setup project. 5 // This file declares util functions for setup project. It also declares a
6 // few functions that the Chrome component updater uses for patching binary
7 // deltas.
6 8
7 #ifndef CHROME_INSTALLER_SETUP_SETUP_UTIL_H_ 9 #ifndef CHROME_INSTALLER_SETUP_SETUP_UTIL_H_
8 #define CHROME_INSTALLER_SETUP_SETUP_UTIL_H_ 10 #define CHROME_INSTALLER_SETUP_SETUP_UTIL_H_
9 11
10 #include <windows.h> 12 #include <windows.h>
11 13
12 #include "base/basictypes.h" 14 #include "base/basictypes.h"
13 #include "base/strings/string16.h" 15 #include "base/strings/string16.h"
14 #include "base/win/scoped_handle.h" 16 #include "base/win/scoped_handle.h"
15 #include "chrome/installer/util/browser_distribution.h" 17 #include "chrome/installer/util/browser_distribution.h"
16 #include "chrome/installer/util/util_constants.h" 18 #include "chrome/installer/util/util_constants.h"
17 19
18 class CommandLine; 20 class CommandLine;
19 21
20 namespace base { 22 namespace base {
21 class FilePath; 23 class FilePath;
22 class Version; 24 class Version;
23 } 25 }
24 26
25 namespace installer { 27 namespace installer {
26 28
27 class InstallationState; 29 class InstallationState;
28 class InstallerState; 30 class InstallerState;
29 class ProductState; 31 class ProductState;
30 32
31 // Apply a diff patch to source file. First tries to apply it using courgette 33 // Apply a diff patch to source file. First tries to apply it using Courgette
32 // since it checks for courgette header and fails quickly. If that fails 34 // since it checks for Courgette header and fails quickly. If that fails
33 // tries to apply the patch using regular bsdiff. Returns status code. 35 // tries to apply the patch using regular bsdiff. Returns status code as
36 // defined by the bsdiff code (see third_party/bspatch/mbspatch.h for the
37 // definitions of the codes).
34 // The installer stage is updated if |installer_state| is non-NULL. 38 // The installer stage is updated if |installer_state| is non-NULL.
35 int ApplyDiffPatch(const base::FilePath& src, 39 int ApplyDiffPatch(const base::FilePath& src,
36 const base::FilePath& patch, 40 const base::FilePath& patch,
37 const base::FilePath& dest, 41 const base::FilePath& dest,
38 const InstallerState* installer_state); 42 const InstallerState* installer_state);
39 43
44 // Applies a patch file to source file using Courgette. Returns 0 in case of
45 // success. In case of errors, it returns kCourgetteErrorOffset + a Courgette
46 // status code, as defined in courgette/courgette.h
47 int CourgettePatchFiles(const base::FilePath& src,
48 const base::FilePath& patch,
49 const base::FilePath& dest);
50
51 // Applies a patch file to source file using bsdiff. This function uses
52 // Courgette's flavor of bsdiff. Returns 0 in case of success, or
53 // kBsdiffErrorOffset + a bsdiff status code in case of errors.
54 // See courgette/third_party/bsdiff.h for details.
55 int BsdiffPatchFiles(const base::FilePath& src,
56 const base::FilePath& patch,
57 const base::FilePath& dest);
58
40 // Find the version of Chrome from an install source directory. 59 // Find the version of Chrome from an install source directory.
41 // Chrome_path should contain at least one version folder. 60 // Chrome_path should contain at least one version folder.
42 // Returns the maximum version found or NULL if no version is found. 61 // Returns the maximum version found or NULL if no version is found.
43 Version* GetMaxVersionFromArchiveDir(const base::FilePath& chrome_path); 62 Version* GetMaxVersionFromArchiveDir(const base::FilePath& chrome_path);
44 63
45 // Spawns a new process that waits for a specified amount of time before 64 // Spawns a new process that waits for a specified amount of time before
46 // attempting to delete |path|. This is useful for setup to delete the 65 // attempting to delete |path|. This is useful for setup to delete the
47 // currently running executable or a file that we cannot close right away but 66 // currently running executable or a file that we cannot close right away but
48 // estimate that it will be possible after some period of time. 67 // estimate that it will be possible after some period of time.
49 // Returns true if a new process was started, false otherwise. Note that 68 // Returns true if a new process was started, false otherwise. Note that
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 // The previous state of the privilege this object is responsible for. As set 130 // The previous state of the privilege this object is responsible for. As set
112 // by AdjustTokenPrivileges() upon construction. 131 // by AdjustTokenPrivileges() upon construction.
113 TOKEN_PRIVILEGES previous_privileges_; 132 TOKEN_PRIVILEGES previous_privileges_;
114 133
115 DISALLOW_IMPLICIT_CONSTRUCTORS(ScopedTokenPrivilege); 134 DISALLOW_IMPLICIT_CONSTRUCTORS(ScopedTokenPrivilege);
116 }; 135 };
117 136
118 } // namespace installer 137 } // namespace installer
119 138
120 #endif // CHROME_INSTALLER_SETUP_SETUP_UTIL_H_ 139 #endif // CHROME_INSTALLER_SETUP_SETUP_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698