Bug 146257 - Building MediaDeviceInfo for enumerateDevices
Summary: Building MediaDeviceInfo for enumerateDevices
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Matthew Daiter
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-06-23 15:50 PDT by Matthew Daiter
Modified: 2015-06-26 10:34 PDT (History)
9 users (show)

See Also:


Attachments
Patch (10.77 KB, patch)
2015-06-24 01:11 PDT, Matthew Daiter
no flags Details | Formatted Diff | Diff
Patch (10.71 KB, patch)
2015-06-24 07:35 PDT, Matthew Daiter
no flags Details | Formatted Diff | Diff
Patch (10.71 KB, patch)
2015-06-24 09:11 PDT, Matthew Daiter
no flags Details | Formatted Diff | Diff
Patch (13.18 KB, patch)
2015-06-24 10:05 PDT, Matthew Daiter
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Daiter 2015-06-23 15:50:46 PDT
Needed to create MediaDeviceInfo files in Javascript to ensure that methods like enumarateDevices can work.
Comment 1 Matthew Daiter 2015-06-23 15:51:15 PDT
(In reply to comment #0)
> Needed to create MediaDeviceInfo files in Javascript to ensure that methods
> like enumarateDevices can work.

Should be "MediaDeviceInfo class in Javascript"
Comment 2 Radar WebKit Bug Importer 2015-06-23 15:54:16 PDT
<rdar://problem/21513462>
Comment 3 Matthew Daiter 2015-06-24 01:11:10 PDT
Created attachment 255475 [details]
Patch
Comment 4 Csaba Osztrogonác 2015-06-24 05:05:20 PDT
Comment on attachment 255475 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=255475&action=review

> Source/WebCore/Modules/mediastream/MediaDeviceInfo.cpp:14
> +#include "ContextDescructionObserver.h"

typo: ContextDes_c_ructionObserver : c -> t

How come the build worked on Mac?

> Source/WebCore/Modules/mediastream/MediaDeviceInfo.h:14
> +#include "ContextDescructionObserver.h"

ditto

> Source/WebCore/Modules/mediastream/MediaDeviceInfo.h:21
> +class MediaDeviceInfo : public RefCounted<MediaDeviceInfo>, public ScriptWrappable, public ContextDescructionObserver {

ditto
Comment 5 Matthew Daiter 2015-06-24 07:35:07 PDT
Created attachment 255481 [details]
Patch
Comment 6 Matthew Daiter 2015-06-24 07:35:50 PDT
Sorry, was typo. Fixed now.
Comment 7 Eric Carlson 2015-06-24 08:22:46 PDT
Comment on attachment 255481 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=255481&action=review

> Source/WebCore/Modules/mediastream/MediaDeviceInfo.h:39
> +    const String& m_label;
> +    const String& m_deviceId;
> +    const String& m_groupId;
> +    const String& m_kind;

Do you really want these to be const string *references*?
Comment 8 Csaba Osztrogonác 2015-06-24 08:26:35 PDT
The EFL/GTK build is still broken:
Source/WebCore/Modules/mediastream/MediaDeviceInfo.h:40:1: error: expected ';' after class definition

Please fix them before landing. How come Mac build isn't broken?
Have you tested with ENABLE(MEDIA_STREAM) == true configuration?
Comment 9 Matthew Daiter 2015-06-24 09:11:42 PDT
Created attachment 255484 [details]
Patch
Comment 10 Csaba Osztrogonác 2015-06-24 09:52:08 PDT
Comment on attachment 255484 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=255484&action=review

> Source/WebCore/ChangeLog:3
> +        Adding MediaDeviceInfo.

It should be exactly the title of the bug report: "Building MediaDeviceInfo for enumerateDevices"

> Source/WebCore/Modules/mediastream/MediaDeviceInfo.cpp:7
> +//
> +//  MediaDeviceInfo.cpp
> +//  WebCore
> +//
> +//  Created by Matt Daiter on 6/23/15.
> +//
> +//

Please remove these lines and add proper copyright and license here.

> Source/WebCore/Modules/mediastream/MediaDeviceInfo.h:7
> +//
> +//  MediaDeviceInfo.h
> +//  WebCore
> +//
> +//  Created by Matt Daiter on 6/23/15.
> +//
> +//

ditto
Comment 11 Matthew Daiter 2015-06-24 10:05:51 PDT
Created attachment 255488 [details]
Patch
Comment 12 Eric Carlson 2015-06-24 12:49:16 PDT
Comment on attachment 255488 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=255488&action=review

> Source/WebCore/Modules/mediastream/MediaDeviceInfo.h:38
> +class MediaDeviceInfo : public RefCounted<MediaDeviceInfo>, public ScriptWrappable, public ContextDestructionObserver {

Why does this class inherit from ContextDestructionObserver, will it need to override contextDestroyed() later?

> Source/WebCore/Modules/mediastream/MediaDeviceInfo.h:42
> +    

Nit: this extra blank line isn't necessary.

> Source/WebCore/Modules/mediastream/MediaDeviceInfo.idl:2
> +[
> +NoInterfaceObject,

.idl files need a copyright header too.

> Source/WebCore/Modules/mediastream/MediaDeviceInfo.idl:10
> +    readonly    attribute DOMString deviceId;
> +    readonly    attribute DOMString groupId;
> +    readonly    attribute DOMString kind;
> +    readonly    attribute DOMString label;

Nit: I don't think the extra spaces between "readonly" and "attribute" are necessary.
Comment 13 Matthew Daiter 2015-06-24 17:25:35 PDT
(In reply to comment #12)
> Comment on attachment 255488 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=255488&action=review
> 
> > Source/WebCore/Modules/mediastream/MediaDeviceInfo.h:38
> > +class MediaDeviceInfo : public RefCounted<MediaDeviceInfo>, public ScriptWrappable, public ContextDestructionObserver {
> 
> Why does this class inherit from ContextDestructionObserver, will it need to
> override contextDestroyed() later?
> 
Good point! Won't include in the next update. I believe that while debugging I had been experimenting with using it for destroying pointers to strings to free space. Next time, I won't inherit from it unless necessary.
> > Source/WebCore/Modules/mediastream/MediaDeviceInfo.h:42
> > +    
> 
Sure. I can remove this.
> Nit: this extra blank line isn't necessary.
> 
> > Source/WebCore/Modules/mediastream/MediaDeviceInfo.idl:2
> > +[
> > +NoInterfaceObject,
> 
> .idl files need a copyright header too.
> 
Will do.
> > Source/WebCore/Modules/mediastream/MediaDeviceInfo.idl:10
> > +    readonly    attribute DOMString deviceId;
> > +    readonly    attribute DOMString groupId;
> > +    readonly    attribute DOMString kind;
> > +    readonly    attribute DOMString label;
> 
> Nit: I don't think the extra spaces between "readonly" and "attribute" are
> necessary.
Sorry, will remove on next patch submit
Comment 14 WebKit Commit Bot 2015-06-24 17:26:45 PDT
Comment on attachment 255488 [details]
Patch

Rejecting attachment 255488 [details] from commit-queue.

mdaiter@apple.com does not have committer permissions according to http://trac.webkit.org/browser/trunk/Tools/Scripts/webkitpy/common/config/contributors.json.

- If you do not have committer rights please read http://webkit.org/coding/contributing.html for instructions on how to use bugzilla flags.

- If you have committer rights please correct the error in Tools/Scripts/webkitpy/common/config/contributors.json by adding yourself to the file (no review needed).  The commit-queue restarts itself every 2 hours.  After restart the commit-queue will correctly respect your committer rights.
Comment 15 WebKit Commit Bot 2015-06-24 18:15:50 PDT
Comment on attachment 255488 [details]
Patch

Clearing flags on attachment: 255488

Committed r185940: <http://trac.webkit.org/changeset/185940>
Comment 16 WebKit Commit Bot 2015-06-24 18:15:54 PDT
All reviewed patches have been landed.  Closing bug.
Comment 17 Chris Dumez 2015-06-24 22:18:02 PDT
This broke builds on several bots. I landed several build fixes (more may be needed):
<https://trac.webkit.org/r185944>
<https://trac.webkit.org/r185945>

I am not sure why EWS did not complain on GTK/EFL.
Comment 18 Chris Dumez 2015-06-24 22:22:26 PDT
(In reply to comment #17)
> This broke builds on several bots. I landed several build fixes (more may be
> needed):
> <https://trac.webkit.org/r185944>
> <https://trac.webkit.org/r185945>
> 
> I am not sure why EWS did not complain on GTK/EFL.

and <http://trac.webkit.org/changeset/185946>...
Comment 19 Csaba Osztrogonác 2015-06-25 01:35:43 PDT
(In reply to comment #18)
> (In reply to comment #17)
> > This broke builds on several bots. I landed several build fixes (more may be
> > needed):
> > <https://trac.webkit.org/r185944>
> > <https://trac.webkit.org/r185945>
> > 
> > I am not sure why EWS did not complain on GTK/EFL.
> 
> and <http://trac.webkit.org/changeset/185946>...

It seems the build was broken only on the GTK debug bot. How is it 
possible? Is this feature used somewhere or is it simple dead code?
Comment 20 Csaba Osztrogonác 2015-06-25 02:15:03 PDT
(In reply to comment #19)
> It seems the build was broken only on the GTK debug bot. How is it 
> possible? Is this feature used somewhere or is it simple dead code?

I built r185940 (EFL) and build works fine. It seems JSMediaDeviceInfo.cpp
(generated from the idl file) doesn't use MediaDeviceInfo::MediaDeviceInfo
and MediaDeviceInfo::create at all. Is it normal behaviour?
Comment 21 Csaba Osztrogonác 2015-06-25 02:19:03 PDT
Just out of curiosity: Was this patch tested/built on Mac with enabled MEDIA_STREAM ? Can we add a layout test to check if it works or not?
Comment 22 Matthew Daiter 2015-06-26 10:34:23 PDT
Hey,
Planning on tackling larger problems, which uses MediaDeviceInfo. Dead code now, not dead code later.