Bug 99275 - Make UserScript and UserStyleSheet classes into value objects that are copyable
Summary: Make UserScript and UserStyleSheet classes into value objects that are copyable
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Sam Weinig
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-14 14:18 PDT by Sam Weinig
Modified: 2012-10-14 14:55 PDT (History)
10 users (show)

See Also:


Attachments
Patch (31.14 KB, patch)
2012-10-14 14:26 PDT, Sam Weinig
no flags Details | Formatted Diff | Diff
Patch (32.97 KB, patch)
2012-10-14 14:38 PDT, Sam Weinig
thorton: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sam Weinig 2012-10-14 14:18:23 PDT
Make UserScript and UserStyleSheet value objects that are copyable
Comment 1 Sam Weinig 2012-10-14 14:26:25 PDT
Created attachment 168590 [details]
Patch
Comment 2 WebKit Review Bot 2012-10-14 14:29:55 PDT
Attachment 168590 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1
Source/WebCore/page/PageGroup.cpp:265:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Source/WebCore/page/PageGroup.cpp:280:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Source/WebCore/page/UserStyleSheet.h:40:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp:299:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Source/WebCore/page/UserScript.h:40:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Source/WebCore/page/PageGroup.h:86:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Source/WebCore/page/PageGroup.h:89:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Total errors found: 7 in 19 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Early Warning System Bot 2012-10-14 14:34:59 PDT
Comment on attachment 168590 [details]
Patch

Attachment 168590 [details] did not pass qt-ews (qt):
Output: http://queues.webkit.org/results/14293537
Comment 4 Sam Weinig 2012-10-14 14:38:16 PDT
Created attachment 168592 [details]
Patch
Comment 5 Tim Horton 2012-10-14 14:40:45 PDT
View in context: https://bugs.webkit.org/attachment.cgi?id=168590&action=review

r=me assuming you've just managed to fix the build issues.

> Source/WebCore/ChangeLog:34
> +        (WebCore::PageGroup::addUserScriptToWorld):
> +        (WebCore::PageGroup::addUserStyleSheetToWorld):
> +        * page/PageGroup.h:
> +        (PageGroup):
> +        * page/UserContentURLPattern.cpp:
> +        (WebCore::UserContentURLPattern::matchesPatterns):
> +        * page/UserContentURLPattern.h:
> +        (UserContentURLPattern):
> +        Update to not assume whitelist and blacklist are in Vector<String>*.
> +
> +        * page/UserScript.h:
> +        (UserScript):
> +        (WebCore::UserScript::UserScript):
> +        (WebCore::UserScript::whitelist):
> +        (WebCore::UserScript::blacklist):
> +        * page/UserStyleSheet.h:
> +        (UserStyleSheet):
> +        (WebCore::UserStyleSheet::UserStyleSheet):
> +        (WebCore::UserStyleSheet::whitelist):
> +        (WebCore::UserStyleSheet::blacklist):

Dan would not be happy about this lack of per-function comments.

> Source/WebCore/page/UserContentURLPattern.cpp:39
> +        for (unsigned i = 0; i < whitelist.size(); ++i) {

I know you're not introducing this, but should we save size aside instead of computing it every time?

>> Source/WebCore/page/UserScript.h:40
>> +               const Vector<String>& whitelist, const Vector<String>& blacklist,
> 
> Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]

Stylebot is right, why are these all lined up? That is unusual for WebCore.
Comment 6 WebKit Review Bot 2012-10-14 14:41:26 PDT
Attachment 168592 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1
Source/WebCore/page/PageGroup.cpp:265:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Source/WebCore/page/PageGroup.cpp:280:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Source/WebCore/page/UserStyleSheet.h:40:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp:299:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Source/WebCore/page/UserScript.h:40:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Source/WebCore/page/PageGroup.h:86:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Source/WebCore/page/PageGroup.h:89:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Total errors found: 7 in 21 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 7 Sam Weinig 2012-10-14 14:55:48 PDT
Committed r131275: <http://trac.webkit.org/changeset/131275>