Bug 119389 - Make WebHistory more type safe
Summary: Make WebHistory more type safe
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows 7
: P2 Normal
Assignee: Patrick R. Gansterer
URL:
Keywords:
Depends on:
Blocks: 122010
  Show dependency treegraph
 
Reported: 2013-08-01 04:38 PDT by Patrick R. Gansterer
Modified: 2013-09-27 05:33 PDT (History)
3 users (show)

See Also:


Attachments
Patch (11.48 KB, patch)
2013-08-01 04:45 PDT, Patrick R. Gansterer
no flags Details | Formatted Diff | Diff
Patch (11.55 KB, patch)
2013-09-15 18:29 PDT, Patrick R. Gansterer
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick R. Gansterer 2013-08-01 04:38:43 PDT
Make WebHistory more type safe
Comment 1 Patrick R. Gansterer 2013-08-01 04:45:28 PDT
Created attachment 207912 [details]
Patch
Comment 2 WebKit Commit Bot 2013-08-01 04:47:10 PDT
Attachment 207912 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebKit/win/ChangeLog', u'Source/WebKit/win/WebHistory.cpp', u'Source/WebKit/win/WebHistory.h']" exit_code: 1
Source/WebKit/win/WebHistory.cpp:532:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Source/WebKit/win/WebHistory.cpp:533:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Total errors found: 2 in 3 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Brent Fulgham 2013-09-15 17:37:50 PDT
Comment on attachment 207912 [details]
Patch

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

Looks good!  Can you please use 'auto'?

> Source/WebKit/win/WebHistory.cpp:246
> +    for (URLToEntriesMap::const_iterator it = m_entriesByURL.begin(); it != m_entriesByURL.end(); ++it)

Can this be for (auto it = ...)?

> Source/WebKit/win/WebHistory.cpp:345
> +    for (URLToEntriesMap::const_iterator it = m_entriesByURL.begin(); it != m_entriesByURL.end(); ++i, ++it) {

auto!

>> Source/WebKit/win/WebHistory.cpp:532
>> +    /* [in] */ BSTR url,
> 
> Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]

I've been changing these to be one-line in "WebKit Style" when I'm changing the signature.  Do we really need the STDMETHODCALLTYPE here? I thought that if it was in the header file that was sufficient.

> Source/WebKit/win/WebHistory.cpp:539
> +    URLToEntriesMap::iterator it = m_entriesByURL.find(url);

auto it = ...

> Source/WebKit/win/WebHistory.cpp:549
> +    URLToEntriesMap::iterator it = m_entriesByURL.find(urlString);

auto ...

> Source/WebKit/win/WebHistory.cpp:757
> +    for (URLToEntriesMap::const_iterator it = m_entriesByURL.begin(); it != m_entriesByURL.end(); ++it) {

auto...
Comment 4 Patrick R. Gansterer 2013-09-15 18:29:44 PDT
Created attachment 211733 [details]
Patch
Comment 5 Brent Fulgham 2013-09-15 19:41:29 PDT
Comment on attachment 211733 [details]
Patch

r=me
Comment 6 WebKit Commit Bot 2013-09-18 10:31:26 PDT
Comment on attachment 211733 [details]
Patch

Clearing flags on attachment: 211733

Committed r156051: <http://trac.webkit.org/changeset/156051>
Comment 7 WebKit Commit Bot 2013-09-18 10:31:27 PDT
All reviewed patches have been landed.  Closing bug.