[Webkit-unassigned] [Bug 91214] [EFL] Add WebMemorySampler feature.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Aug 27 23:16:55 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=91214





--- Comment #38 from Simon Hausmann <hausmann at webkit.org>  2012-08-27 23:16:56 PST ---
(From update of attachment 160897)
View in context: https://bugs.webkit.org/attachment.cgi?id=160897&action=review

> Source/WebKit2/PlatformEfl.cmake:26
> +    Shared/efl/WebMemorySamplerEfl.cpp

It seems that the implementation of the Sampler is not really EFL specific but rather Linux specific and perhaps instead belongs into Shared/linux/WebMemorySamplerLinux.cpp, for re-use by other ports. Then you can also get rid of the #if OS(LINUX) :)

> Source/WebKit2/Shared/efl/WebMemorySamplerEfl.cpp:83
> +    bool foundKeyName = false;
> +    FILE* fSystemMemoryStatus = fopen("/proc/meminfo", "r");
> +    if (fSystemMemoryStatus) {
> +        while (!feof(fSystemMemoryStatus)) {

I'm inclined to say that it's more typical WebKit style to use early returns, i.e. instead of

FILE* f = fopen(...);
if (f) {
    ...
}

using

FILE* f = fopen(...);
if (!f)
    return;
...

and therefore achieving a lower level of indentation and presumably more readable code :)

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list