| 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" |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 AddHTMLListItem(kType, "file", out); | 199 AddHTMLListItem(kType, "file", out); |
| 200 AddHTMLListItem(kPath, | 200 AddHTMLListItem(kPath, |
| 201 net::EscapeForHTML(item.path().AsUTF8Unsafe()), | 201 net::EscapeForHTML(item.path().AsUTF8Unsafe()), |
| 202 out); | 202 out); |
| 203 if (!item.expected_modification_time().is_null()) { | 203 if (!item.expected_modification_time().is_null()) { |
| 204 AddHTMLListItem(kModificationTime, base::UTF16ToUTF8( | 204 AddHTMLListItem(kModificationTime, base::UTF16ToUTF8( |
| 205 TimeFormatFriendlyDateAndTime(item.expected_modification_time())), | 205 TimeFormatFriendlyDateAndTime(item.expected_modification_time())), |
| 206 out); | 206 out); |
| 207 } | 207 } |
| 208 break; | 208 break; |
| 209 case DataElement::TYPE_BLOB: | |
| 210 NOTREACHED(); // Should be flattened in the storage context. | |
| 211 break; | |
| 212 case DataElement::TYPE_FILE_FILESYSTEM: | 209 case DataElement::TYPE_FILE_FILESYSTEM: |
| 213 AddHTMLListItem(kType, "filesystem", out); | 210 AddHTMLListItem(kType, "filesystem", out); |
| 214 AddHTMLListItem(kURL, item.filesystem_url().spec(), out); | 211 AddHTMLListItem(kURL, item.filesystem_url().spec(), out); |
| 215 if (!item.expected_modification_time().is_null()) { | 212 if (!item.expected_modification_time().is_null()) { |
| 216 AddHTMLListItem(kModificationTime, base::UTF16ToUTF8( | 213 AddHTMLListItem(kModificationTime, base::UTF16ToUTF8( |
| 217 TimeFormatFriendlyDateAndTime(item.expected_modification_time())), | 214 TimeFormatFriendlyDateAndTime(item.expected_modification_time())), |
| 218 out); | 215 out); |
| 219 } | 216 } |
| 220 break; | 217 break; |
| 218 case DataElement::TYPE_BLOB: // Should be flattened in the storage contex
t. |
| 219 case DataElement::TYPE_DISK_CACHE_ENTRY: // XYZZY wot to do here yo? |
| 221 case DataElement::TYPE_UNKNOWN: | 220 case DataElement::TYPE_UNKNOWN: |
| 222 NOTREACHED(); | 221 NOTREACHED(); |
| 223 break; | 222 break; |
| 224 } | 223 } |
| 225 if (item.offset()) { | 224 if (item.offset()) { |
| 226 AddHTMLListItem(kOffset, base::UTF16ToUTF8(base::FormatNumber( | 225 AddHTMLListItem(kOffset, base::UTF16ToUTF8(base::FormatNumber( |
| 227 static_cast<int64>(item.offset()))), out); | 226 static_cast<int64>(item.offset()))), out); |
| 228 } | 227 } |
| 229 if (static_cast<int64>(item.length()) != -1) { | 228 if (static_cast<int64>(item.length()) != -1) { |
| 230 AddHTMLListItem(kLength, base::UTF16ToUTF8(base::FormatNumber( | 229 AddHTMLListItem(kLength, base::UTF16ToUTF8(base::FormatNumber( |
| 231 static_cast<int64>(item.length()))), out); | 230 static_cast<int64>(item.length()))), out); |
| 232 } | 231 } |
| 233 | 232 |
| 234 if (has_multi_items) | 233 if (has_multi_items) |
| 235 EndHTMLList(out); | 234 EndHTMLList(out); |
| 236 } | 235 } |
| 237 | 236 |
| 238 EndHTMLList(out); | 237 EndHTMLList(out); |
| 239 } | 238 } |
| 240 | 239 |
| 241 } // namespace storage | 240 } // namespace storage |
| OLD | NEW |