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 #include "chrome/browser/component_updater/component_patcher_operation_out_of_pr
ocess.h" | 5 #include "chrome/browser/component_updater/component_patcher_operation_out_of_pr
ocess.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 | 89 |
90 void ChromeOutOfProcessPatcher::Patch( | 90 void ChromeOutOfProcessPatcher::Patch( |
91 const std::string& operation, | 91 const std::string& operation, |
92 scoped_refptr<base::SequencedTaskRunner> task_runner, | 92 scoped_refptr<base::SequencedTaskRunner> task_runner, |
93 const base::FilePath& input_abs_path, | 93 const base::FilePath& input_abs_path, |
94 const base::FilePath& patch_abs_path, | 94 const base::FilePath& patch_abs_path, |
95 const base::FilePath& output_abs_path, | 95 const base::FilePath& output_abs_path, |
96 base::Callback<void(int result)> callback) { | 96 base::Callback<void(int result)> callback) { |
97 host_ = new PatchHost(callback, task_runner); | 97 host_ = new PatchHost(callback, task_runner); |
98 scoped_ptr<IPC::Message> patch_message; | 98 scoped_ptr<IPC::Message> patch_message; |
99 if (operation == kBsdiff) { | 99 if (operation == update_client::kBsdiff) { |
100 patch_message.reset(new ChromeUtilityMsg_PatchFileBsdiff( | 100 patch_message.reset(new ChromeUtilityMsg_PatchFileBsdiff( |
101 input_abs_path, patch_abs_path, output_abs_path)); | 101 input_abs_path, patch_abs_path, output_abs_path)); |
102 } else if (operation == kCourgette) { | 102 } else if (operation == update_client::kCourgette) { |
103 patch_message.reset(new ChromeUtilityMsg_PatchFileCourgette( | 103 patch_message.reset(new ChromeUtilityMsg_PatchFileCourgette( |
104 input_abs_path, patch_abs_path, output_abs_path)); | 104 input_abs_path, patch_abs_path, output_abs_path)); |
105 } else { | 105 } else { |
106 NOTREACHED(); | 106 NOTREACHED(); |
107 } | 107 } |
108 | 108 |
109 content::BrowserThread::PostTask( | 109 content::BrowserThread::PostTask( |
110 content::BrowserThread::IO, | 110 content::BrowserThread::IO, |
111 FROM_HERE, | 111 FROM_HERE, |
112 base::Bind( | 112 base::Bind( |
113 &PatchHost::StartProcess, host_, base::Passed(&patch_message))); | 113 &PatchHost::StartProcess, host_, base::Passed(&patch_message))); |
114 } | 114 } |
115 | 115 |
116 } // namespace component_updater | 116 } // namespace component_updater |
OLD | NEW |