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 "net/url_request/view_cache_helper.h" | 5 #include "net/url_request/view_cache_helper.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "net/base/escape.h" | 10 #include "net/base/escape.h" |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 if (HttpCache::ParseResponseInfo( | 304 if (HttpCache::ParseResponseInfo( |
305 buf_->data(), buf_len_, &response, &truncated) && | 305 buf_->data(), buf_len_, &response, &truncated) && |
306 response.headers.get()) { | 306 response.headers.get()) { |
307 if (truncated) | 307 if (truncated) |
308 data_->append("<pre>RESPONSE_INFO_TRUNCATED</pre>"); | 308 data_->append("<pre>RESPONSE_INFO_TRUNCATED</pre>"); |
309 | 309 |
310 data_->append("<hr><pre>"); | 310 data_->append("<hr><pre>"); |
311 data_->append(EscapeForHTML(response.headers->GetStatusLine())); | 311 data_->append(EscapeForHTML(response.headers->GetStatusLine())); |
312 data_->push_back('\n'); | 312 data_->push_back('\n'); |
313 | 313 |
314 void* iter = NULL; | 314 size_t iter = 0; |
315 std::string name, value; | 315 std::string name, value; |
316 while (response.headers->EnumerateHeaderLines(&iter, &name, &value)) { | 316 while (response.headers->EnumerateHeaderLines(&iter, &name, &value)) { |
317 data_->append(EscapeForHTML(name)); | 317 data_->append(EscapeForHTML(name)); |
318 data_->append(": "); | 318 data_->append(": "); |
319 data_->append(EscapeForHTML(value)); | 319 data_->append(EscapeForHTML(value)); |
320 data_->push_back('\n'); | 320 data_->push_back('\n'); |
321 } | 321 } |
322 data_->append("</pre>"); | 322 data_->append("</pre>"); |
323 } | 323 } |
324 } | 324 } |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 entry_ = NULL; | 359 entry_ = NULL; |
360 } | 360 } |
361 return OK; | 361 return OK; |
362 } | 362 } |
363 | 363 |
364 void ViewCacheHelper::OnIOComplete(int result) { | 364 void ViewCacheHelper::OnIOComplete(int result) { |
365 DoLoop(result); | 365 DoLoop(result); |
366 } | 366 } |
367 | 367 |
368 } // namespace net. | 368 } // namespace net. |
OLD | NEW |