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 "ui/base/resource/data_pack.h" | 5 #include "ui/base/resource/data_pack.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 | 8 |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/files/memory_mapped_file.h" | 10 #include "base/files/memory_mapped_file.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/memory/ref_counted_memory.h" | 12 #include "base/memory/ref_counted_memory.h" |
13 #include "base/metrics/histogram.h" | 13 #include "base/metrics/histogram.h" |
14 #include "base/string_piece.h" | 14 #include "base/strings/string_piece.h" |
15 | 15 |
16 // For details of the file layout, see | 16 // For details of the file layout, see |
17 // http://dev.chromium.org/developers/design-documents/linuxresourcesandlocalize
dstrings | 17 // http://dev.chromium.org/developers/design-documents/linuxresourcesandlocalize
dstrings |
18 | 18 |
19 namespace { | 19 namespace { |
20 | 20 |
21 static const uint32 kFileFormatVersion = 4; | 21 static const uint32 kFileFormatVersion = 4; |
22 // Length of file header: version, entry count and text encoding type. | 22 // Length of file header: version, entry count and text encoding type. |
23 static const size_t kHeaderLength = 2 * sizeof(uint32) + sizeof(uint8); | 23 static const size_t kHeaderLength = 2 * sizeof(uint32) + sizeof(uint8); |
24 | 24 |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 return false; | 297 return false; |
298 } | 298 } |
299 } | 299 } |
300 | 300 |
301 file_util::CloseFile(file); | 301 file_util::CloseFile(file); |
302 | 302 |
303 return true; | 303 return true; |
304 } | 304 } |
305 | 305 |
306 } // namespace ui | 306 } // namespace ui |
OLD | NEW |