Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "extensions/browser/sandboxed_unpacker.h" | 5 #include "extensions/browser/sandboxed_unpacker.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/base64.h" | 9 #include "base/base64.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 205 if (!base::ReadFileToString(path, &file_str)) | 205 if (!base::ReadFileToString(path, &file_str)) |
| 206 return false; | 206 return false; |
| 207 | 207 |
| 208 IPC::Message pickle(file_str.data(), file_str.size()); | 208 IPC::Message pickle(file_str.data(), file_str.size()); |
| 209 PickleIterator iter(pickle); | 209 PickleIterator iter(pickle); |
| 210 return IPC::ReadParam(&pickle, &iter, catalogs); | 210 return IPC::ReadParam(&pickle, &iter, catalogs); |
| 211 } | 211 } |
| 212 | 212 |
| 213 } // namespace | 213 } // namespace |
| 214 | 214 |
| 215 SandboxedUnpackerClient::SandboxedUnpackerClient( | |
| 216 const scoped_refptr<base::MessageLoopProxy>& loop) | |
| 217 : RefCountedDeleteOnMessageLoop<SandboxedUnpackerClient>(loop) { | |
|
benwells
2015/04/14 22:14:19
Can you put BrowserThread::GetMessageLoopProxyForT
tapted
2015/04/15 03:07:44
Done. Turns out //extensions/browser is fine wrt D
| |
| 218 } | |
| 219 | |
| 215 SandboxedUnpacker::SandboxedUnpacker( | 220 SandboxedUnpacker::SandboxedUnpacker( |
| 216 const CRXFileInfo& file, | 221 const CRXFileInfo& file, |
| 217 Manifest::Location location, | 222 Manifest::Location location, |
| 218 int creation_flags, | 223 int creation_flags, |
| 219 const base::FilePath& extensions_dir, | 224 const base::FilePath& extensions_dir, |
| 220 const scoped_refptr<base::SequencedTaskRunner>& unpacker_io_task_runner, | 225 const scoped_refptr<base::SequencedTaskRunner>& unpacker_io_task_runner, |
| 221 SandboxedUnpackerClient* client) | 226 SandboxedUnpackerClient* client) |
| 222 : crx_path_(file.path), | 227 : crx_path_(file.path), |
| 223 package_hash_(base::StringToLowerASCII(file.expected_hash)), | 228 package_hash_(base::StringToLowerASCII(file.expected_hash)), |
| 224 check_crx_hash_(false), | 229 check_crx_hash_(false), |
| (...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 843 | 848 |
| 844 void SandboxedUnpacker::Cleanup() { | 849 void SandboxedUnpacker::Cleanup() { |
| 845 DCHECK(unpacker_io_task_runner_->RunsTasksOnCurrentThread()); | 850 DCHECK(unpacker_io_task_runner_->RunsTasksOnCurrentThread()); |
| 846 if (!temp_dir_.Delete()) { | 851 if (!temp_dir_.Delete()) { |
| 847 LOG(WARNING) << "Can not delete temp directory at " | 852 LOG(WARNING) << "Can not delete temp directory at " |
| 848 << temp_dir_.path().value(); | 853 << temp_dir_.path().value(); |
| 849 } | 854 } |
| 850 } | 855 } |
| 851 | 856 |
| 852 } // namespace extensions | 857 } // namespace extensions |
| OLD | NEW |