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" |
11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
| 12 #include "base/location.h" |
| 13 #include "base/single_thread_task_runner.h" |
| 14 #include "base/thread_task_runner_handle.h" |
12 #include "chrome/common/chrome_utility_messages.h" | 15 #include "chrome/common/chrome_utility_messages.h" |
13 #include "chrome/grit/generated_resources.h" | 16 #include "chrome/grit/generated_resources.h" |
14 #include "components/component_updater/component_updater_service.h" | 17 #include "components/component_updater/component_updater_service.h" |
15 #include "content/public/browser/browser_thread.h" | 18 #include "content/public/browser/browser_thread.h" |
16 #include "content/public/browser/utility_process_host.h" | 19 #include "content/public/browser/utility_process_host.h" |
17 #include "content/public/browser/utility_process_host_client.h" | 20 #include "content/public/browser/utility_process_host_client.h" |
18 #include "courgette/courgette.h" | 21 #include "courgette/courgette.h" |
19 #include "courgette/third_party/bsdiff.h" | 22 #include "courgette/third_party/bsdiff.h" |
20 #include "ipc/ipc_message_macros.h" | 23 #include "ipc/ipc_message_macros.h" |
21 #include "ui/base/l10n/l10n_util.h" | 24 #include "ui/base/l10n/l10n_util.h" |
(...skipping 26 matching lines...) Expand all Loading... |
48 : callback_(callback), task_runner_(task_runner) { | 51 : callback_(callback), task_runner_(task_runner) { |
49 } | 52 } |
50 | 53 |
51 PatchHost::~PatchHost() { | 54 PatchHost::~PatchHost() { |
52 } | 55 } |
53 | 56 |
54 void PatchHost::StartProcess(scoped_ptr<IPC::Message> message) { | 57 void PatchHost::StartProcess(scoped_ptr<IPC::Message> message) { |
55 // The DeltaUpdateOpPatchHost is not responsible for deleting the | 58 // The DeltaUpdateOpPatchHost is not responsible for deleting the |
56 // UtilityProcessHost object. | 59 // UtilityProcessHost object. |
57 content::UtilityProcessHost* host = content::UtilityProcessHost::Create( | 60 content::UtilityProcessHost* host = content::UtilityProcessHost::Create( |
58 this, base::MessageLoopProxy::current().get()); | 61 this, base::ThreadTaskRunnerHandle::Get().get()); |
59 host->SetName(l10n_util::GetStringUTF16( | 62 host->SetName(l10n_util::GetStringUTF16( |
60 IDS_UTILITY_PROCESS_COMPONENT_PATCHER_NAME)); | 63 IDS_UTILITY_PROCESS_COMPONENT_PATCHER_NAME)); |
61 host->DisableSandbox(); | 64 host->DisableSandbox(); |
62 host->Send(message.release()); | 65 host->Send(message.release()); |
63 } | 66 } |
64 | 67 |
65 bool PatchHost::OnMessageReceived(const IPC::Message& message) { | 68 bool PatchHost::OnMessageReceived(const IPC::Message& message) { |
66 bool handled = true; | 69 bool handled = true; |
67 IPC_BEGIN_MESSAGE_MAP(PatchHost, message) | 70 IPC_BEGIN_MESSAGE_MAP(PatchHost, message) |
68 IPC_MESSAGE_HANDLER(ChromeUtilityHostMsg_PatchFile_Finished, OnPatchFinished) | 71 IPC_MESSAGE_HANDLER(ChromeUtilityHostMsg_PatchFile_Finished, OnPatchFinished) |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 } | 114 } |
112 | 115 |
113 content::BrowserThread::PostTask( | 116 content::BrowserThread::PostTask( |
114 content::BrowserThread::IO, | 117 content::BrowserThread::IO, |
115 FROM_HERE, | 118 FROM_HERE, |
116 base::Bind( | 119 base::Bind( |
117 &PatchHost::StartProcess, host_, base::Passed(&patch_message))); | 120 &PatchHost::StartProcess, host_, base::Passed(&patch_message))); |
118 } | 121 } |
119 | 122 |
120 } // namespace component_updater | 123 } // namespace component_updater |
OLD | NEW |