Closed
Bug 860940
Opened 12 years ago
Closed 12 years ago
Replace AndroidGeckoEvent constructors with static factory methods
Categories
(Core Graveyard :: Widget: Android, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla23
People
(Reporter: kats, Assigned: kats)
References
Details
Attachments
(1 file)
11.26 KB,
patch
|
cpeterson
:
review+
|
Details | Diff | Splinter Review |
This is the equivalent of bug 725538 but for the JNI wrapper. We have a bunch of AndroidGeckoEvent constructors (and I'll be adding one more in a future bug) and I think it makes more sense to have factory-style methods instead because they can be given meaningful names.
Attachment #736510 -
Flags: review?(cpeterson)
Assignee | ||
Comment 1•12 years ago
|
||
(Note: this patch depends on the patches in bug 859951 to apply cleanly)
Comment 2•12 years ago
|
||
Comment on attachment 736510 [details] [diff] [review]
Convert constructors to static factory methods
Review of attachment 736510 [details] [diff] [review]:
-----------------------------------------------------------------
LGTM
::: widget/android/AndroidJavaWrappers.h
@@ +621,3 @@
> }
> +
> + static AndroidGeckoEvent* MakeFromJava(JNIEnv *jenv, jobject jobj) {
I think the name `MakeFromJava()` is unclear. How about something like `MakeFromJavaObject()`?
@@ +627,4 @@
> }
>
> + static AndroidGeckoEvent* CopyResizeEvent(AndroidGeckoEvent *aResizeEvent) {
> + AndroidGeckoEvent* event = new AndroidGeckoEvent();
Your patch is inconsistent in its use of whitespace before or after * in pointer declarations. I don't really care which style you use, but new code should be consistent. I think Gecko style is whitespace after the *.
Attachment #736510 -
Flags: review?(cpeterson) → review+
Assignee | ||
Comment 3•12 years ago
|
||
(In reply to Chris Peterson (:cpeterson) from comment #2)
> I think the name `MakeFromJava()` is unclear. How about something like
> `MakeFromJavaObject()`?
Done, thanks.
> Your patch is inconsistent in its use of whitespace before or after * in
> pointer declarations. I don't really care which style you use, but new code
> should be consistent. I think Gecko style is whitespace after the *.
I usually also default to space after the * but it looks like most of our widget code does the opposite, hence the inconsistency. I modified my new code to use the existing style (space before *).
Will land once bug 859951 is in to avoid having to rebase.
Assignee | ||
Comment 4•12 years ago
|
||
Comment 5•12 years ago
|
||
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla23
Updated•3 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•