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

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

Issue 2055053003: [BlobAsync] Disk support for blob storage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Finished comments, added new pending enum state Created 4 years, 5 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 <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 10 matching lines...) Expand all
21 #include "base/strings/utf_string_conversions.h" 21 #include "base/strings/utf_string_conversions.h"
22 #include "base/threading/thread_task_runner_handle.h" 22 #include "base/threading/thread_task_runner_handle.h"
23 #include "net/base/escape.h" 23 #include "net/base/escape.h"
24 #include "net/base/net_errors.h" 24 #include "net/base/net_errors.h"
25 #include "net/disk_cache/disk_cache.h" 25 #include "net/disk_cache/disk_cache.h"
26 #include "net/url_request/url_request.h" 26 #include "net/url_request/url_request.h"
27 #include "storage/browser/blob/blob_data_item.h" 27 #include "storage/browser/blob/blob_data_item.h"
28 #include "storage/browser/blob/blob_storage_context.h" 28 #include "storage/browser/blob/blob_storage_context.h"
29 #include "storage/browser/blob/blob_storage_registry.h" 29 #include "storage/browser/blob/blob_storage_registry.h"
30 #include "storage/browser/blob/internal_blob_data.h" 30 #include "storage/browser/blob/internal_blob_data.h"
31 #include "storage/browser/blob/shareable_blob_data_item.h"
31 32
32 namespace { 33 namespace {
33 34
34 const char kEmptyBlobStorageMessage[] = "No available blob data."; 35 const char kEmptyBlobStorageMessage[] = "No available blob data.";
35 const char kContentType[] = "Content Type: "; 36 const char kContentType[] = "Content Type: ";
36 const char kContentDisposition[] = "Content Disposition: "; 37 const char kContentDisposition[] = "Content Disposition: ";
37 const char kCount[] = "Count: "; 38 const char kCount[] = "Count: ";
38 const char kIndex[] = "Index: "; 39 const char kIndex[] = "Index: ";
39 const char kType[] = "Type: "; 40 const char kType[] = "Type: ";
40 const char kPath[] = "Path: "; 41 const char kPath[] = "Path: ";
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 GenerateHTML(data); 150 GenerateHTML(data);
150 EndHTML(data); 151 EndHTML(data);
151 return net::OK; 152 return net::OK;
152 } 153 }
153 154
154 void ViewBlobInternalsJob::GenerateHTML(std::string* out) const { 155 void ViewBlobInternalsJob::GenerateHTML(std::string* out) const {
155 for (BlobStorageRegistry::BlobMap::const_iterator iter = 156 for (BlobStorageRegistry::BlobMap::const_iterator iter =
156 blob_storage_context_->registry_.blob_map_.begin(); 157 blob_storage_context_->registry_.blob_map_.begin();
157 iter != blob_storage_context_->registry_.blob_map_.end(); ++iter) { 158 iter != blob_storage_context_->registry_.blob_map_.end(); ++iter) {
158 AddHTMLBoldText(iter->first, out); 159 AddHTMLBoldText(iter->first, out);
159 GenerateHTMLForBlobData(*iter->second->data, iter->second->content_type, 160 GenerateHTMLForBlobData(iter->second->data, iter->second->content_type,
160 iter->second->content_disposition, 161 iter->second->content_disposition,
161 iter->second->refcount, out); 162 iter->second->refcount, out);
162 } 163 }
163 if (!blob_storage_context_->registry_.url_to_uuid_.empty()) { 164 if (!blob_storage_context_->registry_.url_to_uuid_.empty()) {
164 AddHorizontalRule(out); 165 AddHorizontalRule(out);
165 for (BlobStorageRegistry::URLMap::const_iterator iter = 166 for (BlobStorageRegistry::URLMap::const_iterator iter =
166 blob_storage_context_->registry_.url_to_uuid_.begin(); 167 blob_storage_context_->registry_.url_to_uuid_.begin();
167 iter != blob_storage_context_->registry_.url_to_uuid_.end(); ++iter) { 168 iter != blob_storage_context_->registry_.url_to_uuid_.end(); ++iter) {
168 AddHTMLBoldText(iter->first.spec(), out); 169 AddHTMLBoldText(iter->first.spec(), out);
169 StartHTMLList(out); 170 StartHTMLList(out);
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 } 249 }
249 250
250 if (has_multi_items) 251 if (has_multi_items)
251 EndHTMLList(out); 252 EndHTMLList(out);
252 } 253 }
253 254
254 EndHTMLList(out); 255 EndHTMLList(out);
255 } 256 }
256 257
257 } // namespace storage 258 } // namespace storage
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698