Fix cpplint warnings

This commit is contained in:
Cheng Zhao 2016-05-14 22:40:18 +09:00
parent 2234307d41
commit 7459581d13
4 changed files with 17 additions and 21 deletions

View file

@ -389,14 +389,12 @@ v8::Local<v8::Value> Converter<blink::WebCache::ResourceTypeStat>::ToV8(
v8::Isolate* isolate, v8::Isolate* isolate,
const blink::WebCache::ResourceTypeStat& stat) { const blink::WebCache::ResourceTypeStat& stat) {
mate::Dictionary dict = mate::Dictionary::CreateEmpty(isolate); mate::Dictionary dict = mate::Dictionary::CreateEmpty(isolate);
dict.Set("count", static_cast<uint32_t>(stat.count));
dict.Set("count", (uint32_t)stat.count); dict.Set("size", static_cast<double>(stat.size));
dict.Set("size", (double)stat.size); dict.Set("liveSize", static_cast<double>(stat.liveSize));
dict.Set("liveSize", (double)stat.liveSize); dict.Set("decodedSize", static_cast<double>(stat.decodedSize));
dict.Set("decodedSize", (double)stat.decodedSize); dict.Set("purgedSize", static_cast<double>(stat.purgedSize));
dict.Set("purgedSize", (double)stat.purgedSize); dict.Set("purgeableSize", static_cast<double>(stat.purgeableSize));
dict.Set("purgeableSize", (double)stat.purgeableSize);
return dict.GetHandle(); return dict.GetHandle();
} }
@ -404,14 +402,12 @@ v8::Local<v8::Value> Converter<blink::WebCache::ResourceTypeStats>::ToV8(
v8::Isolate* isolate, v8::Isolate* isolate,
const blink::WebCache::ResourceTypeStats& stats) { const blink::WebCache::ResourceTypeStats& stats) {
mate::Dictionary dict = mate::Dictionary::CreateEmpty(isolate); mate::Dictionary dict = mate::Dictionary::CreateEmpty(isolate);
dict.Set("images", mate::ConvertToV8(isolate, stats.images)); dict.Set("images", mate::ConvertToV8(isolate, stats.images));
dict.Set("scripts", mate::ConvertToV8(isolate, stats.scripts)); dict.Set("scripts", mate::ConvertToV8(isolate, stats.scripts));
dict.Set("cssStyleSheets", mate::ConvertToV8(isolate, stats.cssStyleSheets)); dict.Set("cssStyleSheets", mate::ConvertToV8(isolate, stats.cssStyleSheets));
dict.Set("xslStyleSheets", mate::ConvertToV8(isolate, stats.xslStyleSheets)); dict.Set("xslStyleSheets", mate::ConvertToV8(isolate, stats.xslStyleSheets));
dict.Set("fonts", mate::ConvertToV8(isolate, stats.fonts)); dict.Set("fonts", mate::ConvertToV8(isolate, stats.fonts));
dict.Set("other", mate::ConvertToV8(isolate, stats.other)); dict.Set("other", mate::ConvertToV8(isolate, stats.other));
return dict.GetHandle(); return dict.GetHandle();
} }

View file

@ -101,22 +101,23 @@ struct Converter<blink::WebContextMenuData::InputFieldType> {
const blink::WebContextMenuData::InputFieldType& in); const blink::WebContextMenuData::InputFieldType& in);
}; };
v8::Local<v8::Value> EditFlagsToV8(v8::Isolate* isolate, int editFlags);
v8::Local<v8::Value> MediaFlagsToV8(v8::Isolate* isolate, int mediaFlags);
template<> template<>
struct Converter<blink::WebCache::ResourceTypeStat> { struct Converter<blink::WebCache::ResourceTypeStat> {
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate, static v8::Local<v8::Value> ToV8(
const blink::WebCache::ResourceTypeStat& stat); v8::Isolate* isolate,
const blink::WebCache::ResourceTypeStat& stat);
}; };
template<> template<>
struct Converter<blink::WebCache::ResourceTypeStats> { struct Converter<blink::WebCache::ResourceTypeStats> {
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate, static v8::Local<v8::Value> ToV8(
const blink::WebCache::ResourceTypeStats& stats); v8::Isolate* isolate,
const blink::WebCache::ResourceTypeStats& stats);
}; };
v8::Local<v8::Value> EditFlagsToV8(v8::Isolate* isolate, int editFlags);
v8::Local<v8::Value> MediaFlagsToV8(v8::Isolate* isolate, int mediaFlags);
} // namespace mate } // namespace mate
#endif // ATOM_COMMON_NATIVE_MATE_CONVERTERS_BLINK_CONVERTER_H_ #endif // ATOM_COMMON_NATIVE_MATE_CONVERTERS_BLINK_CONVERTER_H_

View file

@ -171,9 +171,9 @@ mate::Handle<WebFrame> WebFrame::Create(v8::Isolate* isolate) {
return mate::CreateHandle(isolate, new WebFrame(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::ResourceTypeStats stats;
blink::WebCache::getResourceTypeStats(&stats); blink::WebCache::getResourceTypeStats(&stats);
return stats; return stats;
} }

View file

@ -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 invoked by a gesture from the user. Setting `userGesture` to `true` will remove
this limitation. this limitation.
### `webFrame.getResourceUsage()` ### `webFrame.getResourceUsage()`
Returns more detailed memory usage information in kilobytes of Blink's internal Returns more detailed memory usage information in kilobytes of Blink's internal