OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_UPDATE_CHECKER_H_ | 5 #ifndef CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_PATCHER_OPERATION_OUT_OF_PROC
ESS_H_ |
6 #define CHROME_BROWSER_COMPONENT_UPDATER_UPDATE_CHECKER_H_ | 6 #define CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_PATCHER_OPERATION_OUT_OF_PROC
ESS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | |
10 | 9 |
11 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
12 #include "base/callback.h" | 11 #include "base/callback_forward.h" |
13 #include "base/memory/scoped_ptr.h" | 12 #include "chrome/browser/component_updater/component_patcher_operation.h" |
14 #include "chrome/browser/component_updater/update_response.h" | |
15 | |
16 class GURL; | |
17 | |
18 namespace net { | |
19 class URLRequestContextGetter; | |
20 } | |
21 | 13 |
22 namespace component_updater { | 14 namespace component_updater { |
23 | 15 |
24 class Configurator; | 16 class PatchHost; |
25 struct CrxUpdateItem; | |
26 | 17 |
27 class UpdateChecker { | 18 // Implements the DeltaUpdateOpPatch out-of-process patching. |
| 19 class ChromeOutOfProcessPatcher : public OutOfProcessPatcher { |
28 public: | 20 public: |
29 typedef base::Callback<void(int error, | 21 ChromeOutOfProcessPatcher(); |
30 const std::string& error_message, | |
31 const UpdateResponse::Results& results)> | |
32 UpdateCheckCallback; | |
33 | 22 |
34 virtual ~UpdateChecker() {} | 23 // DeltaUpdateOpPatch::OutOfProcessPatcher implementation. |
35 | 24 virtual void Patch(const std::string& operation, |
36 // Initiates an update check for the |items_to_check|. |additional_attributes| | 25 scoped_refptr<base::SequencedTaskRunner> task_runner, |
37 // provides a way to customize the <request> element. This value is inserted | 26 base::FilePath& input_abs_path, |
38 // as-is, therefore it must be well-formed as an XML attribute string. | 27 base::FilePath& patch_abs_path, |
39 virtual bool CheckForUpdates( | 28 base::FilePath& output_abs_path, |
40 const std::vector<CrxUpdateItem*>& items_to_check, | 29 base::Callback<void(int result)> callback) OVERRIDE; |
41 const std::string& additional_attributes) = 0; | |
42 | |
43 static scoped_ptr<UpdateChecker> Create( | |
44 const Configurator& config, | |
45 const UpdateCheckCallback& update_check_callback); | |
46 | |
47 protected: | |
48 UpdateChecker() {} | |
49 | 30 |
50 private: | 31 private: |
51 DISALLOW_COPY_AND_ASSIGN(UpdateChecker); | 32 virtual ~ChromeOutOfProcessPatcher(); |
| 33 |
| 34 scoped_refptr<PatchHost> host_; |
| 35 |
| 36 DISALLOW_COPY_AND_ASSIGN(ChromeOutOfProcessPatcher); |
52 }; | 37 }; |
53 | 38 |
54 } // namespace component_updater | 39 } // namespace component_updater |
55 | 40 |
56 #endif // CHROME_BROWSER_COMPONENT_UPDATER_UPDATE_CHECKER_H_ | 41 #endif // CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_PATCHER_OPERATION_OUT_OF_P
ROCESS_H_ |
OLD | NEW |