Re: The Object performance are 5-100 times slower than Chrome. Array is a bit slow, map is faster, uint32array are 5 times faster.

2016-03-08 Thread Jan de Mooij
On Mon, Mar 7, 2016 at 10:42 PM, 罗勇刚(Yonggang Luo) 
wrote:

> My conclution: we really need improve the performance of Object,
> cause that's the most frequently used Thing.
>

I agree plain objects are among "the most frequently used objects", but
here you're using them as arrays and that's not how plain objects are
typically used. Performance of setting indexed properties is mostly
unrelated to setting named properties.

That said, it's a valid performance issue so I filed bug 1254436 [0].
Thanks for reporting this. Next time you run into a JS (performance) issue,
please file a bug in the 'Core: JavaScript Engine' component :)

Thanks,
Jan

[0] https://bugzilla.mozilla.org/show_bug.cgi?id=1254436


> ```code
>
> performanceButton.onclick = function () {
>   let startTime = Date.now()
>   ChromeSamples.setStatus(`Start performance testing at time
> ${startTime}`);
>   function testArray(count) {
> let startTime = Date.now()
> let a = []
> for (let i = 0; i < count; ++i) {
>   a[i] = i + 1
> }
> return Date.now() - startTime
>   }
>   function testObject(count) {
> let startTime = Date.now()
> let a = {}
> for (let i = 0; i < count; ++i) {
>   a[i] = i + 1
> }
> return Date.now() - startTime
>   }
>   function testObjectSingle(count) {
> let startTime = Date.now()
> let a = {}
> for (let i = 0; i < count; ++i) {
>   a[0] = i + 1
> }
> return Date.now() - startTime
>   }
>   function testMap(count) {
> let startTime = Date.now()
> let a = new Map()
> for (let i = 0; i < count; ++i) {
>   a.set(i, i + 1)
> }
> return Date.now() - startTime
>   }
>   function testUint32Array(count) {
> let startTime = Date.now()
> let a = new Uint32Array(count)
> for (let i = 0; i < count; ++i) {
>   a[i] = i + 1
> }
> return Date.now() - startTime
>   }
>   setTimeout(function () {
> let count = 1000
> let testResult = {
>   array: testArray(count),
>   object: testObject(count),
>   objectSingle: testObjectSingle(count),
>   map: testMap(count),
>   uint32Array: testUint32Array(count),
> }
> ChromeSamples.setStatus(`Start performance ending at time
> ${JSON.stringify(testResult)}`);
>   })
> }
> ```
> Firefox:
> Start performance ending at time Start performance ending at time
> {"array":340,"object":4762,"objectSingle":2699,"map":5151,"uint32Array":29}
> Chrome:
> Start performance ending at time
> {"array":215,"object":614,"objectSingle":49,"map":6232,"uint32Array":100}
>
> --
>  此致
> 礼
> 罗勇刚
> Yours
> sincerely,
> Yonggang Luo
> ___
> 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: now available on desktop Firefox

2016-03-08 Thread J. Ryan Stinnett
On Mon, Mar 7, 2016 at 8:00 PM, Jonas Sicking  wrote:
>
> On Mon, Mar 7, 2016 at 1:55 PM, J. Ryan Stinnett  wrote:
> > By default,  can't access the storage used by
> >  for cookies and other site data, making it hard to share page
> > state across the two browser frame types. An additional feature  > mozbrowser noisolation> has been added, which gives the frame access to the
> > same storage as . This is only meant for use on desktop
> > Firefox to allow HTML and XUL browser frames to work together.
>
> Is there a reason we couldn't make 'noisolation' the default behavior
> when  is used by chrome code.
>
> There is currently work going on in Gecko to enable use of multiple
> "cookie jars" in Firefox, this is heavily based on the cookie jar
> implementation that we wrote for FirefoxOS, but it is cleaned up and
> simplified.
>
> I suggest we use that support rather than the old FirefoxOS cookie
> jars. The main reason is that you'll have to deal with painful data
> migration once the new isolation is fully in place.
>
> In practice I expect all data in other cookie jars to be deleted
> rather than migrated at some point in the future.
>
> So what I'm suggesting is:
> * Make  act as if 'noisolation' is set when the
> element is used in chrome documents (documents with a system
> principal).

Yes, that should be fine, at least for desktop. There are some B2G
specific code paths[1] related to apps that will need some additional
work before this could be true on all platforms. I am not sure how
this would be affected by the new B2G approaches mentioned in this
thread.

I filed https://bugzilla.mozilla.org/show_bug.cgi?id=1254823 about this.

> * Add support for  similar to
>  which already exist.

This also seems reasonable and should be straightforward to add.

[1]: 
https://dxr.mozilla.org/mozilla-central/rev/05c087337043dd8e71cc27bdb5b9d55fd00aaa26/dom/base/nsFrameLoader.cpp#1640-1647

- Ryan
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: Are we in favour of implementing the client hints header?

2016-03-08 Thread Johnny Stenback
Based on what I know I'm not opposed to implementing this feature from
the point of view of whether this would be good for the web or not.
What I'd question is whether this is good use of our time given the
platform team's current focus on quality.

- jst


On Tue, Mar 8, 2016 at 3:21 PM, Martin Thomson  wrote:
> On Wed, Mar 9, 2016 at 6:42 AM, Jonas Sicking  wrote:
>> I know there's some concern that always sending CH with all requests
>> would generate too much header traffic which would be wasteful.
>
>
> We could limit the feature to h2.  (Which would also address the other
> request, which is to limit this to https://)
>
> I'm surprised that the CORS interaction hasn't been raised:
> https://github.com/httpwg/http-extensions/issues/141
> ___
> 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: Are we in favour of implementing the client hints header?

2016-03-08 Thread Martin Thomson
On Wed, Mar 9, 2016 at 6:42 AM, Jonas Sicking  wrote:
> I know there's some concern that always sending CH with all requests
> would generate too much header traffic which would be wasteful.


We could limit the feature to h2.  (Which would also address the other
request, which is to limit this to https://)

I'm surprised that the CORS interaction hasn't been raised:
https://github.com/httpwg/http-extensions/issues/141
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Tier-1 for Linux 64 Debug builds in TaskCluster on March 14 (and more!)

2016-03-08 Thread Selena Deckelmann
The time has come! We are planning to switch to Tier-1 on Treeherder for
TaskCluster Linux 64 Debug build jobs on March 14. At the same time, we
will hide the Buildbot build jobs, but continue running them.

On March 21, we plan to switch the Linux 64 Debug tests to Tier-1 and hide
the related Buildbot test jobs.

After about 30 days, we plan to disable and remove all Buildbot jobs
related to Linux Debug.



Background:

We've been running Linux 64 Debug builds and tests using TaskCluster
side-by-side with Buildbot jobs since February 18th. Some of the project
work that was done to green up the tests is documented here:
https://public.etherpad-mozilla.org/p/buildbot-to-taskcluster-migration

The new tests are running in Docker-ized environments, and the Docker
images we use are defined in-tree and publicly accessible.

This work was the culmination of many months of effort, with Joel Maher,
Dustin Mitchell and Armen Zambrano primarily focused on test migration this
quarter. Thank you to everyone who responded to NEEDINFOs, emails and pings
on IRC to help with untangling busted test runs.

On performance, we're taking a 14% hit across all the new test jobs vs. the
old jobs in Buildbot. We ran two large-scale tests to help determine where
slowness might still be lurking, and were able to find and fix many issues.
There are a handful of jobs remaining that seem significantly slower, while
others are significantly faster.  We decided that it was more important to
deprecate the old jobs and start exclusively maintaining the new jobs now,
rather than wait to resolve the remaining performance issues. Over time we
hope to address issues with the owners of the affected test suites.
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: now available on desktop Firefox

2016-03-08 Thread Jonas Sicking
On Mon, Mar 7, 2016 at 10:35 PM, Tim Guan-tin Chien
 wrote:
> I am confused. In your proposal, are you referring to the chrome
> *user/embedder* of  (e.g. shell.html), or a chrome
> *embedded* page (I am not aware of any example).

What I'm saying is that in pages that run with chrome privileges (like
shell.html or browser.xul)  will *not* change which
cookie jar is used. I.e. the appid/browserflag would be the same as
for the chrome page.

When  is used in non-chrome pages, which
currently is only possible to do using FirefoxOS privileged and
certified apps, then it would behave as it does today and thus change
which cookie jar is used.

Sounds like FirefoxOS is migrating to using chrome for the system app
and maybe a few other apps. I.e. this content will stop being run as
privileged/certified apps and will instead be run as chrome.

If that's the case then either way it will affect which cookie jar is
used by these apps. And it would also mean that it affects which
cookie jar is used by content inside the  used by
this content.

/ Jonas
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: The Object performance are 5-100 times slower than Chrome. Array is a bit slow, map is faster, uint32array are 5 times faster.

2016-03-08 Thread Nicholas Nethercote
On Wed, Mar 9, 2016 at 6:40 AM, Boris Zbarsky  wrote:
>
> That said, some of your results are a bit suspect.

Indeed, microbenchmarks like these are surprisingly difficult to write
well, and they often end up measuring something other than what the author
intends.

Microbenchmarks that are extracted from real programs -- e.g. pulling out a
"kernel" of hot code, possibly simplified -- are likely to be more useful,
though it's still possible to get them wrong too :)

Nick
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: Report from Build Team Sprint

2016-03-08 Thread Nicholas Nethercote
On Wed, Mar 9, 2016 at 7:56 AM, David Burns  wrote:

>
> we started working on
> replacing the Autoconf configure script. We are planning to replace the old
> shell and m4 code with sandboxed python, which will allow us to have
> improved performance (especially on Windows), parallel configure checks,
> better caching, and improved maintainability.
>

Speaking to the last point as someone who is not a build system peer but
nonetheless ends up mucking about with the build system a moderate amount:

- the (ongoing) conversion from Makefile.in files to (sandboxed Python)
moz.build files has made those files *much* easier to understand and modify;

- converting configure.in to sandboxed Python code should have similar
benefits.

Good stuff.

Nick
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Report from Build Team Sprint

2016-03-08 Thread David Burns
February 22-26 saw the build team gathered in San Francisco to discuss all
the work that is required to speed up developer ergonomics around building
Firefox.

After discussing all the major items of work we want to work on in the
first half of this year (of which there are many), we started working on
replacing the Autoconf configure script. We are planning to replace the old
shell and m4 code with sandboxed python, which will allow us to have
improved performance (especially on Windows), parallel configure checks,
better caching, and improved maintainability.

We have also added more support for artifact builds
.
If you use Git as part of your Firefox development, you will now be able to
get the latest artifacts for your builds. This will benefit anyone not
currently working on C++ code in Mozilla-Central. Support for C++
developers will be worked on later in the year.

We were also able to add more data points to the telemetry work. This is
still in development and being beta tested by Engineering Productivity
before we ask for more people to submit their build data.

There was also work to see if we can get speed ups by using different
versions of compilers. We are noticing huge gains by upgrading to newer
versions but some of the upgrades require some work before we can deploy
them. When we are looking to do the upgrade we will email the list to warn
you.

David Burns
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: The Object performance are 5-100 times slower than Chrome. Array is a bit slow, map is faster, uint32array are 5 times faster.

2016-03-08 Thread Boris Zbarsky

On 3/7/16 4:42 PM, 罗勇刚(Yonggang Luo)  wrote:

My conclution: we really need improve the performance of Object,


Please file a bug on JS engine.

That said, some of your results are a bit suspect.  For example, the 
"testObjectSingle" number for Chrome shows that each set takes 4.9ns on 
your hardware.  On mine, it takes 0.7ns (my number there is 7ms, not 
49ms).  0.7ns is about how long that test takes if I comment out the 
loop body entirely.  So what that test is really measuring is whether 
the JIT manages to figure out that the earlier sets are dominated by 
later ones and optimize them all out entirely.  That's a good thing to 
be able to do, but has nothing to do with the performance of property 
sets per se.


For what it's also worth, the Array test runs faster than in Chrome (by 
almost 3x) for me on Mac, while the uint32Array one runs slower by 3x...


The testObject test is definitely worth looking into, though I expect 
it's caused by bug 1091978: profile shows we keep missing in the 
SetProperty IC and having to do a vmcall.


-Boris
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: Are we in favour of implementing the client hints header?

2016-03-08 Thread Jonas Sicking
I think the idea is a good one in general, though it would be good to
get data from Google on how it's been used in practice.

It's been quite a while since I reviewed the spec, so my thoughts
below might be outdated (or I might be misremembering).

There were two things that I found unfortunate about the spec.

One was that it was a bit undefined exactly which headers to include
when. This should not be left up to UA policy, but should be clearly
defined in spec.

The spec seemed too focused on including CH headers when loading
subresources of a page. Too few headers were included when loading the
"document" (in practice, when loading the HTML). My understanding is
that UA-sniffing is quite often used to determine what HTML to serve
to a given client, which I was hoping that CH could help reduce.

I know there's some concern that always sending CH with all requests
would generate too much header traffic which would be wasteful.
However I think something like the following could work:

* Include most headers during a navigation when loading a "document".
(In gecko terms, when the nsIContentPolicy-type is TYPE_DOCUMENT or
TYPE_SUBDOCUMENT).
* Default to no CH headers being sent for other requests.
* Make it possible for the document response to opt in to which
headers should be sent for resource loads that happen inside that
document. (In gecko terms, for requests which have a loadingNode that
belongs to the given document)

/ Jonas




On Tue, Mar 8, 2016 at 5:05 AM, Xidorn Quan  wrote:
> On Tue, Mar 8, 2016 at 7:40 PM, Gervase Markham  wrote:
>
>> On 08/03/16 06:22, Andrew Overholt wrote:
>> >  Implement Client-Hints HTTP header
>> > https://bugzilla.mozilla.org/show_bug.cgi?id=935216
>>
>> Well, we are in favour of adaptive content, progressive enhancement,
>> responsive images in HTML, and feature detection. The question is
>> whether we think that these things cover all the use cases or not.
>>
>> Do we know whether anyone's using this in Chrome?
>>
>
> Chrome Platform Status has items for this feature:
> ClientHintsContentDPR:
> https://www.chromestatus.com/metrics/feature/timeline/popularity/906
> ClientHintsDPR:
> https://www.chromestatus.com/metrics/feature/timeline/popularity/835
> ClientHintsMetaAcceptCH:
> https://www.chromestatus.com/metrics/feature/timeline/popularity/904
> ClientHintsResourceWidth:
> https://www.chromestatus.com/metrics/feature/timeline/popularity/836
> ClientHintsViewportWidth:
> https://www.chromestatus.com/metrics/feature/timeline/popularity/837
>
> So it seems there were some websites tried to use this, which made its
> usage up to 0.06%, but then they abandoned. All of the features above is
> used only in ~0.0002% of pages surveyed now, which may indicate its
> unpopularity. Not sure why it was ever used in 0.06% of pages, and why
> those page abandoned it. Probably Chrome team knows.
>
> - Xidorn
> ___
> 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: call prompt service dynamically

2016-03-08 Thread Benjamin Smedberg



On 3/8/2016 7:33 AM, Tobias Wolf wrote:

We`re develping a PKCS11 modul in c/c++ for a custom card reader to support. I 
just want to display a simple dialog.
This is not a good idea. I don't believe that PKCS11 modules run on the 
UI thread and so trying to do anything with XPCOM from this thread is 
pretty much doomed. Even if this isn't the case, binary XPCOM is not 
considered a stable API and so your code would have to be recompiled for 
every release.



  The code below works great until I stay on MS Visual Studio. But our project 
is running on eclipse/gcc.

  nsCOMPtr promptService = 
do_GetService("@mozilla.org/embedcomp/prompt-service;1"));
  promptService->Alert(NULL, NULL, NULL);

I`m getting the following error during linking, that comes because of the 
different coding convention between VS and mingw/gcc on windows.


That's correct. The c++ ABI is incompatible. There is essentially no way 
to fix this. Even if you use an SDK compiled with GCC instead of MSVC, 
the vtable format for interfaces is not the same and so you won't be 
able to use them.


--BDS

___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: now available on desktop Firefox

2016-03-08 Thread Benjamin Francis
On 8 March 2016 at 06:06, Jonas Sicking  wrote:

> On Mon, Mar 7, 2016 at 9:51 PM, Tim Guan-tin Chien 
> wrote:
> > This implies the Gaia System app, which is framed by shell.html (a
> > chrome document), will switch cookie jar when the default is changed,
> > no?
>
> No, the Gaia System app doesn't run as chrome (i.e. doesn't have a
> system principal). So it would not be affected by this proposal.
>

Just a heads up that this may not be the case for much longer. As part of
the B2G OS transition project we are currently looking at making all the
Gaia system UI (at least all the certified apps with role=system) into
chrome.

I have a simple working prototype
 and
Fabrice is currently looking at getting this to work for the existing Gaia
system app. After some experimentation the approach Fabrice is taking is to
load the existing system UI using a chrome:// URL, but still inside the
 inside shell.html in order to try to maintain some
level of abstraction away from XPCOM.

The idea of this is to bring us much closer to how Firefox works (just
chrome and web content), but the upshot is that the Gaia system UI will in
fact have the system principal. This may not be a problem though, we have
no plans for data migration and we can probably share whatever Firefox does.

Ben
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: call prompt service dynamically

2016-03-08 Thread Tobias Wolf
Am Dienstag, 8. März 2016 13:40:12 UTC+1 schrieb Kyle Huey:
> You're probably just not linking to the xpcom glue library in eclipse/gcc.
> 
> - Kyle
> 
> On Tue, Mar 8, 2016 at 8:33 PM, Tobias Wolf wrote:
> 
> > We`re develping a PKCS11 modul in c/c++ for a custom card reader to
> > support. I just want to display a simple dialog. The code below works great
> > until I stay on MS Visual Studio. But our project is running on eclipse/gcc.
> >
> >  nsCOMPtr promptService = do_GetService("@
> > mozilla.org/embedcomp/prompt-service;1"));
> >  promptService->Alert(NULL, NULL, NULL);
> >
> > I`m getting the following error during linking, that comes because of the
> > different coding convention between VS and mingw/gcc on windows.
> >
> > C:/download/xulrunner-41.0b9.en-US.win64.sdk/xulrunner-sdk/include/nsCOMPtr.h:514:
> > undefined reference to
> > `nsCOMPtr_base::assign_from_gs_contractid(nsGetServiceByContractID, nsID
> > const&)'
> >
> > Am Montag, 7. März 2016 18:50:36 UTC+1 schrieb Benjamin Smedberg:
> > > On 3/7/2016 11:17 AM, Tobias Wolf wrote:
> > > > I try to call this code dynamically:
> > > >
> > > > nsCOMPtr promptService = do_GetService("@
> > mozilla.org/embedcomp/prompt-service;1"));
> > > > promptService->Alert(NULL, NULL, NULL);
> > > >
> > > > I do the following:
> > > >
> > > > nsISomeInterface* mXPTCStub;
> > > > nsresult rc;
> > > > nsXPTCVariant params[3];
> > >
> > > Why are you trying to do this? Are you writing a shim layer that
> > > connects some other dynamic/scripting language to XPCOM?
> > >
> > > >
> > > > rc = NS_GetXPTCallStub(NS_IPROMPTSERVICE_IID, proxy, );
> > > >
> > > > params[0].val.p = NULL;
> > > > params[0].type = nsXPTType::T_VOID;
> > > > params[0].flags = 0;
> > > >
> > > > params[1].val.p = (void*)title;
> > > > params[1].type = nsXPTType::T_CHAR_STR;
> > > > params[1].flags = 0;
> > > >
> > > > params[2].val.p = (void*)text;
> > > > params[2].type = nsXPTType::T_CHAR_STR;
> > > > params[2].flags = 0;
> > > >
> > > > rc = NS_InvokeByIndex(mXPTCStub, 1, 3, params);
> > > > NS_DestroyXPTCallStub(mXPTCStub);
> > > >
> > > > But I don`t know how to use NS_GetXPTCallStub!
> > > > What means the second and third parameter from NS_GetXPTCallStub?
> > >
> > > Have you read the doccomments at
> > >
> > http://mxr.mozilla.org/mozilla-central/source/xpcom/reflect/xptcall/xptcall.h#174
> > > ?
> > >
> > > If you are trying to *invoke* a method, you don't need an xptcall stub
> > > at all. You just need NS_InvokeByIndex.
> > >
> > > An XPTCall stub is used to *implement* an XPCOM object whose
> > > type/interface definition isn't known at compile time, typically by
> > > mirroring it to an underlying scriptable object. You would need to
> > > implement a c++ class which implements nsIXPTCProxy and implements
> > > CallMethod.
> > >
> > > --BDS
> > ___
> > dev-platform mailing list
> > dev-platform@lists.mozilla.org
> > https://lists.mozilla.org/listinfo/dev-platform
> >

This is my full gcc output, as you see I`m linking again -llibxpcomglue and 
-lxul, all methods are found, only the com pointer c++ class not.

g++ 
"-LC:\\Daten\\_projects\\sourcecode\\trunk\\Auth-Client\\src\\main\\resources\\win32-x86-64"
 -shared -o libAuth-Client.dll "src\\main\\cpp\\ac_ffplugin.o" 
"src\\main\\cpp\\ac_locking.o" "src\\main\\cpp\\ac_log.o" 
"src\\main\\cpp\\ac_openssl.o" "src\\main\\cpp\\ac_openssl_util.o" 
"src\\main\\cpp\\ac_ui.o" "src\\main\\cpp\\ac_webservice.o" 
"src\\main\\cpp\\ac_xmlconfig.o" "src\\main\\cpp\\stdsoap2.o" 
"src\\main\\cpp\\webservice\\CertificateServiceClientLib.o" 
"src\\main\\cpp\\webservice\\EventServiceClientLib.o" 
"src\\main\\cpp\\webservice\\SignatureServiceClientLib.o" 
"src\\main\\cpp\\webservice\\envC.o" -llibxpcomglue -lxul -llibxml2-2 
-llibeay32 -lssleay32 -llibcharset-1 -llibexpat-1 -llibiconv-2 -lliblog4c-3 
-lzlib1 -lws2_32 
src\main\cpp\ac_ui.o: In function 
`nsCOMPtr::nsCOMPtr(nsGetServiceByContractID)':
C:/download/xulrunner-41.0b9.en-US.win64.sdk/xulrunner-sdk/include/nsCOMPtr.h:514:
 undefined reference to 
`nsCOMPtr_base::assign_from_gs_contractid(nsGetServiceByContractID, nsID 
const&)'
collect2.exe: error: ld returned 1 exit status
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: Are we in favour of implementing the client hints header?

2016-03-08 Thread Xidorn Quan
On Tue, Mar 8, 2016 at 7:40 PM, Gervase Markham  wrote:

> On 08/03/16 06:22, Andrew Overholt wrote:
> >  Implement Client-Hints HTTP header
> > https://bugzilla.mozilla.org/show_bug.cgi?id=935216
>
> Well, we are in favour of adaptive content, progressive enhancement,
> responsive images in HTML, and feature detection. The question is
> whether we think that these things cover all the use cases or not.
>
> Do we know whether anyone's using this in Chrome?
>

Chrome Platform Status has items for this feature:
ClientHintsContentDPR:
https://www.chromestatus.com/metrics/feature/timeline/popularity/906
ClientHintsDPR:
https://www.chromestatus.com/metrics/feature/timeline/popularity/835
ClientHintsMetaAcceptCH:
https://www.chromestatus.com/metrics/feature/timeline/popularity/904
ClientHintsResourceWidth:
https://www.chromestatus.com/metrics/feature/timeline/popularity/836
ClientHintsViewportWidth:
https://www.chromestatus.com/metrics/feature/timeline/popularity/837

So it seems there were some websites tried to use this, which made its
usage up to 0.06%, but then they abandoned. All of the features above is
used only in ~0.0002% of pages surveyed now, which may indicate its
unpopularity. Not sure why it was ever used in 0.06% of pages, and why
those page abandoned it. Probably Chrome team knows.

- Xidorn
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: call prompt service dynamically

2016-03-08 Thread Tobias Wolf
Am Montag, 7. März 2016 18:50:36 UTC+1 schrieb Benjamin Smedberg:
> On 3/7/2016 11:17 AM, Tobias Wolf wrote:
> > I try to call this code dynamically:
> >
> > nsCOMPtr promptService = 
> > do_GetService("@mozilla.org/embedcomp/prompt-service;1"));
> > promptService->Alert(NULL, NULL, NULL);
> >
> > I do the following:
> >
> > nsISomeInterface* mXPTCStub;
> > nsresult rc;
> > nsXPTCVariant params[3];
> 
> Why are you trying to do this? Are you writing a shim layer that 
> connects some other dynamic/scripting language to XPCOM?
> 
> >
> > rc = NS_GetXPTCallStub(NS_IPROMPTSERVICE_IID, proxy, );
> >
> > params[0].val.p = NULL;
> > params[0].type = nsXPTType::T_VOID;
> > params[0].flags = 0;
> >
> > params[1].val.p = (void*)title;
> > params[1].type = nsXPTType::T_CHAR_STR;
> > params[1].flags = 0;
> >
> > params[2].val.p = (void*)text;
> > params[2].type = nsXPTType::T_CHAR_STR;
> > params[2].flags = 0;
> >
> > rc = NS_InvokeByIndex(mXPTCStub, 1, 3, params);
> > NS_DestroyXPTCallStub(mXPTCStub);
> >
> > But I don`t know how to use NS_GetXPTCallStub!
> > What means the second and third parameter from NS_GetXPTCallStub?
> 
> Have you read the doccomments at 
> http://mxr.mozilla.org/mozilla-central/source/xpcom/reflect/xptcall/xptcall.h#174
>  
> ?
> 
> If you are trying to *invoke* a method, you don't need an xptcall stub 
> at all. You just need NS_InvokeByIndex.
> 
> An XPTCall stub is used to *implement* an XPCOM object whose 
> type/interface definition isn't known at compile time, typically by 
> mirroring it to an underlying scriptable object. You would need to 
> implement a c++ class which implements nsIXPTCProxy and implements 
> CallMethod.
> 
> --BDS

We`re develping a PKCS11 modul in c/c++ for a custom card reader to support. I 
just want to display a simple dialog. The code below works great until I stay 
on MS Visual Studio. But our project is running on eclipse/gcc. 

 nsCOMPtr promptService = 
do_GetService("@mozilla.org/embedcomp/prompt-service;1")); 
 promptService->Alert(NULL, NULL, NULL);

I`m getting the following error during linking, that comes because of the 
different function call convention between VS and mingw/gcc on windows. I 
already tried to cross compile firefox (xulrunner), then gecko api, but without 
any success yet. 

C:/download/xulrunner-41.0b9.en-US.win64.sdk/xulrunner-sdk/include/nsCOMPtr.h:514:
 undefined reference to 
`nsCOMPtr_base::assign_from_gs_contractid(nsGetServiceByContractID, nsID 
const&)'
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: call prompt service dynamically

2016-03-08 Thread Kyle Huey
You're probably just not linking to the xpcom glue library in eclipse/gcc.

- Kyle

On Tue, Mar 8, 2016 at 8:33 PM, Tobias Wolf  wrote:

> We`re develping a PKCS11 modul in c/c++ for a custom card reader to
> support. I just want to display a simple dialog. The code below works great
> until I stay on MS Visual Studio. But our project is running on eclipse/gcc.
>
>  nsCOMPtr promptService = do_GetService("@
> mozilla.org/embedcomp/prompt-service;1"));
>  promptService->Alert(NULL, NULL, NULL);
>
> I`m getting the following error during linking, that comes because of the
> different coding convention between VS and mingw/gcc on windows.
>
> C:/download/xulrunner-41.0b9.en-US.win64.sdk/xulrunner-sdk/include/nsCOMPtr.h:514:
> undefined reference to
> `nsCOMPtr_base::assign_from_gs_contractid(nsGetServiceByContractID, nsID
> const&)'
>
> Am Montag, 7. März 2016 18:50:36 UTC+1 schrieb Benjamin Smedberg:
> > On 3/7/2016 11:17 AM, Tobias Wolf wrote:
> > > I try to call this code dynamically:
> > >
> > > nsCOMPtr promptService = do_GetService("@
> mozilla.org/embedcomp/prompt-service;1"));
> > > promptService->Alert(NULL, NULL, NULL);
> > >
> > > I do the following:
> > >
> > > nsISomeInterface* mXPTCStub;
> > > nsresult rc;
> > > nsXPTCVariant params[3];
> >
> > Why are you trying to do this? Are you writing a shim layer that
> > connects some other dynamic/scripting language to XPCOM?
> >
> > >
> > > rc = NS_GetXPTCallStub(NS_IPROMPTSERVICE_IID, proxy, );
> > >
> > > params[0].val.p = NULL;
> > > params[0].type = nsXPTType::T_VOID;
> > > params[0].flags = 0;
> > >
> > > params[1].val.p = (void*)title;
> > > params[1].type = nsXPTType::T_CHAR_STR;
> > > params[1].flags = 0;
> > >
> > > params[2].val.p = (void*)text;
> > > params[2].type = nsXPTType::T_CHAR_STR;
> > > params[2].flags = 0;
> > >
> > > rc = NS_InvokeByIndex(mXPTCStub, 1, 3, params);
> > > NS_DestroyXPTCallStub(mXPTCStub);
> > >
> > > But I don`t know how to use NS_GetXPTCallStub!
> > > What means the second and third parameter from NS_GetXPTCallStub?
> >
> > Have you read the doccomments at
> >
> http://mxr.mozilla.org/mozilla-central/source/xpcom/reflect/xptcall/xptcall.h#174
> > ?
> >
> > If you are trying to *invoke* a method, you don't need an xptcall stub
> > at all. You just need NS_InvokeByIndex.
> >
> > An XPTCall stub is used to *implement* an XPCOM object whose
> > type/interface definition isn't known at compile time, typically by
> > mirroring it to an underlying scriptable object. You would need to
> > implement a c++ class which implements nsIXPTCProxy and implements
> > CallMethod.
> >
> > --BDS
> ___
> 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: call prompt service dynamically

2016-03-08 Thread Tobias Wolf
Am Montag, 7. März 2016 18:50:36 UTC+1 schrieb Benjamin Smedberg:
> On 3/7/2016 11:17 AM, Tobias Wolf wrote:
> > I try to call this code dynamically:
> >
> > nsCOMPtr promptService = 
> > do_GetService("@mozilla.org/embedcomp/prompt-service;1"));
> > promptService->Alert(NULL, NULL, NULL);
> >
> > I do the following:
> >
> > nsISomeInterface* mXPTCStub;
> > nsresult rc;
> > nsXPTCVariant params[3];
> 
> Why are you trying to do this? Are you writing a shim layer that 
> connects some other dynamic/scripting language to XPCOM?
> 
> >
> > rc = NS_GetXPTCallStub(NS_IPROMPTSERVICE_IID, proxy, );
> >
> > params[0].val.p = NULL;
> > params[0].type = nsXPTType::T_VOID;
> > params[0].flags = 0;
> >
> > params[1].val.p = (void*)title;
> > params[1].type = nsXPTType::T_CHAR_STR;
> > params[1].flags = 0;
> >
> > params[2].val.p = (void*)text;
> > params[2].type = nsXPTType::T_CHAR_STR;
> > params[2].flags = 0;
> >
> > rc = NS_InvokeByIndex(mXPTCStub, 1, 3, params);
> > NS_DestroyXPTCallStub(mXPTCStub);
> >
> > But I don`t know how to use NS_GetXPTCallStub!
> > What means the second and third parameter from NS_GetXPTCallStub?
> 
> Have you read the doccomments at 
> http://mxr.mozilla.org/mozilla-central/source/xpcom/reflect/xptcall/xptcall.h#174
>  
> ?
> 
> If you are trying to *invoke* a method, you don't need an xptcall stub 
> at all. You just need NS_InvokeByIndex.
> 
> An XPTCall stub is used to *implement* an XPCOM object whose 
> type/interface definition isn't known at compile time, typically by 
> mirroring it to an underlying scriptable object. You would need to 
> implement a c++ class which implements nsIXPTCProxy and implements 
> CallMethod.
> 
> --BDS


We`re develping a PKCS11 modul in c/c++ for a custom card reader to support. I 
just want to display a simple dialog. The code below works great until I stay 
on MS Visual Studio. But our project is running on eclipse/gcc. 

 nsCOMPtr promptService = 
do_GetService("@mozilla.org/embedcomp/prompt-service;1")); 
 promptService->Alert(NULL, NULL, NULL);

I`m getting the following error during linking, that comes because of the 
different coding convention between VS and mingw/gcc on windows. 

C:/download/xulrunner-41.0b9.en-US.win64.sdk/xulrunner-sdk/include/nsCOMPtr.h:514:
 undefined reference to 
`nsCOMPtr_base::assign_from_gs_contractid(nsGetServiceByContractID, nsID 
const&)'

Am Montag, 7. März 2016 18:50:36 UTC+1 schrieb Benjamin Smedberg:
> On 3/7/2016 11:17 AM, Tobias Wolf wrote:
> > I try to call this code dynamically:
> >
> > nsCOMPtr promptService = 
> > do_GetService("@mozilla.org/embedcomp/prompt-service;1"));
> > promptService->Alert(NULL, NULL, NULL);
> >
> > I do the following:
> >
> > nsISomeInterface* mXPTCStub;
> > nsresult rc;
> > nsXPTCVariant params[3];
> 
> Why are you trying to do this? Are you writing a shim layer that 
> connects some other dynamic/scripting language to XPCOM?
> 
> >
> > rc = NS_GetXPTCallStub(NS_IPROMPTSERVICE_IID, proxy, );
> >
> > params[0].val.p = NULL;
> > params[0].type = nsXPTType::T_VOID;
> > params[0].flags = 0;
> >
> > params[1].val.p = (void*)title;
> > params[1].type = nsXPTType::T_CHAR_STR;
> > params[1].flags = 0;
> >
> > params[2].val.p = (void*)text;
> > params[2].type = nsXPTType::T_CHAR_STR;
> > params[2].flags = 0;
> >
> > rc = NS_InvokeByIndex(mXPTCStub, 1, 3, params);
> > NS_DestroyXPTCallStub(mXPTCStub);
> >
> > But I don`t know how to use NS_GetXPTCallStub!
> > What means the second and third parameter from NS_GetXPTCallStub?
> 
> Have you read the doccomments at 
> http://mxr.mozilla.org/mozilla-central/source/xpcom/reflect/xptcall/xptcall.h#174
>  
> ?
> 
> If you are trying to *invoke* a method, you don't need an xptcall stub 
> at all. You just need NS_InvokeByIndex.
> 
> An XPTCall stub is used to *implement* an XPCOM object whose 
> type/interface definition isn't known at compile time, typically by 
> mirroring it to an underlying scriptable object. You would need to 
> implement a c++ class which implements nsIXPTCProxy and implements 
> CallMethod.
> 
> --BDS

We`re develping a PKCS11 modul in c/c++ for a custom card reader to support. I 
just want to display a simple dialog. The code below works great until I stay 
on MS Visual Studio. But our project is running on eclipse/gcc. 

 nsCOMPtr promptService = 
do_GetService("@mozilla.org/embedcomp/prompt-service;1")); 
 promptService->Alert(NULL, NULL, NULL);

I`m getting the following error during linking, that comes because of the 
different linking convention between VS and mingw/gcc on windows. I already 
tried to cross compile firefox/gecko/xulrunner, but without success yet.

C:/download/xulrunner-41.0b9.en-US.win64.sdk/xulrunner-sdk/include/nsCOMPtr.h:514:
 undefined reference to 
`nsCOMPtr_base::assign_from_gs_contractid(nsGetServiceByContractID, nsID 
const&)'

Re: call prompt service dynamically

2016-03-08 Thread Tobias Wolf
We`re develping a PKCS11 modul in c/c++ for a custom card reader to support. I 
just want to display a simple dialog. The code below works great until I stay 
on MS Visual Studio. But our project is running on eclipse/gcc. 

 nsCOMPtr promptService = 
do_GetService("@mozilla.org/embedcomp/prompt-service;1")); 
 promptService->Alert(NULL, NULL, NULL);

I`m getting the following error during linking, that comes because of the 
different coding convention between VS and mingw/gcc on windows. 

C:/download/xulrunner-41.0b9.en-US.win64.sdk/xulrunner-sdk/include/nsCOMPtr.h:514:
 undefined reference to 
`nsCOMPtr_base::assign_from_gs_contractid(nsGetServiceByContractID, nsID 
const&)'

Am Montag, 7. März 2016 18:50:36 UTC+1 schrieb Benjamin Smedberg:
> On 3/7/2016 11:17 AM, Tobias Wolf wrote:
> > I try to call this code dynamically:
> >
> > nsCOMPtr promptService = 
> > do_GetService("@mozilla.org/embedcomp/prompt-service;1"));
> > promptService->Alert(NULL, NULL, NULL);
> >
> > I do the following:
> >
> > nsISomeInterface* mXPTCStub;
> > nsresult rc;
> > nsXPTCVariant params[3];
> 
> Why are you trying to do this? Are you writing a shim layer that 
> connects some other dynamic/scripting language to XPCOM?
> 
> >
> > rc = NS_GetXPTCallStub(NS_IPROMPTSERVICE_IID, proxy, );
> >
> > params[0].val.p = NULL;
> > params[0].type = nsXPTType::T_VOID;
> > params[0].flags = 0;
> >
> > params[1].val.p = (void*)title;
> > params[1].type = nsXPTType::T_CHAR_STR;
> > params[1].flags = 0;
> >
> > params[2].val.p = (void*)text;
> > params[2].type = nsXPTType::T_CHAR_STR;
> > params[2].flags = 0;
> >
> > rc = NS_InvokeByIndex(mXPTCStub, 1, 3, params);
> > NS_DestroyXPTCallStub(mXPTCStub);
> >
> > But I don`t know how to use NS_GetXPTCallStub!
> > What means the second and third parameter from NS_GetXPTCallStub?
> 
> Have you read the doccomments at 
> http://mxr.mozilla.org/mozilla-central/source/xpcom/reflect/xptcall/xptcall.h#174
>  
> ?
> 
> If you are trying to *invoke* a method, you don't need an xptcall stub 
> at all. You just need NS_InvokeByIndex.
> 
> An XPTCall stub is used to *implement* an XPCOM object whose 
> type/interface definition isn't known at compile time, typically by 
> mirroring it to an underlying scriptable object. You would need to 
> implement a c++ class which implements nsIXPTCProxy and implements 
> CallMethod.
> 
> --BDS
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: Are we in favour of implementing the client hints header?

2016-03-08 Thread Gervase Markham
On 08/03/16 06:22, Andrew Overholt wrote:
>  Implement Client-Hints HTTP header
> https://bugzilla.mozilla.org/show_bug.cgi?id=935216

Well, we are in favour of adaptive content, progressive enhancement,
responsive images in HTML, and feature detection. The question is
whether we think that these things cover all the use cases or not.

Do we know whether anyone's using this in Chrome?

Gerv


___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: now available on desktop Firefox

2016-03-08 Thread Chris Mills
Thanks! We’ll have a discussion and work out exactly where best to put this on 
MDN.

Chris Mills
 Senior tech writer || Mozilla
developer.mozilla.org || MDN
 cmi...@mozilla.com || @chrisdavidmills

> On 8 Mar 2016, at 08:34, Kan-Ru Chen (陳侃如)  wrote:
> 
> It's only available to chrome code on desktop. For FxOS I'm not sure how
> the permission model will evolve.
> 
> Kanru
> 
> Chris Mills  writes:
> 
>> So I guess this means we need to move the API out of Firefox-OS-specific 
>> APIs, and back into the regular APIs section?
>> 
>> https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/API/Browser_API
>> 
>> And this is only available to privileged code on desktop (and FxOS still), 
>> right?
>> 
>> Chris Mills
>> Senior tech writer || Mozilla
>> developer.mozilla.org || MDN
>> cmi...@mozilla.com || @chrisdavidmills
>> 
>>> On 7 Mar 2016, at 21:55, J. Ryan Stinnett  wrote:
>>> 
>>> Do you like HTML? Do you like to build core browsing UI for desktop
>>> Firefox? Now you can have both together!
>>> 
>>> In more detail,  is now enabled[1] on desktop Firefox.
>>> This makes it possible to create frames for displaying web content (similar
>>> to a ) from HTML chrome pages. This is the same system that
>>> B2G has used for some time to display web content from an HTML UI. (This
>>> feature is not available to web content and is not meant to be used there.)
>>> 
>>> This gives us a core building block that can be used to build a fully HTML
>>> browser UI. Of course, the existing UI has many XUL / XBL dependencies, but
>>> this is at least one step. The DevTools team plans to use this new feature
>>> quite soon as part of a refreshed Responsive Design Mode. Additionally, it
>>> should make it easier for projects like browser.html to run from unmodified
>>> Firefox.
>>> 
>>> By default,  can't access the storage used by
>>>  for cookies and other site data, making it hard to share page
>>> state across the two browser frame types. An additional feature >> mozbrowser noisolation> has been added, which gives the frame access to the
>>> same storage as . This is only meant for use on desktop
>>> Firefox to allow HTML and XUL browser frames to work together.
>>> 
>>> [1]: https://bugzilla.mozilla.org/show_bug.cgi?id=1238160
>>> 
>>> - Ryan
>>> ___
>>> 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: now available on desktop Firefox

2016-03-08 Thread 陳侃如
It's only available to chrome code on desktop. For FxOS I'm not sure how
the permission model will evolve.

Kanru

Chris Mills  writes:

> So I guess this means we need to move the API out of Firefox-OS-specific 
> APIs, and back into the regular APIs section?
>
> https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/API/Browser_API
>
> And this is only available to privileged code on desktop (and FxOS still), 
> right?
>
> Chris Mills
>  Senior tech writer || Mozilla
> developer.mozilla.org || MDN
>  cmi...@mozilla.com || @chrisdavidmills
>
>> On 7 Mar 2016, at 21:55, J. Ryan Stinnett  wrote:
>> 
>> Do you like HTML? Do you like to build core browsing UI for desktop
>> Firefox? Now you can have both together!
>> 
>> In more detail,  is now enabled[1] on desktop Firefox.
>> This makes it possible to create frames for displaying web content (similar
>> to a ) from HTML chrome pages. This is the same system that
>> B2G has used for some time to display web content from an HTML UI. (This
>> feature is not available to web content and is not meant to be used there.)
>> 
>> This gives us a core building block that can be used to build a fully HTML
>> browser UI. Of course, the existing UI has many XUL / XBL dependencies, but
>> this is at least one step. The DevTools team plans to use this new feature
>> quite soon as part of a refreshed Responsive Design Mode. Additionally, it
>> should make it easier for projects like browser.html to run from unmodified
>> Firefox.
>> 
>> By default,  can't access the storage used by
>>  for cookies and other site data, making it hard to share page
>> state across the two browser frame types. An additional feature > mozbrowser noisolation> has been added, which gives the frame access to the
>> same storage as . This is only meant for use on desktop
>> Firefox to allow HTML and XUL browser frames to work together.
>> 
>> [1]: https://bugzilla.mozilla.org/show_bug.cgi?id=1238160
>> 
>> - Ryan
>> ___
>> 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