| Index: net/url_request/view_cache_helper.cc
|
| diff --git a/net/url_request/view_cache_helper.cc b/net/url_request/view_cache_helper.cc
|
| index 346c7cdb50c6c60fd46f8bef5f9a37ef57af6f4b..1356df762da3c9f738781491b88f15a1e6449c6e 100644
|
| --- a/net/url_request/view_cache_helper.cc
|
| +++ b/net/url_request/view_cache_helper.cc
|
| @@ -16,14 +16,13 @@
|
| #include "net/http/http_response_info.h"
|
| #include "net/url_request/url_request_context.h"
|
|
|
| -#define VIEW_CACHE_HEAD \
|
| - "<html><meta charset=\"utf-8\">" \
|
| - "<meta http-equiv=\"Content-Security-Policy\" " \
|
| +#define VIEW_CACHE_HEAD \
|
| + "<html><meta charset=\"utf-8\">" \
|
| + "<meta http-equiv=\"Content-Security-Policy\" " \
|
| " content=\"object-src 'none'; script-src 'none' 'unsafe-eval'\">" \
|
| "<body><table>"
|
|
|
| -#define VIEW_CACHE_TAIL \
|
| - "</table></body></html>"
|
| +#define VIEW_CACHE_TAIL "</table></body></html>"
|
|
|
| namespace net {
|
|
|
| @@ -33,9 +32,8 @@ std::string FormatEntryInfo(disk_cache::Entry* entry,
|
| const std::string& url_prefix) {
|
| std::string key = entry->GetKey();
|
| GURL url = GURL(url_prefix + key);
|
| - std::string row =
|
| - "<tr><td><a href=\"" + url.spec() + "\">" + EscapeForHTML(key) +
|
| - "</a></td></tr>";
|
| + std::string row = "<tr><td><a href=\"" + url.spec() + "\">" +
|
| + EscapeForHTML(key) + "</a></td></tr>";
|
| return row;
|
| }
|
|
|
| @@ -73,17 +71,18 @@ int ViewCacheHelper::GetContentsHTML(const URLRequestContext* context,
|
| }
|
|
|
| // static
|
| -void ViewCacheHelper::HexDump(const char *buf, size_t buf_len,
|
| +void ViewCacheHelper::HexDump(const char* buf,
|
| + size_t buf_len,
|
| std::string* result) {
|
| const size_t kMaxRows = 16;
|
| int offset = 0;
|
|
|
| - const unsigned char *p;
|
| + const unsigned char* p;
|
| while (buf_len) {
|
| base::StringAppendF(result, "%08x: ", offset);
|
| offset += kMaxRows;
|
|
|
| - p = (const unsigned char *) buf;
|
| + p = (const unsigned char*)buf;
|
|
|
| size_t i;
|
| size_t row_max = std::min(kMaxRows, buf_len);
|
| @@ -96,7 +95,7 @@ void ViewCacheHelper::HexDump(const char *buf, size_t buf_len,
|
| result->append(" ");
|
|
|
| // print ASCII glyphs if possible:
|
| - p = (const unsigned char *) buf;
|
| + p = (const unsigned char*)buf;
|
| for (i = 0; i < row_max; ++i, ++p) {
|
| if (*p < 0x7F && *p > 0x1F) {
|
| AppendEscapedCharForHTML(*p, result);
|
| @@ -218,8 +217,8 @@ int ViewCacheHelper::DoGetBackend() {
|
| return ERR_FAILED;
|
|
|
| return http_cache->GetBackend(
|
| - &disk_cache_, base::Bind(&ViewCacheHelper::OnIOComplete,
|
| - base::Unretained(this)));
|
| + &disk_cache_,
|
| + base::Bind(&ViewCacheHelper::OnIOComplete, base::Unretained(this)));
|
| }
|
|
|
| int ViewCacheHelper::DoGetBackendComplete(int result) {
|
| @@ -243,7 +242,8 @@ int ViewCacheHelper::DoGetBackendComplete(int result) {
|
| int ViewCacheHelper::DoOpenNextEntry() {
|
| next_state_ = STATE_OPEN_NEXT_ENTRY_COMPLETE;
|
| return disk_cache_->OpenNextEntry(
|
| - &iter_, &entry_,
|
| + &iter_,
|
| + &entry_,
|
| base::Bind(&ViewCacheHelper::OnIOComplete, base::Unretained(this)));
|
| }
|
|
|
| @@ -265,7 +265,8 @@ int ViewCacheHelper::DoOpenNextEntryComplete(int result) {
|
| int ViewCacheHelper::DoOpenEntry() {
|
| next_state_ = STATE_OPEN_ENTRY_COMPLETE;
|
| return disk_cache_->OpenEntry(
|
| - key_, &entry_,
|
| + key_,
|
| + &entry_,
|
| base::Bind(&ViewCacheHelper::OnIOComplete, base::Unretained(this)));
|
| }
|
|
|
|
|