Bug 107511 - Web Inspector: [Network] CookiesTable refactoring.
Summary: Web Inspector: [Network] CookiesTable refactoring.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Eugene Klyuchnikov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-21 23:57 PST by Eugene Klyuchnikov
Modified: 2013-01-22 03:59 PST (History)
9 users (show)

See Also:


Attachments
Patch (10.62 KB, patch)
2013-01-22 00:02 PST, Eugene Klyuchnikov
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eugene Klyuchnikov 2013-01-21 23:57:48 PST
CookiesTable uses integer indexes as column identifiers. This leads to cryptic code.

Descriptive column identifiers will make code clearer.

Also "addCookiesFolder" replaced with "setCookieFolders" to avoid repetitive "_rebuildTable" invocation.
Comment 1 Eugene Klyuchnikov 2013-01-22 00:02:22 PST
Created attachment 183902 [details]
Patch
Comment 2 Andrey Adaikin 2013-01-22 00:16:52 PST
Comment on attachment 183902 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=183902&action=review

> Source/WebCore/inspector/front-end/CookiesTable.js:43
> +    var columns = {name: {}, value: {}, domain: {}, path: {}, expires: {}, size: {}, httpOnly: {}, secure: {}};

FYI.
ECMAScript5, 12.6.4 "The for-in Statement":
"The mechanics and order of enumerating the properties (step 6.a in the first algorithm, step 7.a in the second) is not specified."
Comment 3 Eugene Klyuchnikov 2013-01-22 00:39:56 PST
Comment on attachment 183902 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=183902&action=review

>> Source/WebCore/inspector/front-end/CookiesTable.js:43
>> +    var columns = {name: {}, value: {}, domain: {}, path: {}, expires: {}, size: {}, httpOnly: {}, secure: {}};
> 
> FYI.
> ECMAScript5, 12.6.4 "The for-in Statement":
> "The mechanics and order of enumerating the properties (step 6.a in the first algorithm, step 7.a in the second) is not specified."

With explicit keys it will be not worse than with implicit keys (because this is object, not array).
But in general, I agree, we should make column ordering more clear one day.
Comment 4 WebKit Review Bot 2013-01-22 03:59:00 PST
Comment on attachment 183902 [details]
Patch

Clearing flags on attachment: 183902

Committed r140408: <http://trac.webkit.org/changeset/140408>
Comment 5 WebKit Review Bot 2013-01-22 03:59:03 PST
All reviewed patches have been landed.  Closing bug.