Framework and tests for WorkerNavigatorBudget (issue 2273743002 by harkness@chromium.org)

0 views
Skip to first unread message

hark...@chromium.org

unread,
Aug 23, 2016, 12:11:03 PM8/23/16
to pe...@chromium.org, chromium...@chromium.org, blink-...@chromium.org, har...@chromium.org
Reviewers: Peter Beverloo
CL: https://codereview.chromium.org/2273743002/


https://codereview.chromium.org/2273743002/diff/1/third_party/WebKit/LayoutTests/http/tests/budget/get-budget-in-service-worker.html
File
third_party/WebKit/LayoutTests/http/tests/budget/get-budget-in-service-worker.html
(right):

https://codereview.chromium.org/2273743002/diff/1/third_party/WebKit/LayoutTests/http/tests/budget/get-budget-in-service-worker.html#newcode8
third_party/WebKit/LayoutTests/http/tests/budget/get-budget-in-service-worker.html:8:
<script src="../notifications/resources/test-helpers.js"></script>
I could also copy the helpers from notifications to budget, but it
seemed better to avoid the code duplication.

https://codereview.chromium.org/2273743002/diff/1/third_party/WebKit/Source/modules/budget/WorkerNavigatorBudget.idl
File third_party/WebKit/Source/modules/budget/WorkerNavigatorBudget.idl
(right):

https://codereview.chromium.org/2273743002/diff/1/third_party/WebKit/Source/modules/budget/WorkerNavigatorBudget.idl#newcode5
third_party/WebKit/Source/modules/budget/WorkerNavigatorBudget.idl:5: //
TODO(harkness): Update to WorkerNavigator partial interface
documentation.
I'm not sure why git is picking this up as a modified file rather than a
new file. I'll look into it.

Description:
Framework and tests for WorkerNavigatorBudget

This CL provides a Worker entrypoint for the BudgetAPI. The WorkerNavigator
partial interface provides a BudgetService object, which is the same for
both Navigator and WorkerNavigator.

BUG=617971

Base URL: https://chromium.googlesource.com/chromium/src.git@mojo_service

Affected files (+278, -2 lines):
A third_party/WebKit/LayoutTests/http/tests/budget/get-budget-in-service-worker.html
A third_party/WebKit/LayoutTests/http/tests/budget/get-cost-fails-in-service-worker.html
A third_party/WebKit/LayoutTests/http/tests/budget/get-cost-in-service-worker.html
A third_party/WebKit/LayoutTests/http/tests/budget/resources/instrumentation-service-worker.js
M third_party/WebKit/LayoutTests/webexposed/global-interface-listing-dedicated-worker-expected.txt
M third_party/WebKit/LayoutTests/webexposed/global-interface-listing-shared-worker-expected.txt
A third_party/WebKit/Source/modules/budget/WorkerNavigatorBudget.h
A third_party/WebKit/Source/modules/budget/WorkerNavigatorBudget.cpp
A + third_party/WebKit/Source/modules/budget/WorkerNavigatorBudget.idl
M third_party/WebKit/Source/modules/modules.gypi


pe...@chromium.org

unread,
Aug 24, 2016, 11:28:24 AM8/24/16
to hark...@chromium.org, chromium...@chromium.org, blink-...@chromium.org, har...@chromium.org
lgtm


https://codereview.chromium.org/2273743002/diff/20001/third_party/WebKit/LayoutTests/http/tests/budget/resources/instrumentation-service-worker.js
File
third_party/WebKit/LayoutTests/http/tests/budget/resources/instrumentation-service-worker.js
(right):

https://codereview.chromium.org/2273743002/diff/20001/third_party/WebKit/LayoutTests/http/tests/budget/resources/instrumentation-service-worker.js#newcode10
third_party/WebKit/LayoutTests/http/tests/budget/resources/instrumentation-service-worker.js:10:
var options = event.data.options || {}
;

https://codereview.chromium.org/2273743002/diff/20001/third_party/WebKit/LayoutTests/http/tests/budget/resources/instrumentation-service-worker.js#newcode17
third_party/WebKit/LayoutTests/http/tests/budget/resources/instrumentation-service-worker.js:17:
cost: cost });
The alignment of this (and lines 23+, 31+, 39+ and 52+) is kind of odd.
Normally we align objects like:

port.postMessage({
command: event.data.command,
foo: 'bar'
});

or

port.postMessage({ command: event.data.command,
foo: 'bar' });

https://codereview.chromium.org/2273743002/

pe...@chromium.org

unread,
Aug 24, 2016, 11:31:18 AM8/24/16
to hark...@chromium.org, chromium...@chromium.org, blink-...@chromium.org, har...@chromium.org
Sorry, two more IWYU comments:


https://codereview.chromium.org/2273743002/diff/20001/third_party/WebKit/Source/modules/budget/WorkerNavigatorBudget.h
File third_party/WebKit/Source/modules/budget/WorkerNavigatorBudget.h
(right):

https://codereview.chromium.org/2273743002/diff/20001/third_party/WebKit/Source/modules/budget/WorkerNavigatorBudget.h#newcode8
third_party/WebKit/Source/modules/budget/WorkerNavigatorBudget.h:8:
#include "platform/Supplementable.h"
#include "platform/heap/GarbageCollected.h"
#include "wtf/Noncopyable.h"

https://codereview.chromium.org/2273743002/

hark...@chromium.org

unread,
Aug 24, 2016, 12:22:51 PM8/24/16
to pe...@chromium.org, chromium...@chromium.org, blink-...@chromium.org, har...@chromium.org

https://codereview.chromium.org/2273743002/diff/20001/third_party/WebKit/LayoutTests/http/tests/budget/resources/instrumentation-service-worker.js
File
third_party/WebKit/LayoutTests/http/tests/budget/resources/instrumentation-service-worker.js
(right):

https://codereview.chromium.org/2273743002/diff/20001/third_party/WebKit/LayoutTests/http/tests/budget/resources/instrumentation-service-worker.js#newcode10
third_party/WebKit/LayoutTests/http/tests/budget/resources/instrumentation-service-worker.js:10:
var options = event.data.options || {}
On 2016/08/24 15:28:23, Peter Beverloo wrote:
> ;

Done.


https://codereview.chromium.org/2273743002/diff/20001/third_party/WebKit/LayoutTests/http/tests/budget/resources/instrumentation-service-worker.js#newcode17
third_party/WebKit/LayoutTests/http/tests/budget/resources/instrumentation-service-worker.js:17:
cost: cost });
On 2016/08/24 15:28:23, Peter Beverloo wrote:
> The alignment of this (and lines 23+, 31+, 39+ and 52+) is kind of
odd. Normally
> we align objects like:
>
> port.postMessage({
> command: event.data.command,
> foo: 'bar'
> });
>
> or
>
> port.postMessage({ command: event.data.command,
> foo: 'bar' });

Done.


https://codereview.chromium.org/2273743002/diff/20001/third_party/WebKit/Source/modules/budget/WorkerNavigatorBudget.h
File third_party/WebKit/Source/modules/budget/WorkerNavigatorBudget.h
(right):

https://codereview.chromium.org/2273743002/diff/20001/third_party/WebKit/Source/modules/budget/WorkerNavigatorBudget.h#newcode8
third_party/WebKit/Source/modules/budget/WorkerNavigatorBudget.h:8:
#include "platform/Supplementable.h"
On 2016/08/24 15:31:04, Peter Beverloo wrote:
> #include "platform/heap/GarbageCollected.h"
> #include "wtf/Noncopyable.h"

Done.

https://codereview.chromium.org/2273743002/

commit-bot@chromium.org via codereview.chromium.org

unread,
Aug 25, 2016, 8:21:14 AM8/25/16
to hark...@chromium.org, pe...@chromium.org, commi...@chromium.org, chromium...@chromium.org, blink-...@chromium.org, har...@chromium.org

commit-bot@chromium.org via codereview.chromium.org

unread,
Aug 25, 2016, 11:48:55 AM8/25/16
to hark...@chromium.org, pe...@chromium.org, commi...@chromium.org, chromium...@chromium.org, blink-...@chromium.org, har...@chromium.org
Try jobs failed on following builders:
win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED,
http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/281056)

https://codereview.chromium.org/2273743002/

commit-bot@chromium.org via codereview.chromium.org

unread,
Aug 25, 2016, 12:14:35 PM8/25/16
to hark...@chromium.org, pe...@chromium.org, commi...@chromium.org, chromium...@chromium.org, blink-...@chromium.org, har...@chromium.org

commit-bot@chromium.org via codereview.chromium.org

unread,
Aug 25, 2016, 2:49:57 PM8/25/16
to hark...@chromium.org, pe...@chromium.org, commi...@chromium.org, chromium...@chromium.org, blink-...@chromium.org, har...@chromium.org
Try jobs failed on following builders:

commit-bot@chromium.org via codereview.chromium.org

unread,
Aug 25, 2016, 5:13:01 PM8/25/16
to hark...@chromium.org, pe...@chromium.org, commi...@chromium.org, chromium...@chromium.org, blink-...@chromium.org, har...@chromium.org

commit-bot@chromium.org via codereview.chromium.org

unread,
Aug 25, 2016, 7:19:51 PM8/25/16
to hark...@chromium.org, pe...@chromium.org, commi...@chromium.org, chromium...@chromium.org, blink-...@chromium.org, har...@chromium.org
Committed patchset #5 (id:80001)

https://codereview.chromium.org/2273743002/

commit-bot@chromium.org via codereview.chromium.org

unread,
Aug 25, 2016, 7:23:17 PM8/25/16
to hark...@chromium.org, pe...@chromium.org, commi...@chromium.org, chromium...@chromium.org, blink-...@chromium.org, har...@chromium.org
Patchset 5 (id:??) landed as
https://crrev.com/48002352c0a882279f25decc05b61c73c15795a5
Cr-Commit-Position: refs/heads/master@{#414579}

https://codereview.chromium.org/2273743002/
Reply all
Reply to author
Forward
0 new messages