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

Side by Side Diff: chrome/installer/test/resource_updater.h

Issue 5236002: Add infrastructure enabling tests of installer upgrade scenarios.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 1 month 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
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // A helper class for updating resources in portable executable files.
6
7 #ifndef CHROME_INSTALLER_TEST_RESOURCE_UPDATER_H_
8 #define CHROME_INSTALLER_TEST_RESOURCE_UPDATER_H_
9 #pragma once
10
11 #include <windows.h>
12
13 #include <string>
14 #include <utility>
15
16 #include "base/basictypes.h"
17
18 class FilePath;
19
20 namespace upgrade_test {
21
22 // Updates resources in a PE image file.
23 class ResourceUpdater {
24 public:
25 ResourceUpdater();
26 ~ResourceUpdater();
27
28 // Loads |pe_image_path| in preparation for updating its resources.
29 bool Initialize(const FilePath& pe_image_path);
30
31 // Replaces the contents of the resource |name| of |type| and |language_id|
32 // with the contents of |input_file|, returning true on success.
33 bool Update(const std::wstring& name, const std::wstring& type,
34 WORD language_id, const FilePath& input_file);
35
36 // Commits all updates to the file on disk.
37 bool Commit();
38
39 private:
40 HANDLE handle_;
41 DISALLOW_COPY_AND_ASSIGN(ResourceUpdater);
42 }; // class ResourceUpdater
43
44 } // namespace upgrade_test
45
46 #endif // CHROME_INSTALLER_TEST_RESOURCE_UPDATER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698