| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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.h" | 5 #include "chrome/browser/component_updater/component_patcher_operation.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 | 284 |
| 285 DeltaUpdateOpPatchHost::~DeltaUpdateOpPatchHost() { | 285 DeltaUpdateOpPatchHost::~DeltaUpdateOpPatchHost() { |
| 286 } | 286 } |
| 287 | 287 |
| 288 void DeltaUpdateOpPatchHost::StartProcess(scoped_ptr<IPC::Message> message) { | 288 void DeltaUpdateOpPatchHost::StartProcess(scoped_ptr<IPC::Message> message) { |
| 289 // The DeltaUpdateOpPatchHost is not responsible for deleting the | 289 // The DeltaUpdateOpPatchHost is not responsible for deleting the |
| 290 // UtilityProcessHost object. | 290 // UtilityProcessHost object. |
| 291 content::UtilityProcessHost* host = content::UtilityProcessHost::Create( | 291 content::UtilityProcessHost* host = content::UtilityProcessHost::Create( |
| 292 this, base::MessageLoopProxy::current().get()); | 292 this, base::MessageLoopProxy::current().get()); |
| 293 host->DisableSandbox(); | 293 host->DisableSandbox(); |
| 294 host->Send(message.get()); | 294 host->Send(message.release()); |
| 295 } | 295 } |
| 296 | 296 |
| 297 bool DeltaUpdateOpPatchHost::OnMessageReceived(const IPC::Message& message) { | 297 bool DeltaUpdateOpPatchHost::OnMessageReceived(const IPC::Message& message) { |
| 298 bool handled = true; | 298 bool handled = true; |
| 299 IPC_BEGIN_MESSAGE_MAP(DeltaUpdateOpPatchHost, message) | 299 IPC_BEGIN_MESSAGE_MAP(DeltaUpdateOpPatchHost, message) |
| 300 IPC_MESSAGE_HANDLER(ChromeUtilityHostMsg_PatchFile_Succeeded, | 300 IPC_MESSAGE_HANDLER(ChromeUtilityHostMsg_PatchFile_Succeeded, |
| 301 OnPatchSucceeded) | 301 OnPatchSucceeded) |
| 302 IPC_MESSAGE_HANDLER(ChromeUtilityHostMsg_PatchFile_Failed, | 302 IPC_MESSAGE_HANDLER(ChromeUtilityHostMsg_PatchFile_Failed, |
| 303 OnPatchFailed) | 303 OnPatchFailed) |
| 304 IPC_MESSAGE_UNHANDLED(handled = false) | 304 IPC_MESSAGE_UNHANDLED(handled = false) |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 if (error != ComponentUnpacker::kNone) { | 378 if (error != ComponentUnpacker::kNone) { |
| 379 error_code += strategy_->GetErrorOffset(); | 379 error_code += strategy_->GetErrorOffset(); |
| 380 } | 380 } |
| 381 callback_.Run(error, error_code); | 381 callback_.Run(error, error_code); |
| 382 // The callback is no longer needed - it is best to release it in case it | 382 // The callback is no longer needed - it is best to release it in case it |
| 383 // contains a reference to this object. | 383 // contains a reference to this object. |
| 384 callback_.Reset(); | 384 callback_.Reset(); |
| 385 } | 385 } |
| 386 | 386 |
| 387 } // namespace component_updater | 387 } // namespace component_updater |
| OLD | NEW |