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/utility/unpacker.h" | 5 #include "extensions/utility/unpacker.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <set> | 10 #include <set> |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 if (!extension_dir_.AppendRelativePath(message_path, &relative_path)) { | 311 if (!extension_dir_.AppendRelativePath(message_path, &relative_path)) { |
312 NOTREACHED(); | 312 NOTREACHED(); |
313 return false; | 313 return false; |
314 } | 314 } |
315 | 315 |
316 std::string dir_name = relative_path.DirName().MaybeAsASCII(); | 316 std::string dir_name = relative_path.DirName().MaybeAsASCII(); |
317 if (dir_name.empty()) { | 317 if (dir_name.empty()) { |
318 NOTREACHED(); | 318 NOTREACHED(); |
319 return false; | 319 return false; |
320 } | 320 } |
321 parsed_catalogs_->Set(dir_name, root.release()); | 321 parsed_catalogs_->Set(dir_name, std::move(root)); |
322 | 322 |
323 return true; | 323 return true; |
324 } | 324 } |
325 | 325 |
326 void Unpacker::SetError(const std::string& error) { | 326 void Unpacker::SetError(const std::string& error) { |
327 SetUTF16Error(base::UTF8ToUTF16(error)); | 327 SetUTF16Error(base::UTF8ToUTF16(error)); |
328 } | 328 } |
329 | 329 |
330 void Unpacker::SetUTF16Error(const base::string16& error) { | 330 void Unpacker::SetUTF16Error(const base::string16& error) { |
331 error_message_ = error; | 331 error_message_ = error; |
332 } | 332 } |
333 | 333 |
334 } // namespace extensions | 334 } // namespace extensions |
OLD | NEW |