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

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

Issue 1108083002: Create blobs from Disk Cache entries. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased to upstream CL, review this upload Created 5 years, 6 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
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 "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
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_DISK_CACHE_ENTRY:
219 AddHTMLListItem(kType, "disk cache entry", out);
220 AddHTMLListItem(kURL, item.disk_cache_entry()->GetKey(), out);
221 break;
jkarlin 2015/05/29 14:59:42 Please add NOTREACHED(); to this and TYPE_BLOB
gavinp 2015/05/29 18:06:07 Done.
222 case DataElement::TYPE_BLOB:
223 // Should be flattened in the storage context.
221 case DataElement::TYPE_UNKNOWN: 224 case DataElement::TYPE_UNKNOWN:
222 NOTREACHED(); 225 NOTREACHED();
223 break; 226 break;
224 } 227 }
225 if (item.GetOffset()) { 228 if (item.GetOffset()) {
226 AddHTMLListItem(kOffset, base::UTF16ToUTF8(base::FormatNumber( 229 AddHTMLListItem(kOffset, base::UTF16ToUTF8(base::FormatNumber(
227 static_cast<int64>(item.GetOffset()))), out); 230 static_cast<int64>(item.GetOffset()))), out);
228 } 231 }
229 if (static_cast<int64>(item.GetLength()) != -1) { 232 if (static_cast<int64>(item.GetLength()) != -1) {
230 AddHTMLListItem(kLength, base::UTF16ToUTF8(base::FormatNumber( 233 AddHTMLListItem(kLength, base::UTF16ToUTF8(base::FormatNumber(
231 static_cast<int64>(item.GetLength()))), out); 234 static_cast<int64>(item.GetLength()))), out);
232 } 235 }
233 236
234 if (has_multi_items) 237 if (has_multi_items)
235 EndHTMLList(out); 238 EndHTMLList(out);
236 } 239 }
237 240
238 EndHTMLList(out); 241 EndHTMLList(out);
239 } 242 }
240 243
241 } // namespace storage 244 } // namespace storage
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698