As a security precaution, we have turned on the setting "Require API key authentication for API requests" for everyone. If this has broken something, please contact bugzilla-admin@mozilla.org
Last Comment Bug 764682 - Implement wifi events in c++
: Implement wifi events in c++
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: DOM: Device Interfaces (show other bugs)
: unspecified
: x86 Mac OS X
: -- normal (vote)
: mozilla16
Assigned To: Gregor Wagner [:gwagner]
:
: Andrew Overholt [:overholt]
Mentors:
: 764479 (view as bug list)
Depends on: 764928
Blocks: 766497 766500
  Show dependency treegraph
 
Reported: 2012-06-13 18:58 PDT by Gregor Wagner [:gwagner]
Modified: 2012-06-20 02:22 PDT (History)
4 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
v1 (29.54 KB, patch)
2012-06-14 15:52 PDT, Gregor Wagner [:gwagner]
no flags Details | Diff | Splinter Review
patch (27.74 KB, patch)
2012-06-14 16:47 PDT, Gregor Wagner [:gwagner]
bugs: review-
Details | Diff | Splinter Review
patch (28.17 KB, patch)
2012-06-15 11:35 PDT, Gregor Wagner [:gwagner]
bugs: review+
Details | Diff | Splinter Review

Description User image Gregor Wagner [:gwagner] 2012-06-13 18:58:28 PDT

    
Comment 1 User image Gregor Wagner [:gwagner] 2012-06-13 19:41:02 PDT
This depends on 
ifdef MOZ_B2G_RIL
Lots and lots of ifdefs... Blake do you have an idea how to avoid them?
Comment 2 User image Gregor Wagner [:gwagner] 2012-06-14 15:52:33 PDT
Created attachment 633303 [details] [diff] [review]
v1
Comment 3 User image Gregor Wagner [:gwagner] 2012-06-14 16:47:56 PDT
Created attachment 633316 [details] [diff] [review]
patch
Comment 4 User image Olli Pettay [:smaug] (review queue closed until backlog cleared) 2012-06-15 01:55:09 PDT
Comment on attachment 633316 [details] [diff] [review]
patch


>+NS_IMETHODIMP
>+nsDOMMozWifiStatusChangeEvent::InitMozWifiStatusChangeEvent(const nsAString& aType,
>+                                                            bool aCanBubble,
>+                                                            bool aCancelable,
>+                                                            nsIVariant *aNetwork,
Nit, nsIVariant* aNetwork

>diff -r 35c79f50d85f dom/interfaces/events/nsIWifiEvents.idl
>--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
>+++ b/dom/interfaces/events/nsIWifiEvents.idl	Thu Jun 14 16:47:14 2012 -0700
>@@ -0,0 +1,75 @@
>+/* This Source Code Form is subject to the terms of the Mozilla Public
>+ * License, v. 2.0. If a copy of the MPL was not distributed with this
>+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
>+
>+#include "nsISupports.idl"
>+#include "nsIDOMEventTarget.idl"
>+#include "nsIDOMEvent.idl"
>+
>+interface nsIVariant;
>+
>+[scriptable, builtinclass, uuid(5b8eaf12-08fb-4cba-b641-4d0b6aac3505)]
>+interface nsIDOMMozWifiStatusChangeEvent : nsIDOMEvent {
{ should be in the next line


I think the easiest way to handle b2g is to put dictionaries to separate .idl
Then the .idl which has the event interfaces would be built only with b2g,
since those interfaces end up to global scope.
Dictionaries can be built always, since they don't end up to global scope.



(I should write a script to automatically implement these kinds of simple events inheriting nsIDOMEvent)
Comment 5 User image Gregor Wagner [:gwagner] 2012-06-15 11:35:26 PDT
Created attachment 633601 [details] [diff] [review]
patch
Comment 6 User image Olli Pettay [:smaug] (review queue closed until backlog cleared) 2012-06-15 13:50:42 PDT
Comment on attachment 633601 [details] [diff] [review]
patch


>+  mozilla::dom::MozWifiConnectionInfoEventInit d;
>+  nsresult rv = d.Init(aCx, aVal);
>+  NS_ENSURE_SUCCESS(rv, rv);
>+  return InitMozWifiConnectionInfoEvent(aType, d.bubbles, d.cancelable, d.network, d.signalStrength, d.relSignalStrength, d.linkSpeed);
Is this overlong line?

>+++ b/dom/interfaces/events/nsIWifiEvents.idl	Fri Jun 15 11:34:25 2012 -0700
Hmm, this should be now called something else.
nsIWifiEventInits.idl ?
Comment 7 User image Gregor Wagner [:gwagner] 2012-06-16 11:16:08 PDT
> (I should write a script to automatically implement these kinds of simple
> events inheriting nsIDOMEvent)

That would be great :) Thanks for the quick review!


https://hg.mozilla.org/integration/mozilla-inbound/rev/75739012a1a6
Comment 8 User image Gregor Wagner [:gwagner] 2012-06-16 11:48:50 PDT
Followup for B2G build
https://hg.mozilla.org/integration/mozilla-inbound/rev/a217eba61a59
Comment 10 User image Gregor Wagner [:gwagner] 2012-06-18 21:20:55 PDT
*** Bug 764479 has been marked as a duplicate of this bug. ***
Comment 11 User image Tim Guan-tin Chien [:timdream] (please needinfo) 2012-06-19 07:35:21 PDT
@gwagner, |wifiManager.connectionInfoUpdate| is not getting called every 5 sec as documented on idl. Lastest m-c, this fix is included. Do you have any idea?

https://github.com/mozilla-b2g/gaia/issues/1778
Comment 12 User image Tim Guan-tin Chien [:timdream] (please needinfo) 2012-06-19 08:39:57 PDT
also, |wifiManager.enabled| is always false, for no apparent reason. :(
Comment 13 User image Blake Kaplan (:mrbkap) 2012-06-19 11:45:34 PDT
Tim, can you file a new bug on that and CC me?

Note You need to log in before you can comment on or make changes to this bug.