| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "content/browser/appcache/appcache_internals_ui.h" | 5 #include "content/browser/appcache/appcache_internals_ui.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 455 scoped_refptr<AppCacheResponseInfo> response_info, | 455 scoped_refptr<AppCacheResponseInfo> response_info, |
| 456 scoped_refptr<net::IOBuffer> response_data, | 456 scoped_refptr<net::IOBuffer> response_data, |
| 457 int data_length) { | 457 int data_length) { |
| 458 std::string headers; | 458 std::string headers; |
| 459 if (response_info->http_response_info()) { | 459 if (response_info->http_response_info()) { |
| 460 headers.append("<hr><pre>"); | 460 headers.append("<hr><pre>"); |
| 461 headers.append(net::EscapeForHTML( | 461 headers.append(net::EscapeForHTML( |
| 462 response_info->http_response_info()->headers->GetStatusLine())); | 462 response_info->http_response_info()->headers->GetStatusLine())); |
| 463 headers.push_back('\n'); | 463 headers.push_back('\n'); |
| 464 | 464 |
| 465 void* iter = nullptr; | 465 size_t iter = 0; |
| 466 std::string name, value; | 466 std::string name, value; |
| 467 while (response_info->http_response_info()->headers->EnumerateHeaderLines( | 467 while (response_info->http_response_info()->headers->EnumerateHeaderLines( |
| 468 &iter, &name, &value)) { | 468 iter, &name, &value)) { |
| 469 headers.append(net::EscapeForHTML(name)); | 469 headers.append(net::EscapeForHTML(name)); |
| 470 headers.append(": "); | 470 headers.append(": "); |
| 471 headers.append(net::EscapeForHTML(value)); | 471 headers.append(net::EscapeForHTML(value)); |
| 472 headers.push_back('\n'); | 472 headers.push_back('\n'); |
| 473 } | 473 } |
| 474 headers.append("</pre>"); | 474 headers.append("</pre>"); |
| 475 } else { | 475 } else { |
| 476 headers.append("Failed to read response headers. <br>"); | 476 headers.append("Failed to read response headers. <br>"); |
| 477 } | 477 } |
| 478 std::string hex_dump = base::StringPrintf( | 478 std::string hex_dump = base::StringPrintf( |
| (...skipping 22 matching lines...) Expand all Loading... |
| 501 const base::FilePath& partition_path) { | 501 const base::FilePath& partition_path) { |
| 502 for (const scoped_refptr<Proxy>& proxy : appcache_proxies_) { | 502 for (const scoped_refptr<Proxy>& proxy : appcache_proxies_) { |
| 503 if (proxy->partition_path_ == partition_path) | 503 if (proxy->partition_path_ == partition_path) |
| 504 return proxy.get(); | 504 return proxy.get(); |
| 505 } | 505 } |
| 506 NOTREACHED(); | 506 NOTREACHED(); |
| 507 return nullptr; | 507 return nullptr; |
| 508 } | 508 } |
| 509 | 509 |
| 510 } // namespace content | 510 } // namespace content |
| OLD | NEW |