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 "storage/browser/blob/view_blob_internals_job.h" | 5 #include "storage/browser/blob/view_blob_internals_job.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
10 #include "base/i18n/number_formatting.h" | 10 #include "base/i18n/number_formatting.h" |
11 #include "base/i18n/time_formatting.h" | 11 #include "base/i18n/time_formatting.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/message_loop/message_loop.h" | 13 #include "base/message_loop/message_loop.h" |
14 #include "base/strings/string_number_conversions.h" | 14 #include "base/strings/string_number_conversions.h" |
15 #include "base/strings/string_util.h" | 15 #include "base/strings/string_util.h" |
16 #include "base/strings/stringprintf.h" | 16 #include "base/strings/stringprintf.h" |
17 #include "base/strings/utf_string_conversions.h" | 17 #include "base/strings/utf_string_conversions.h" |
18 #include "net/base/escape.h" | 18 #include "net/base/escape.h" |
19 #include "net/base/net_errors.h" | 19 #include "net/base/net_errors.h" |
| 20 #include "net/disk_cache/disk_cache.h" |
20 #include "net/url_request/url_request.h" | 21 #include "net/url_request/url_request.h" |
21 #include "storage/browser/blob/blob_storage_context.h" | 22 #include "storage/browser/blob/blob_storage_context.h" |
22 #include "storage/browser/blob/internal_blob_data.h" | 23 #include "storage/browser/blob/internal_blob_data.h" |
23 | 24 |
24 namespace { | 25 namespace { |
25 | 26 |
26 const char kEmptyBlobStorageMessage[] = "No available blob data."; | 27 const char kEmptyBlobStorageMessage[] = "No available blob data."; |
27 const char kContentType[] = "Content Type: "; | 28 const char kContentType[] = "Content Type: "; |
28 const char kContentDisposition[] = "Content Disposition: "; | 29 const char kContentDisposition[] = "Content Disposition: "; |
29 const char kCount[] = "Count: "; | 30 const char kCount[] = "Count: "; |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 break; | 212 break; |
212 case DataElement::TYPE_FILE_FILESYSTEM: | 213 case DataElement::TYPE_FILE_FILESYSTEM: |
213 AddHTMLListItem(kType, "filesystem", out); | 214 AddHTMLListItem(kType, "filesystem", out); |
214 AddHTMLListItem(kURL, item.filesystem_url().spec(), out); | 215 AddHTMLListItem(kURL, item.filesystem_url().spec(), out); |
215 if (!item.expected_modification_time().is_null()) { | 216 if (!item.expected_modification_time().is_null()) { |
216 AddHTMLListItem(kModificationTime, base::UTF16ToUTF8( | 217 AddHTMLListItem(kModificationTime, base::UTF16ToUTF8( |
217 TimeFormatFriendlyDateAndTime(item.expected_modification_time())), | 218 TimeFormatFriendlyDateAndTime(item.expected_modification_time())), |
218 out); | 219 out); |
219 } | 220 } |
220 break; | 221 break; |
| 222 case DataElement::TYPE_DISK_CACHE_ENTRY: |
| 223 AddHTMLListItem(kType, "disk cache entry", out); |
| 224 AddHTMLListItem(kURL, item.disk_cache_entry()->GetKey(), out); |
| 225 break; |
221 case DataElement::TYPE_UNKNOWN: | 226 case DataElement::TYPE_UNKNOWN: |
222 NOTREACHED(); | 227 NOTREACHED(); |
223 break; | 228 break; |
224 } | 229 } |
225 if (item.offset()) { | 230 if (item.offset()) { |
226 AddHTMLListItem(kOffset, base::UTF16ToUTF8(base::FormatNumber( | 231 AddHTMLListItem(kOffset, base::UTF16ToUTF8(base::FormatNumber( |
227 static_cast<int64>(item.offset()))), out); | 232 static_cast<int64>(item.offset()))), out); |
228 } | 233 } |
229 if (static_cast<int64>(item.length()) != -1) { | 234 if (static_cast<int64>(item.length()) != -1) { |
230 AddHTMLListItem(kLength, base::UTF16ToUTF8(base::FormatNumber( | 235 AddHTMLListItem(kLength, base::UTF16ToUTF8(base::FormatNumber( |
231 static_cast<int64>(item.length()))), out); | 236 static_cast<int64>(item.length()))), out); |
232 } | 237 } |
233 | 238 |
234 if (has_multi_items) | 239 if (has_multi_items) |
235 EndHTMLList(out); | 240 EndHTMLList(out); |
236 } | 241 } |
237 | 242 |
238 EndHTMLList(out); | 243 EndHTMLList(out); |
239 } | 244 } |
240 | 245 |
241 } // namespace storage | 246 } // namespace storage |
OLD | NEW |