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 "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" |
11 #include "base/i18n/time_formatting.h" | 11 #include "base/i18n/time_formatting.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/message_loop/message_loop.h" | 13 #include "base/message_loop/message_loop.h" |
| 14 #include "base/profiler/scoped_profile.h" |
14 #include "base/strings/string_number_conversions.h" | 15 #include "base/strings/string_number_conversions.h" |
15 #include "base/strings/string_util.h" | 16 #include "base/strings/string_util.h" |
16 #include "base/strings/stringprintf.h" | 17 #include "base/strings/stringprintf.h" |
17 #include "base/strings/utf_string_conversions.h" | 18 #include "base/strings/utf_string_conversions.h" |
18 #include "net/base/escape.h" | 19 #include "net/base/escape.h" |
19 #include "net/base/net_errors.h" | 20 #include "net/base/net_errors.h" |
20 #include "net/url_request/url_request.h" | 21 #include "net/url_request/url_request.h" |
21 #include "storage/browser/blob/blob_storage_context.h" | 22 #include "storage/browser/blob/blob_storage_context.h" |
22 #include "storage/common/blob/blob_data.h" | 23 #include "storage/common/blob/blob_data.h" |
23 | 24 |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 void ViewBlobInternalsJob::Kill() { | 125 void ViewBlobInternalsJob::Kill() { |
125 net::URLRequestSimpleJob::Kill(); | 126 net::URLRequestSimpleJob::Kill(); |
126 weak_factory_.InvalidateWeakPtrs(); | 127 weak_factory_.InvalidateWeakPtrs(); |
127 } | 128 } |
128 | 129 |
129 int ViewBlobInternalsJob::GetData( | 130 int ViewBlobInternalsJob::GetData( |
130 std::string* mime_type, | 131 std::string* mime_type, |
131 std::string* charset, | 132 std::string* charset, |
132 std::string* data, | 133 std::string* data, |
133 const net::CompletionCallback& callback) const { | 134 const net::CompletionCallback& callback) const { |
| 135 // TODO(vadimt): Remove ScopedProfile below once crbug.com/422489 is fixed. |
| 136 tracked_objects::ScopedProfile tracking_profile( |
| 137 FROM_HERE_WITH_EXPLICIT_FUNCTION("422489 ViewBlobInternalsJob::GetData")); |
| 138 |
134 mime_type->assign("text/html"); | 139 mime_type->assign("text/html"); |
135 charset->assign("UTF-8"); | 140 charset->assign("UTF-8"); |
136 | 141 |
137 data->clear(); | 142 data->clear(); |
138 StartHTML(data); | 143 StartHTML(data); |
139 if (blob_storage_context_->blob_map_.empty()) | 144 if (blob_storage_context_->blob_map_.empty()) |
140 data->append(kEmptyBlobStorageMessage); | 145 data->append(kEmptyBlobStorageMessage); |
141 else | 146 else |
142 GenerateHTML(data); | 147 GenerateHTML(data); |
143 EndHTML(data); | 148 EndHTML(data); |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 } | 238 } |
234 | 239 |
235 if (has_multi_items) | 240 if (has_multi_items) |
236 EndHTMLList(out); | 241 EndHTMLList(out); |
237 } | 242 } |
238 | 243 |
239 EndHTMLList(out); | 244 EndHTMLList(out); |
240 } | 245 } |
241 | 246 |
242 } // namespace storage | 247 } // namespace storage |
OLD | NEW |