Bug 41385 - [chromium] Make the user script API static.
Summary: [chromium] Make the user script API static.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit API (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-29 17:49 PDT by Aaron Boodman
Modified: 2010-07-01 00:53 PDT (History)
5 users (show)

See Also:


Attachments
Patch (4.93 KB, patch)
2010-06-29 18:03 PDT, Aaron Boodman
no flags Details | Formatted Diff | Diff
Patch (4.94 KB, patch)
2010-06-29 18:14 PDT, Aaron Boodman
no flags Details | Formatted Diff | Diff
Patch for landing (5.92 KB, patch)
2010-06-30 17:57 PDT, Aaron Boodman
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Aaron Boodman 2010-06-29 17:49:06 PDT
In Chromium, we want to push user scripts down into webcore prior to having a WebView instance. Since these methods are modifying global state, it is more convenient if they are static.
Comment 1 Aaron Boodman 2010-06-29 18:03:56 PDT
Created attachment 60074 [details]
Patch
Comment 2 Aaron Boodman 2010-06-29 18:14:28 PDT
Created attachment 60075 [details]
Patch
Comment 3 Adam Barth 2010-06-29 18:18:04 PDT
Comment on attachment 60075 [details]
Patch

Looks good to me, but we need fishd here.
Comment 4 WebKit Review Bot 2010-06-29 18:46:44 PDT
Attachment 60075 [details] did not build on chromium:
Build output: http://webkit-commit-queue.appspot.com/results/3373026
Comment 5 Darin Fisher (:fishd, Google) 2010-06-30 10:03:49 PDT
Comment on attachment 60075 [details]
Patch

WebKit/chromium/src/WebViewImpl.cpp:1976
 +      Vector<String>* patterns = new Vector<String>;
nit: use OwnPtr here?

WebKit/chromium/src/WebViewImpl.cpp:1988
 +      Vector<String>* patterns = new Vector<String>;
nit: use OwnPtr here?

i realize that your code is correct, but if someone ever added an early
return it would suddenly start leaking memory.  plus, i was only able
to convince myself that your code was safe by checking the signature
of addUser{Script,StyleSheet}ToWorld to see that it takes a PassOwnPtr
parameter.

r=me otherwise
Comment 6 Darin Fisher (:fishd, Google) 2010-06-30 10:04:34 PDT
one other nit, please put the term DEPRECATED in your FIXME comment about the removal of those non-static methods.  that way it is easy to find deprecated stuff in the future.
Comment 7 Aaron Boodman 2010-06-30 17:57:52 PDT
Created attachment 60176 [details]
Patch for landing
Comment 8 WebKit Commit Bot 2010-07-01 00:53:39 PDT
Comment on attachment 60176 [details]
Patch for landing

Clearing flags on attachment: 60176

Committed r62234: <http://trac.webkit.org/changeset/62234>
Comment 9 WebKit Commit Bot 2010-07-01 00:53:44 PDT
All reviewed patches have been landed.  Closing bug.