| 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 <stddef.h> | 5 #include <stddef.h> | 
| 6 | 6 | 
| 7 #include "ui/base/resource/data_pack_literal.h" |  | 
| 8 |  | 
| 9 namespace ui { | 7 namespace ui { | 
| 10 | 8 | 
| 11 const char kSamplePakContentsV4[] = { | 9 extern const char kSamplePakContents[] = { | 
| 12     0x04, 0x00, 0x00, 0x00,              // header(version | 10     0x04, 0x00, 0x00, 0x00,               // header(version | 
| 13     0x04, 0x00, 0x00, 0x00,              //        no. entries | 11     0x04, 0x00, 0x00, 0x00,               //        no. entries | 
| 14     0x01,                                //        encoding) | 12     0x01,                                 //        encoding) | 
| 15     0x01, 0x00, 0x27, 0x00, 0x00, 0x00,  // index entry 1 | 13     0x01, 0x00, 0x27, 0x00, 0x00, 0x00,   // index entry 1 | 
| 16     0x04, 0x00, 0x27, 0x00, 0x00, 0x00,  // index entry 4 | 14     0x04, 0x00, 0x27, 0x00, 0x00, 0x00,   // index entry 4 | 
| 17     0x06, 0x00, 0x33, 0x00, 0x00, 0x00,  // index entry 6 | 15     0x06, 0x00, 0x33, 0x00, 0x00, 0x00,   // index entry 6 | 
| 18     0x0a, 0x00, 0x3f, 0x00, 0x00, 0x00,  // index entry 10 | 16     0x0a, 0x00, 0x3f, 0x00, 0x00, 0x00,   // index entry 10 | 
| 19     0x00, 0x00, 0x3f, 0x00, 0x00, 0x00,  // extra entry for the size of last | 17     0x00, 0x00, 0x3f, 0x00, 0x00, 0x00,   // extra entry for the size of last | 
| 20     't',  'h',  'i',  's',  ' ',  'i',  's', ' ', 'i', 'd', ' ', '4', | 18     't', 'h', 'i', 's', ' ', 'i', 's', ' ', 'i', 'd', ' ', '4', | 
| 21     't',  'h',  'i',  's',  ' ',  'i',  's', ' ', 'i', 'd', ' ', '6'}; | 19     't', 'h', 'i', 's', ' ', 'i', 's', ' ', 'i', 'd', ' ', '6' | 
| 22 |  | 
| 23 const size_t kSamplePakSizeV4 = sizeof(kSamplePakContentsV4); |  | 
| 24 |  | 
| 25 const char kSamplePakContentsV5[] = { |  | 
| 26     0x05, 0x00, 0x00, 0x00,              // version |  | 
| 27     0x01, 0x00, 0x00, 0x00,              // encoding + padding |  | 
| 28     0x03, 0x00, 0x01, 0x00,              // num_resources, num_aliases |  | 
| 29     0x01, 0x00, 0x28, 0x00, 0x00, 0x00,  // index entry 1 |  | 
| 30     0x04, 0x00, 0x28, 0x00, 0x00, 0x00,  // index entry 4 |  | 
| 31     0x06, 0x00, 0x34, 0x00, 0x00, 0x00,  // index entry 6 |  | 
| 32     0x00, 0x00, 0x40, 0x00, 0x00, 0x00,  // extra entry for the size of last |  | 
| 33     0x0a, 0x00, 0x01, 0x00,              // alias table |  | 
| 34     't',  'h',  'i',  's',  ' ',  'i',  's', ' ', 'i', 'd', ' ', '4', |  | 
| 35     't',  'h',  'i',  's',  ' ',  'i',  's', ' ', 'i', 'd', ' ', '6'}; |  | 
| 36 |  | 
| 37 const size_t kSamplePakSizeV5 = sizeof(kSamplePakContentsV5); |  | 
| 38 |  | 
| 39 const char kSampleCorruptPakContents[] = { |  | 
| 40     0x04, 0x00, 0x00, 0x00,              // header(version |  | 
| 41     0x04, 0x00, 0x00, 0x00,              //        no. entries |  | 
| 42     0x01,                                //        encoding) |  | 
| 43     0x01, 0x00, 0x27, 0x00, 0x00, 0x00,  // index entry 1 |  | 
| 44     0x04, 0x00, 0x27, 0x00, 0x00, 0x00,  // index entry 4 |  | 
| 45     0x06, 0x00, 0x33, 0x00, 0x00, 0x00,  // index entry 6 |  | 
| 46     0x0a, 0x00, 0x3f, 0x00, 0x00, 0x00,  // index entry 10 |  | 
| 47     0x00, 0x00, 0x40, 0x00, 0x00, 0x00,  // extra entry for the size of last, |  | 
| 48                                          // extends past END OF FILE. |  | 
| 49     't', 'h', 'i', 's', ' ', 'i', 's', ' ', 'i', 'd', ' ', '4', 't', 'h', 'i', |  | 
| 50     's', ' ', 'i', 's', ' ', 'i', 'd', ' ', '6'}; |  | 
| 51 |  | 
| 52 const size_t kSampleCorruptPakSize = sizeof(kSampleCorruptPakContents); |  | 
| 53 |  | 
| 54 const char kSamplePakContents2x[] = { |  | 
| 55     0x04, 0x00, 0x00, 0x00,              // header(version |  | 
| 56     0x01, 0x00, 0x00, 0x00,              //        no. entries |  | 
| 57     0x01,                                //        encoding) |  | 
| 58     0x04, 0x00, 0x15, 0x00, 0x00, 0x00,  // index entry 4 |  | 
| 59     0x00, 0x00, 0x24, 0x00, 0x00, 0x00,  // extra entry for the size of last |  | 
| 60     't',  'h',  'i',  's',  ' ',  'i',  's', ' ', |  | 
| 61     'i',  'd',  ' ',  '4',  ' ',  '2',  'x'}; |  | 
| 62 |  | 
| 63 const size_t kSamplePakSize2x = sizeof(kSamplePakContents2x); |  | 
| 64 |  | 
| 65 const char kEmptyPakContents[] = { |  | 
| 66     0x04, 0x00, 0x00, 0x00,             // header(version |  | 
| 67     0x00, 0x00, 0x00, 0x00,             //        no. entries |  | 
| 68     0x01,                               //        encoding) |  | 
| 69     0x00, 0x00, 0x0f, 0x00, 0x00, 0x00  // extra entry for the size of last |  | 
| 70 }; | 20 }; | 
| 71 | 21 | 
| 72 const size_t kEmptyPakSize = sizeof(kEmptyPakContents); | 22 extern const size_t kSamplePakSize = sizeof(kSamplePakContents); | 
|  | 23 | 
|  | 24 extern const char kSampleCorruptPakContents[] = { | 
|  | 25     0x04, 0x00, 0x00, 0x00,               // header(version | 
|  | 26     0x04, 0x00, 0x00, 0x00,               //        no. entries | 
|  | 27     0x01,                                 //        encoding) | 
|  | 28     0x01, 0x00, 0x27, 0x00, 0x00, 0x00,   // index entry 1 | 
|  | 29     0x04, 0x00, 0x27, 0x00, 0x00, 0x00,   // index entry 4 | 
|  | 30     0x06, 0x00, 0x33, 0x00, 0x00, 0x00,   // index entry 6 | 
|  | 31     0x0a, 0x00, 0x3f, 0x00, 0x00, 0x00,   // index entry 10 | 
|  | 32     0x00, 0x00, 0x40, 0x00, 0x00, 0x00,   // extra entry for the size of last, | 
|  | 33                                           // extends past END OF FILE. | 
|  | 34     't', 'h', 'i', 's', ' ', 'i', 's', ' ', 'i', 'd', ' ', '4', | 
|  | 35     't', 'h', 'i', 's', ' ', 'i', 's', ' ', 'i', 'd', ' ', '6' | 
|  | 36 }; | 
|  | 37 | 
|  | 38 extern const size_t kSampleCorruptPakSize = sizeof(kSampleCorruptPakContents); | 
|  | 39 | 
|  | 40 extern const char kSamplePakContents2x[] = { | 
|  | 41     0x04, 0x00, 0x00, 0x00,               // header(version | 
|  | 42     0x01, 0x00, 0x00, 0x00,               //        no. entries | 
|  | 43     0x01,                                 //        encoding) | 
|  | 44     0x04, 0x00, 0x15, 0x00, 0x00, 0x00,   // index entry 4 | 
|  | 45     0x00, 0x00, 0x24, 0x00, 0x00, 0x00,   // extra entry for the size of last | 
|  | 46     't', 'h', 'i', 's', ' ', 'i', 's', ' ', 'i', 'd', ' ', '4', ' ', '2', 'x' | 
|  | 47 }; | 
|  | 48 | 
|  | 49 extern const size_t kSamplePakSize2x = sizeof(kSamplePakContents2x); | 
|  | 50 | 
|  | 51 extern const char kEmptyPakContents[] = { | 
|  | 52     0x04, 0x00, 0x00, 0x00,               // header(version | 
|  | 53     0x00, 0x00, 0x00, 0x00,               //        no. entries | 
|  | 54     0x01,                                 //        encoding) | 
|  | 55     0x00, 0x00, 0x0f, 0x00, 0x00, 0x00    // extra entry for the size of last | 
|  | 56 }; | 
|  | 57 | 
|  | 58 extern const size_t kEmptyPakSize = sizeof(kEmptyPakContents); | 
| 73 | 59 | 
| 74 }  // namespace ui | 60 }  // namespace ui | 
| OLD | NEW | 
|---|