From 7459581d1357514ad9d91518bc3517ba4105edbb Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sat, 14 May 2016 22:40:18 +0900 Subject: [PATCH] Fix cpplint warnings --- .../native_mate_converters/blink_converter.cc | 16 ++++++---------- .../native_mate_converters/blink_converter.h | 17 +++++++++-------- atom/renderer/api/atom_api_web_frame.cc | 4 ++-- docs/api/web-frame.md | 1 - 4 files changed, 17 insertions(+), 21 deletions(-) diff --git a/atom/common/native_mate_converters/blink_converter.cc b/atom/common/native_mate_converters/blink_converter.cc index ddee3a1351..7e0d180f96 100644 --- a/atom/common/native_mate_converters/blink_converter.cc +++ b/atom/common/native_mate_converters/blink_converter.cc @@ -389,14 +389,12 @@ v8::Local Converter::ToV8( v8::Isolate* isolate, const blink::WebCache::ResourceTypeStat& stat) { mate::Dictionary dict = mate::Dictionary::CreateEmpty(isolate); - - dict.Set("count", (uint32_t)stat.count); - dict.Set("size", (double)stat.size); - dict.Set("liveSize", (double)stat.liveSize); - dict.Set("decodedSize", (double)stat.decodedSize); - dict.Set("purgedSize", (double)stat.purgedSize); - dict.Set("purgeableSize", (double)stat.purgeableSize); - + dict.Set("count", static_cast(stat.count)); + dict.Set("size", static_cast(stat.size)); + dict.Set("liveSize", static_cast(stat.liveSize)); + dict.Set("decodedSize", static_cast(stat.decodedSize)); + dict.Set("purgedSize", static_cast(stat.purgedSize)); + dict.Set("purgeableSize", static_cast(stat.purgeableSize)); return dict.GetHandle(); } @@ -404,14 +402,12 @@ v8::Local Converter::ToV8( v8::Isolate* isolate, const blink::WebCache::ResourceTypeStats& stats) { mate::Dictionary dict = mate::Dictionary::CreateEmpty(isolate); - dict.Set("images", mate::ConvertToV8(isolate, stats.images)); dict.Set("scripts", mate::ConvertToV8(isolate, stats.scripts)); dict.Set("cssStyleSheets", mate::ConvertToV8(isolate, stats.cssStyleSheets)); dict.Set("xslStyleSheets", mate::ConvertToV8(isolate, stats.xslStyleSheets)); dict.Set("fonts", mate::ConvertToV8(isolate, stats.fonts)); dict.Set("other", mate::ConvertToV8(isolate, stats.other)); - return dict.GetHandle(); } diff --git a/atom/common/native_mate_converters/blink_converter.h b/atom/common/native_mate_converters/blink_converter.h index a48547e612..78275ab62e 100644 --- a/atom/common/native_mate_converters/blink_converter.h +++ b/atom/common/native_mate_converters/blink_converter.h @@ -101,22 +101,23 @@ struct Converter { const blink::WebContextMenuData::InputFieldType& in); }; -v8::Local EditFlagsToV8(v8::Isolate* isolate, int editFlags); - -v8::Local MediaFlagsToV8(v8::Isolate* isolate, int mediaFlags); - template<> struct Converter { - static v8::Local ToV8(v8::Isolate* isolate, - const blink::WebCache::ResourceTypeStat& stat); + static v8::Local ToV8( + v8::Isolate* isolate, + const blink::WebCache::ResourceTypeStat& stat); }; template<> struct Converter { - static v8::Local ToV8(v8::Isolate* isolate, - const blink::WebCache::ResourceTypeStats& stats); + static v8::Local ToV8( + v8::Isolate* isolate, + const blink::WebCache::ResourceTypeStats& stats); }; +v8::Local EditFlagsToV8(v8::Isolate* isolate, int editFlags); +v8::Local MediaFlagsToV8(v8::Isolate* isolate, int mediaFlags); + } // namespace mate #endif // ATOM_COMMON_NATIVE_MATE_CONVERTERS_BLINK_CONVERTER_H_ diff --git a/atom/renderer/api/atom_api_web_frame.cc b/atom/renderer/api/atom_api_web_frame.cc index e2fff3ca6b..46e00ba397 100644 --- a/atom/renderer/api/atom_api_web_frame.cc +++ b/atom/renderer/api/atom_api_web_frame.cc @@ -171,9 +171,9 @@ mate::Handle WebFrame::Create(v8::Isolate* isolate) { return mate::CreateHandle(isolate, new WebFrame(isolate)); } -blink::WebCache::ResourceTypeStats WebFrame::GetResourceUsage(v8::Isolate* isolate) { +blink::WebCache::ResourceTypeStats WebFrame::GetResourceUsage( + v8::Isolate* isolate) { blink::WebCache::ResourceTypeStats stats; - blink::WebCache::getResourceTypeStats(&stats); return stats; } diff --git a/docs/api/web-frame.md b/docs/api/web-frame.md index f9da778d95..de28afe057 100644 --- a/docs/api/web-frame.md +++ b/docs/api/web-frame.md @@ -106,7 +106,6 @@ In the browser window some HTML APIs like `requestFullScreen` can only be invoked by a gesture from the user. Setting `userGesture` to `true` will remove this limitation. - ### `webFrame.getResourceUsage()` Returns more detailed memory usage information in kilobytes of Blink's internal