diff options
Diffstat (limited to 'chrome/common/render_messages.h')
-rw-r--r-- | chrome/common/render_messages.h | 80 |
1 files changed, 66 insertions, 14 deletions
diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h index ebac85c..0053921 100644 --- a/chrome/common/render_messages.h +++ b/chrome/common/render_messages.h @@ -25,8 +25,8 @@ #include "net/base/upload_data.h" #include "net/http/http_response_headers.h" #include "net/url_request/url_request_status.h" +#include "third_party/WebKit/WebKit/chromium/public/WebCache.h" #include "webkit/glue/autofill_form.h" -#include "webkit/glue/cache_manager.h" #include "webkit/glue/context_menu.h" #include "webkit/glue/feed.h" #include "webkit/glue/form_data.h" @@ -1165,27 +1165,80 @@ struct ParamTraits<net::UploadData::Element> { } }; -// Traits for CacheManager::UsageStats +// Traits for WebKit::WebCache::UsageStats template <> -struct ParamTraits<CacheManager::UsageStats> { - typedef CacheManager::UsageStats param_type; +struct ParamTraits<WebKit::WebCache::UsageStats> { + typedef WebKit::WebCache::UsageStats param_type; static void Write(Message* m, const param_type& p) { - WriteParam(m, p.min_dead_capacity); - WriteParam(m, p.max_dead_capacity); + WriteParam(m, p.minDeadCapacity); + WriteParam(m, p.maxDeadCapacity); WriteParam(m, p.capacity); - WriteParam(m, p.live_size); - WriteParam(m, p.dead_size); + WriteParam(m, p.liveSize); + WriteParam(m, p.deadSize); } static bool Read(const Message* m, void** iter, param_type* r) { return - ReadParam(m, iter, &r->min_dead_capacity) && - ReadParam(m, iter, &r->max_dead_capacity) && + ReadParam(m, iter, &r->minDeadCapacity) && + ReadParam(m, iter, &r->maxDeadCapacity) && ReadParam(m, iter, &r->capacity) && - ReadParam(m, iter, &r->live_size) && - ReadParam(m, iter, &r->dead_size); + ReadParam(m, iter, &r->liveSize) && + ReadParam(m, iter, &r->deadSize); } static void Log(const param_type& p, std::wstring* l) { - l->append(L"<CacheManager::UsageStats>"); + l->append(L"<WebCache::UsageStats>"); + } +}; + +template <> +struct ParamTraits<WebKit::WebCache::ResourceTypeStat> { + typedef WebKit::WebCache::ResourceTypeStat param_type; + static void Write(Message* m, const param_type& p) { + WriteParam(m, p.count); + WriteParam(m, p.size); + WriteParam(m, p.liveSize); + WriteParam(m, p.decodedSize); + } + static bool Read(const Message* m, void** iter, param_type* r) { + bool result = + ReadParam(m, iter, &r->count) && + ReadParam(m, iter, &r->size) && + ReadParam(m, iter, &r->liveSize) && + ReadParam(m, iter, &r->decodedSize); + return result; + } + static void Log(const param_type& p, std::wstring* l) { + l->append(StringPrintf(L"%d %d %d %d", p.count, p.size, p.liveSize, + p.decodedSize)); + } +}; + +template <> +struct ParamTraits<WebKit::WebCache::ResourceTypeStats> { + typedef WebKit::WebCache::ResourceTypeStats param_type; + static void Write(Message* m, const param_type& p) { + WriteParam(m, p.images); + WriteParam(m, p.cssStyleSheets); + WriteParam(m, p.scripts); + WriteParam(m, p.xslStyleSheets); + WriteParam(m, p.fonts); + } + static bool Read(const Message* m, void** iter, param_type* r) { + bool result = + ReadParam(m, iter, &r->images) && + ReadParam(m, iter, &r->cssStyleSheets) && + ReadParam(m, iter, &r->scripts) && + ReadParam(m, iter, &r->xslStyleSheets) && + ReadParam(m, iter, &r->fonts); + return result; + } + static void Log(const param_type& p, std::wstring* l) { + l->append(L"<WebCoreStats>"); + LogParam(p.images, l); + LogParam(p.cssStyleSheets, l); + LogParam(p.scripts, l); + LogParam(p.xslStyleSheets, l); + LogParam(p.fonts, l); + l->append(L"</WebCoreStats>"); } }; @@ -1833,7 +1886,6 @@ struct ParamTraits<AudioOutputStream::State> { } }; - } // namespace IPC |