| 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 <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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 StartHTML(data); | 146 StartHTML(data); |
| 147 if (blob_storage_context_->registry().blob_map_.empty()) | 147 if (blob_storage_context_->registry().blob_map_.empty()) |
| 148 data->append(kEmptyBlobStorageMessage); | 148 data->append(kEmptyBlobStorageMessage); |
| 149 else | 149 else |
| 150 GenerateHTML(data); | 150 GenerateHTML(data); |
| 151 EndHTML(data); | 151 EndHTML(data); |
| 152 return net::OK; | 152 return net::OK; |
| 153 } | 153 } |
| 154 | 154 |
| 155 void ViewBlobInternalsJob::GenerateHTML(std::string* out) const { | 155 void ViewBlobInternalsJob::GenerateHTML(std::string* out) const { |
| 156 for (BlobStorageRegistry::BlobMap::const_iterator iter = | 156 for (auto iter = blob_storage_context_->registry().blob_map_.begin(); |
| 157 blob_storage_context_->registry().blob_map_.begin(); | |
| 158 iter != blob_storage_context_->registry().blob_map_.end(); ++iter) { | 157 iter != blob_storage_context_->registry().blob_map_.end(); ++iter) { |
| 159 AddHTMLBoldText(iter->first, out); | 158 AddHTMLBoldText(iter->first, out); |
| 160 GenerateHTMLForBlobData(*iter->second, iter->second->content_type(), | 159 GenerateHTMLForBlobData(*iter->second, iter->second->content_type(), |
| 161 iter->second->content_disposition(), | 160 iter->second->content_disposition(), |
| 162 iter->second->refcount(), out); | 161 iter->second->refcount(), out); |
| 163 } | 162 } |
| 164 if (!blob_storage_context_->registry().url_to_uuid_.empty()) { | 163 if (!blob_storage_context_->registry().url_to_uuid_.empty()) { |
| 165 AddHorizontalRule(out); | 164 AddHorizontalRule(out); |
| 166 for (BlobStorageRegistry::URLMap::const_iterator iter = | 165 for (auto iter = blob_storage_context_->registry().url_to_uuid_.begin(); |
| 167 blob_storage_context_->registry().url_to_uuid_.begin(); | |
| 168 iter != blob_storage_context_->registry().url_to_uuid_.end(); ++iter) { | 166 iter != blob_storage_context_->registry().url_to_uuid_.end(); ++iter) { |
| 169 AddHTMLBoldText(iter->first.spec(), out); | 167 AddHTMLBoldText(iter->first.spec(), out); |
| 170 StartHTMLList(out); | 168 StartHTMLList(out); |
| 171 AddHTMLListItem(kUUID, iter->second, out); | 169 AddHTMLListItem(kUUID, iter->second, out); |
| 172 EndHTMLList(out); | 170 EndHTMLList(out); |
| 173 } | 171 } |
| 174 } | 172 } |
| 175 } | 173 } |
| 176 | 174 |
| 177 void ViewBlobInternalsJob::GenerateHTMLForBlobData( | 175 void ViewBlobInternalsJob::GenerateHTMLForBlobData( |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 } | 248 } |
| 251 | 249 |
| 252 if (has_multi_items) | 250 if (has_multi_items) |
| 253 EndHTMLList(out); | 251 EndHTMLList(out); |
| 254 } | 252 } |
| 255 | 253 |
| 256 EndHTMLList(out); | 254 EndHTMLList(out); |
| 257 } | 255 } |
| 258 | 256 |
| 259 } // namespace storage | 257 } // namespace storage |
| OLD | NEW |