OLD | NEW |
1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2008 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 // Performs basic inspection of the disk cache files with minimal disruption | 5 // Performs basic inspection of the disk cache files with minimal disruption |
6 // to the actual files (they still may change if an error is detected on the | 6 // to the actual files (they still may change if an error is detected on the |
7 // files). | 7 // files). |
8 | 8 |
9 #include <stdio.h> | 9 #include <stdio.h> |
10 #include <string> | 10 #include <string> |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 printf("data addr %d: 0x%x\n", i, entry.data_addr[i]); | 236 printf("data addr %d: 0x%x\n", i, entry.data_addr[i]); |
237 } | 237 } |
238 printf("----------\n\n"); | 238 printf("----------\n\n"); |
239 } | 239 } |
240 | 240 |
241 void DumpRankings(const disk_cache::RankingsNode& rankings) { | 241 void DumpRankings(const disk_cache::RankingsNode& rankings) { |
242 printf("next: 0x%x\n", rankings.next); | 242 printf("next: 0x%x\n", rankings.next); |
243 printf("prev: 0x%x\n", rankings.prev); | 243 printf("prev: 0x%x\n", rankings.prev); |
244 printf("entry: 0x%x\n", rankings.contents); | 244 printf("entry: 0x%x\n", rankings.contents); |
245 printf("dirty: %d\n", rankings.dirty); | 245 printf("dirty: %d\n", rankings.dirty); |
246 printf("pointer: 0x%x\n", rankings.pointer); | 246 printf("pointer: 0x%x\n", rankings.dummy); |
247 printf("----------\n\n"); | 247 printf("----------\n\n"); |
248 } | 248 } |
249 | 249 |
250 } // namespace. | 250 } // namespace. |
251 | 251 |
252 // ----------------------------------------------------------------------- | 252 // ----------------------------------------------------------------------- |
253 | 253 |
254 int GetMajorVersion(const std::wstring& input_path) { | 254 int GetMajorVersion(const std::wstring& input_path) { |
255 std::wstring index_name(input_path); | 255 std::wstring index_name(input_path); |
256 file_util::AppendToPath(&index_name, kIndexName); | 256 file_util::AppendToPath(&index_name, kIndexName); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 DumpEntry(entry); | 305 DumpEntry(entry); |
306 disk_cache::RankingsNode rankings; | 306 disk_cache::RankingsNode rankings; |
307 if (dumper.LoadRankings(entry.rankings_node, &rankings)) | 307 if (dumper.LoadRankings(entry.rankings_node, &rankings)) |
308 DumpRankings(rankings); | 308 DumpRankings(rankings); |
309 } | 309 } |
310 | 310 |
311 printf("Done.\n"); | 311 printf("Done.\n"); |
312 | 312 |
313 return 0; | 313 return 0; |
314 } | 314 } |
OLD | NEW |