Commit ce886003 authored by Kuo Jen Wei's avatar Kuo Jen Wei Committed by Commit Bot

[CCA] Convert background_ops.js into ES6 module.

Bug: 141518780
Test: Pass closure compiler check, tast run <DUT> 'camera.CCAUI*' on both HALv1
and v3 devices.

Change-Id: I10d4a870ba2495b0338e412dcdf1791129868c56
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1989287Reviewed-by: default avatarShik Chen <shik@chromium.org>
Commit-Queue: Kuo Jen Wei <inker@chromium.org>
Auto-Submit: Kuo Jen Wei <inker@chromium.org>
Cr-Commit-Position: refs/heads/master@{#728832}
parent 660a29da
...@@ -2,23 +2,16 @@ ...@@ -2,23 +2,16 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
'use strict'; // eslint-disable-next-line no-unused-vars
import {Intent} from './intent.js';
/** // eslint-disable-next-line no-unused-vars
* Namespace for the Camera app. import {PerfLogger} from './perf.js';
*/
var cca = cca || {};
/**
* Namespace for the background page.
*/
cca.bg = cca.bg || {};
/** /**
* Operations supported by foreground window. * Operations supported by foreground window.
* @interface * @interface
*/ */
cca.bg.ForegroundOps = class { export class ForegroundOps {
/** /**
* Suspend foreground window. * Suspend foreground window.
* @return {!Promise} * @return {!Promise}
...@@ -31,29 +24,29 @@ cca.bg.ForegroundOps = class { ...@@ -31,29 +24,29 @@ cca.bg.ForegroundOps = class {
* @abstract * @abstract
*/ */
resume() {} resume() {}
}; }
/** /**
* Operations supported by background window. * Operations supported by background window.
* @interface * @interface
*/ */
cca.bg.BackgroundOps = class { export class BackgroundOps {
/** /**
* Sets the implementation of ForegroundOps from foreground window. * Sets the implementation of ForegroundOps from foreground window.
* @param {!cca.bg.ForegroundOps} ops * @param {!ForegroundOps} ops
*/ */
bindForegroundOps(ops) {} bindForegroundOps(ops) {}
/** /**
* Gets intent associate with cca.bg.Window object. * Gets intent associate with CCA Window object.
* @return {?cca.intent.Intent} * @return {?Intent}
* @abstract * @abstract
*/ */
getIntent() {} getIntent() {}
/** /**
* Gets the perf logger associate with cca.bg.Window object. * Gets the perf logger associate with CCA Window object.
* @return {!cca.perf.PerfLogger} * @return {!PerfLogger}
* @abstract * @abstract
*/ */
getPerfLogger() {} getPerfLogger() {}
...@@ -69,4 +62,9 @@ cca.bg.BackgroundOps = class { ...@@ -69,4 +62,9 @@ cca.bg.BackgroundOps = class {
* @abstract * @abstract
*/ */
notifySuspension() {} notifySuspension() {}
}; }
/** @const */
cca.bg.ForegroundOps = ForegroundOps;
/** @const */
cca.bg.BackgroundOps = BackgroundOps;
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
// eslint-disable-next-line no-unused-vars // eslint-disable-next-line no-unused-vars
var cca = { var cca = {
bg: {},
device: {}, device: {},
intent: {}, intent: {},
metrics: {}, metrics: {},
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
<script type="module" src="../js/type.js"></script> <script type="module" src="../js/type.js"></script>
<script type="module" src="../js/perf.js"></script> <script type="module" src="../js/perf.js"></script>
<script type="module" src="../js/intent.js"></script> <script type="module" src="../js/intent.js"></script>
<script defer src="../js/background_ops.js"></script>
<script defer src="../js/background.js"></script> <script defer src="../js/background.js"></script>
</head> </head>
</html> </html>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment