| 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 "webkit/blob/view_blob_internals_job.h" | 5 #include "webkit/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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 UTF16ToUTF8(base::FormatNumber(blob_data.items().size())), out); | 187 UTF16ToUTF8(base::FormatNumber(blob_data.items().size())), out); |
| 188 } | 188 } |
| 189 | 189 |
| 190 for (size_t i = 0; i < blob_data.items().size(); ++i) { | 190 for (size_t i = 0; i < blob_data.items().size(); ++i) { |
| 191 if (has_multi_items) { | 191 if (has_multi_items) { |
| 192 AddHTMLListItem(kIndex, UTF16ToUTF8(base::FormatNumber(i)), out); | 192 AddHTMLListItem(kIndex, UTF16ToUTF8(base::FormatNumber(i)), out); |
| 193 StartHTMLList(out); | 193 StartHTMLList(out); |
| 194 } | 194 } |
| 195 const BlobData::Item& item = blob_data.items().at(i); | 195 const BlobData::Item& item = blob_data.items().at(i); |
| 196 | 196 |
| 197 switch (item.type) { | 197 switch (item.type()) { |
| 198 case BlobData::TYPE_DATA: | 198 case BlobData::Item::TYPE_BYTES: |
| 199 case BlobData::TYPE_DATA_EXTERNAL: | |
| 200 AddHTMLListItem(kType, "data", out); | 199 AddHTMLListItem(kType, "data", out); |
| 201 break; | 200 break; |
| 202 case BlobData::TYPE_FILE: | 201 case BlobData::Item::TYPE_FILE: |
| 203 AddHTMLListItem(kType, "file", out); | 202 AddHTMLListItem(kType, "file", out); |
| 204 AddHTMLListItem(kPath, | 203 AddHTMLListItem(kPath, |
| 205 #if defined(OS_WIN) | 204 net::EscapeForHTML(item.path().AsUTF8Unsafe()), |
| 206 net::EscapeForHTML(WideToUTF8(item.file_path.value())), | |
| 207 #else | |
| 208 net::EscapeForHTML(item.file_path.value()), | |
| 209 #endif | |
| 210 out); | 205 out); |
| 211 if (!item.expected_modification_time.is_null()) { | 206 if (!item.expected_modification_time().is_null()) { |
| 212 AddHTMLListItem(kModificationTime, UTF16ToUTF8( | 207 AddHTMLListItem(kModificationTime, UTF16ToUTF8( |
| 213 TimeFormatFriendlyDateAndTime(item.expected_modification_time)), | 208 TimeFormatFriendlyDateAndTime(item.expected_modification_time())), |
| 214 out); | 209 out); |
| 215 } | 210 } |
| 216 break; | 211 break; |
| 217 case BlobData::TYPE_BLOB: | 212 case BlobData::Item::TYPE_BLOB: |
| 218 AddHTMLListItem(kType, "blob", out); | 213 AddHTMLListItem(kType, "blob", out); |
| 219 AddHTMLListItem(kURL, item.blob_url.spec(), out); | 214 AddHTMLListItem(kURL, item.url().spec(), out); |
| 215 break; |
| 216 case BlobData::Item::TYPE_UNKNOWN: |
| 217 NOTREACHED(); |
| 220 break; | 218 break; |
| 221 } | 219 } |
| 222 if (item.offset) { | 220 if (item.offset()) { |
| 223 AddHTMLListItem(kOffset, UTF16ToUTF8(base::FormatNumber( | 221 AddHTMLListItem(kOffset, UTF16ToUTF8(base::FormatNumber( |
| 224 static_cast<int64>(item.offset))), out); | 222 static_cast<int64>(item.offset()))), out); |
| 225 } | 223 } |
| 226 if (static_cast<int64>(item.length) != -1) { | 224 if (static_cast<int64>(item.length()) != -1) { |
| 227 AddHTMLListItem(kLength, UTF16ToUTF8(base::FormatNumber( | 225 AddHTMLListItem(kLength, UTF16ToUTF8(base::FormatNumber( |
| 228 static_cast<int64>(item.length))), out); | 226 static_cast<int64>(item.length()))), out); |
| 229 } | 227 } |
| 230 | 228 |
| 231 if (has_multi_items) | 229 if (has_multi_items) |
| 232 EndHTMLList(out); | 230 EndHTMLList(out); |
| 233 } | 231 } |
| 234 | 232 |
| 235 EndHTMLList(out); | 233 EndHTMLList(out); |
| 236 } | 234 } |
| 237 | 235 |
| 238 } // namespace webkit_blob | 236 } // namespace webkit_blob |
| OLD | NEW |