Bug 31700 - Web Inspector: isMac should be in one central location + Cached
Summary: Web Inspector: isMac should be in one central location + Cached
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: Brian Weinstein
URL:
Keywords:
Depends on: 31699
Blocks:
  Show dependency treegraph
 
Reported: 2009-11-19 19:11 PST by Brian Weinstein
Modified: 2009-11-20 11:52 PST (History)
7 users (show)

See Also:


Attachments
[PATCH] Fix (6.09 KB, patch)
2009-11-20 11:03 PST, Brian Weinstein
timothy: review-
bweinstein: commit-queue-
Details | Formatted Diff | Diff
[PATCH] Use function instead of getter (6.20 KB, patch)
2009-11-20 11:45 PST, Brian Weinstein
timothy: review+
bweinstein: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brian Weinstein 2009-11-19 19:11:52 PST
We have the same isMac code in multiple places throughout the code base. This should be refactored into a WebInspector.isMac, where that value can be cached, for the same reasons as webkit.org/b/31699. The refactoring would put the call to indexOf in one place, and we could cache the result.
Comment 1 Brian Weinstein 2009-11-20 11:03:57 PST
Created attachment 43597 [details]
[PATCH] Fix
Comment 2 Timothy Hatcher 2009-11-20 11:24:25 PST
Comment on attachment 43597 [details]
[PATCH] Fix

WebInspector.isMac should be a function, since it asks a question with it's name. Otherwise r+.
Comment 3 Brian Weinstein 2009-11-20 11:45:42 PST
Created attachment 43600 [details]
[PATCH] Use function instead of getter
Comment 4 Brian Weinstein 2009-11-20 11:52:13 PST
Landed in r51250.