Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(53)

Side by Side Diff: webkit/browser/blob/view_blob_internals_job.cc

Issue 121123002: Update uses of UTF conversions in ppapi/, printing/, remoting/, rlz/, sandbox/, skia/, sql/, sync/,… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/browser/blob/view_blob_internals_job.h" 5 #include "webkit/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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 175
176 AddHTMLListItem(kRefcount, base::IntToString(refcount), out); 176 AddHTMLListItem(kRefcount, base::IntToString(refcount), out);
177 if (!blob_data.content_type().empty()) 177 if (!blob_data.content_type().empty())
178 AddHTMLListItem(kContentType, blob_data.content_type(), out); 178 AddHTMLListItem(kContentType, blob_data.content_type(), out);
179 if (!blob_data.content_disposition().empty()) 179 if (!blob_data.content_disposition().empty())
180 AddHTMLListItem(kContentDisposition, blob_data.content_disposition(), out); 180 AddHTMLListItem(kContentDisposition, blob_data.content_disposition(), out);
181 181
182 bool has_multi_items = blob_data.items().size() > 1; 182 bool has_multi_items = blob_data.items().size() > 1;
183 if (has_multi_items) { 183 if (has_multi_items) {
184 AddHTMLListItem(kCount, 184 AddHTMLListItem(kCount,
185 UTF16ToUTF8(base::FormatNumber(blob_data.items().size())), out); 185 base::UTF16ToUTF8(base::FormatNumber(blob_data.items().size())), out);
186 } 186 }
187 187
188 for (size_t i = 0; i < blob_data.items().size(); ++i) { 188 for (size_t i = 0; i < blob_data.items().size(); ++i) {
189 if (has_multi_items) { 189 if (has_multi_items) {
190 AddHTMLListItem(kIndex, UTF16ToUTF8(base::FormatNumber(i)), out); 190 AddHTMLListItem(kIndex, base::UTF16ToUTF8(base::FormatNumber(i)), out);
191 StartHTMLList(out); 191 StartHTMLList(out);
192 } 192 }
193 const BlobData::Item& item = blob_data.items().at(i); 193 const BlobData::Item& item = blob_data.items().at(i);
194 194
195 switch (item.type()) { 195 switch (item.type()) {
196 case BlobData::Item::TYPE_BYTES: 196 case BlobData::Item::TYPE_BYTES:
197 AddHTMLListItem(kType, "data", out); 197 AddHTMLListItem(kType, "data", out);
198 break; 198 break;
199 case BlobData::Item::TYPE_FILE: 199 case BlobData::Item::TYPE_FILE:
200 AddHTMLListItem(kType, "file", out); 200 AddHTMLListItem(kType, "file", out);
201 AddHTMLListItem(kPath, 201 AddHTMLListItem(kPath,
202 net::EscapeForHTML(item.path().AsUTF8Unsafe()), 202 net::EscapeForHTML(item.path().AsUTF8Unsafe()),
203 out); 203 out);
204 if (!item.expected_modification_time().is_null()) { 204 if (!item.expected_modification_time().is_null()) {
205 AddHTMLListItem(kModificationTime, UTF16ToUTF8( 205 AddHTMLListItem(kModificationTime, base::UTF16ToUTF8(
206 TimeFormatFriendlyDateAndTime(item.expected_modification_time())), 206 TimeFormatFriendlyDateAndTime(item.expected_modification_time())),
207 out); 207 out);
208 } 208 }
209 break; 209 break;
210 case BlobData::Item::TYPE_BLOB: 210 case BlobData::Item::TYPE_BLOB:
211 NOTREACHED(); // Should be flattened in the storage context. 211 NOTREACHED(); // Should be flattened in the storage context.
212 break; 212 break;
213 case BlobData::Item::TYPE_FILE_FILESYSTEM: 213 case BlobData::Item::TYPE_FILE_FILESYSTEM:
214 AddHTMLListItem(kType, "filesystem", out); 214 AddHTMLListItem(kType, "filesystem", out);
215 AddHTMLListItem(kURL, item.filesystem_url().spec(), out); 215 AddHTMLListItem(kURL, item.filesystem_url().spec(), out);
216 if (!item.expected_modification_time().is_null()) { 216 if (!item.expected_modification_time().is_null()) {
217 AddHTMLListItem(kModificationTime, UTF16ToUTF8( 217 AddHTMLListItem(kModificationTime, base::UTF16ToUTF8(
218 TimeFormatFriendlyDateAndTime(item.expected_modification_time())), 218 TimeFormatFriendlyDateAndTime(item.expected_modification_time())),
219 out); 219 out);
220 } 220 }
221 break; 221 break;
222 case BlobData::Item::TYPE_UNKNOWN: 222 case BlobData::Item::TYPE_UNKNOWN:
223 NOTREACHED(); 223 NOTREACHED();
224 break; 224 break;
225 } 225 }
226 if (item.offset()) { 226 if (item.offset()) {
227 AddHTMLListItem(kOffset, UTF16ToUTF8(base::FormatNumber( 227 AddHTMLListItem(kOffset, base::UTF16ToUTF8(base::FormatNumber(
228 static_cast<int64>(item.offset()))), out); 228 static_cast<int64>(item.offset()))), out);
229 } 229 }
230 if (static_cast<int64>(item.length()) != -1) { 230 if (static_cast<int64>(item.length()) != -1) {
231 AddHTMLListItem(kLength, UTF16ToUTF8(base::FormatNumber( 231 AddHTMLListItem(kLength, base::UTF16ToUTF8(base::FormatNumber(
232 static_cast<int64>(item.length()))), out); 232 static_cast<int64>(item.length()))), out);
233 } 233 }
234 234
235 if (has_multi_items) 235 if (has_multi_items)
236 EndHTMLList(out); 236 EndHTMLList(out);
237 } 237 }
238 238
239 EndHTMLList(out); 239 EndHTMLList(out);
240 } 240 }
241 241
242 } // namespace webkit_blob 242 } // namespace webkit_blob
OLDNEW
« no previous file with comments | « webkit/browser/appcache/view_appcache_internals_job.cc ('k') | webkit/browser/database/database_quota_client_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698