Closed
Bug 838124
Opened 12 years ago
Closed 12 years ago
Convert BatteryManager to WebIDL
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla21
People
(Reporter: baku, Assigned: baku)
References
Details
Attachments
(1 file, 2 obsolete files)
|
16.20 KB,
patch
|
peterv
:
review+
|
Details | Diff | Splinter Review |
No description provided.
| Assignee | ||
Comment 1•12 years ago
|
||
Attachment #710144 -
Flags: review?(peterv)
Comment 2•12 years ago
|
||
Comment on attachment 710144 [details] [diff] [review]
patch
Review of attachment 710144 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/battery/BatteryManager.cpp
@@ +11,5 @@
> #include "nsDOMEvent.h"
> #include "mozilla/Preferences.h"
> #include "nsDOMEventTargetHelper.h"
>
> +#include "mozilla/dom/BatteryManagerBinding.h"
nit: please, don't leave an empty line before that #include.
::: dom/battery/Makefile.in
@@ +19,5 @@
>
> EXPORTS_NAMESPACES = mozilla/dom/battery
>
> EXPORTS_mozilla/dom/battery = \
> + BatteryManager.h \
Why are you doing that? BatteryManager.h wasn't exported on purpose.
Comment 3•12 years ago
|
||
Comment on attachment 710144 [details] [diff] [review]
patch
Review of attachment 710144 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/battery/BatteryManager.cpp
@@ +65,2 @@
> {
> + return mCharging;
I'd inline this.
@@ +68,5 @@
>
> +double
> +BatteryManager::Level() const
> +{
> + return mLevel;
I'd inline this.
::: dom/battery/BatteryManager.h
@@ +21,5 @@
> class BatteryInformation;
> } // namespace hal
>
> namespace dom {
> namespace battery {
It would be nice to remove the battery namespace, it would allow us to not need the change to Bindings.conf. In general we put everything directly in the mozilla::dom namespace. Either do that here or file a new bug.
Attachment #710144 -
Flags: review?(peterv) → review+
Comment 4•12 years ago
|
||
(In reply to Mounir Lamouri (:mounir) from comment #2)
> Why are you doing that? BatteryManager.h wasn't exported on purpose.
Because the binding needs access to the header.
Comment 5•12 years ago
|
||
(In reply to Peter Van der Beken [:peterv] from comment #3)
> It would be nice to remove the battery namespace, it would allow us to not
> need the change to Bindings.conf. In general we put everything directly in
> the mozilla::dom namespace. Either do that here or file a new bug.
That would be nice, indeed.
(In reply to Peter Van der Beken [:peterv] from comment #4)
> (In reply to Mounir Lamouri (:mounir) from comment #2)
> > Why are you doing that? BatteryManager.h wasn't exported on purpose.
>
> Because the binding needs access to the header.
Sure, but can't we simply -Idom/battery/ for bindings? exporting BatteryManager.h makes it usable by anyone using the Mozilla Platform (if such thing still exists).
Comment 6•12 years ago
|
||
> Sure, but can't we simply -Idom/battery/ for bindings? exporting
> BatteryManager.h makes it usable by anyone using the Mozilla Platform (if
> such thing still exists).
In general we've just exported stuff. I don't really care either way I think.
| Assignee | ||
Comment 7•12 years ago
|
||
Attachment #710144 -
Attachment is obsolete: true
Attachment #710152 -
Flags: review+
| Assignee | ||
Comment 8•12 years ago
|
||
A new patch with -Idom/battery will be submitted soon.
| Assignee | ||
Comment 9•12 years ago
|
||
another quick review for -Ifoo/bar ?
Attachment #710152 -
Attachment is obsolete: true
Attachment #710157 -
Flags: review?(peterv)
Updated•12 years ago
|
Attachment #710157 -
Flags: review?(peterv) → review+
| Assignee | ||
Updated•12 years ago
|
Keywords: checkin-needed
Comment 10•12 years ago
|
||
Keywords: checkin-needed
Comment 11•12 years ago
|
||
Comment on attachment 710157 [details] [diff] [review]
patch
Review of attachment 710157 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/webidl/BatteryManager.webidl
@@ +9,5 @@
> + * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
> + * liability, trademark and document use rules apply.
> + */
> +
> +[NoInterfaceObject]
Why would you do that?
| Assignee | ||
Comment 12•12 years ago
|
||
This is part of the webIDL in the specs: http://www.w3.org/TR/battery-status/
Comment 13•12 years ago
|
||
Wait. That spec makes no sense. Why is it not just "partial interface Navigator"?
Comment 14•12 years ago
|
||
Oh, wait. NavigatorBattery shouldn't exist. It should just be "partial interface Navigator". No opinion on BatteryManager per se, though I agree that it's odd to mark it as NoInterfaceObject.
Comment 15•12 years ago
|
||
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla21
Comment 16•12 years ago
|
||
Spec has been fixed: no longer using [NoInterfaceObject] and "Navigator implements ..." has been changed to "partial interface Navigator".
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•