Re: Suggesting new name for nsIDOMEvent::GetInternalNSEvent

2016-02-11 Thread Aidin Gharibnavaz
Yes, these are two different objects, so As* seems not right here.

Unfortunately,WidgetEventPtr is already used as the name of a pointer in
this IDL. So far, WidgetEventRef is selected.

On Thu, Feb 11, 2016 at 10:23 AM, Bobby Holley 
wrote:

> IMO, As* generally implies a cast between two different types for the same
> underlying object, or at least a reflexive conversion between two different
> "view" (for some fuzzy definition of that). Even in cases where we have two
> objects with a 1-to-1 correspondence, As* feels inappropriate to me. For
> example, both Document::AsRootElement or nsDocShell::AsOuterWindow seem
> like misleading names given how the data structures are set up.
>
> I'm assuming here that Aidin is dealing with two different objects. If
> not, As* is clearly fine.
>
> On Wed, Feb 10, 2016 at 10:02 PM, Kyle Huey  wrote:
>
>> What's wrong with AsWidgetEvent? We do AsFoo a fair bit.
>>
>> - Kyle
>> On Feb 10, 2016 8:58 PM, "Aidin Gharibnavaz"  wrote:
>>
>> > In Bug 1235830 ,
>> I'm
>> > going to rename this method to something more meaningful. I need
>> suggestion
>> > about what the name should be.
>> >
>> > Summary of the discussion so far:
>> >
>> > * WidgetEvent() can't be used, since it's also the name of a type.
>> > * GetWidgetEvent() is good, but may suggests that method can return
>> > nullptr.
>> > * AsWidgetEvent() don't have this ambiguousness, but is not a good name.
>> >
>> > Any other ideas?
>> > ___
>> > dev-platform mailing list
>> > dev-platform@lists.mozilla.org
>> > https://lists.mozilla.org/listinfo/dev-platform
>> >
>> ___
>> dev-platform mailing list
>> dev-platform@lists.mozilla.org
>> https://lists.mozilla.org/listinfo/dev-platform
>>
>
>
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Suggesting new name for nsIDOMEvent::GetInternalNSEvent

2016-02-10 Thread Aidin Gharibnavaz
In Bug 1235830 , I'm
going to rename this method to something more meaningful. I need suggestion
about what the name should be.

Summary of the discussion so far:

* WidgetEvent() can't be used, since it's also the name of a type.
* GetWidgetEvent() is good, but may suggests that method can return nullptr.
* AsWidgetEvent() don't have this ambiguousness, but is not a good name.

Any other ideas?
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: Suggesting new name for nsIDOMEvent::GetInternalNSEvent

2016-02-10 Thread Bobby Holley
I tend to use the WidgetEventPtr() or WidgetEventRef() for situations where
I need a decorator to avoid colliding with the type name. Maybe try that?

bholley

On Wed, Feb 10, 2016 at 8:57 PM, Aidin Gharibnavaz 
wrote:

> In Bug 1235830 , I'm
> going to rename this method to something more meaningful. I need suggestion
> about what the name should be.
>
> Summary of the discussion so far:
>
> * WidgetEvent() can't be used, since it's also the name of a type.
> * GetWidgetEvent() is good, but may suggests that method can return
> nullptr.
> * AsWidgetEvent() don't have this ambiguousness, but is not a good name.
>
> Any other ideas?
> ___
> dev-platform mailing list
> dev-platform@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-platform
>
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: Suggesting new name for nsIDOMEvent::GetInternalNSEvent

2016-02-10 Thread Bobby Holley
IMO, As* generally implies a cast between two different types for the same
underlying object, or at least a reflexive conversion between two different
"view" (for some fuzzy definition of that). Even in cases where we have two
objects with a 1-to-1 correspondence, As* feels inappropriate to me. For
example, both Document::AsRootElement or nsDocShell::AsOuterWindow seem
like misleading names given how the data structures are set up.

I'm assuming here that Aidin is dealing with two different objects. If not,
As* is clearly fine.

On Wed, Feb 10, 2016 at 10:02 PM, Kyle Huey  wrote:

> What's wrong with AsWidgetEvent? We do AsFoo a fair bit.
>
> - Kyle
> On Feb 10, 2016 8:58 PM, "Aidin Gharibnavaz"  wrote:
>
> > In Bug 1235830 ,
> I'm
> > going to rename this method to something more meaningful. I need
> suggestion
> > about what the name should be.
> >
> > Summary of the discussion so far:
> >
> > * WidgetEvent() can't be used, since it's also the name of a type.
> > * GetWidgetEvent() is good, but may suggests that method can return
> > nullptr.
> > * AsWidgetEvent() don't have this ambiguousness, but is not a good name.
> >
> > Any other ideas?
> > ___
> > dev-platform mailing list
> > dev-platform@lists.mozilla.org
> > https://lists.mozilla.org/listinfo/dev-platform
> >
> ___
> dev-platform mailing list
> dev-platform@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-platform
>
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: Suggesting new name for nsIDOMEvent::GetInternalNSEvent

2016-02-10 Thread Kyle Huey
What's wrong with AsWidgetEvent? We do AsFoo a fair bit.

- Kyle
On Feb 10, 2016 8:58 PM, "Aidin Gharibnavaz"  wrote:

> In Bug 1235830 , I'm
> going to rename this method to something more meaningful. I need suggestion
> about what the name should be.
>
> Summary of the discussion so far:
>
> * WidgetEvent() can't be used, since it's also the name of a type.
> * GetWidgetEvent() is good, but may suggests that method can return
> nullptr.
> * AsWidgetEvent() don't have this ambiguousness, but is not a good name.
>
> Any other ideas?
> ___
> dev-platform mailing list
> dev-platform@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-platform
>
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform