Pass the DLC UUID to mantis service
Also add kMediaAppImageMantisModel flag to load time data so Backlight can decide which UUID to use BUG=b:396577011 TEST=manual e2e test Change-Id: Ifcc5cf1bf521de1e6f47028d8cda77f1b00b3d17 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6284865 Reviewed-by: Patti Lor <patricialor@chromium.org> Commit-Queue: Nurlita Dhuha Fatmawati <nurlitadf@google.com> Reviewed-by: Yi Chou <yich@google.com> Cr-Commit-Position: refs/heads/main@{#1424300}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
64585f4d13
commit
94d77c52af
ash/webui/media_app_ui/resources/js
chrome/browser/ash/system_web_apps/apps/media_app
@ -35,6 +35,8 @@ type InitializeResult =
|
||||
type MantisResult = import('./mantis_processor.mojom-webui.js').MantisResult;
|
||||
type MantisSafetyClassifierVerdict =
|
||||
import('./mantis_processor.mojom-webui.js').SafetyClassifierVerdict;
|
||||
type Uuid =
|
||||
import('//resources/mojo/mojo/public/mojom/base/uuid.mojom-webui.js').Uuid;
|
||||
|
||||
/**
|
||||
* Wraps an HTML File object (or a mock, or media loaded through another means).
|
||||
@ -304,7 +306,7 @@ declare interface ClientApiDelegate {
|
||||
* Loads Mantis' assets from DLC and initializes the processor for subsequent
|
||||
* queries.
|
||||
*/
|
||||
initializeMantis(): Promise<InitializeResult>;
|
||||
initializeMantis(dlcId: Uuid): Promise<InitializeResult>;
|
||||
/**
|
||||
* Performs image segmentation on the image based on the prior selection.
|
||||
* The `image` and `selection` are byte arrays containing the encoded
|
||||
|
@ -7,6 +7,7 @@
|
||||
import './sandboxed_load_time_data.js';
|
||||
|
||||
import {COLOR_PROVIDER_CHANGED, ColorChangeUpdater} from '//resources/cr_components/color_change_listener/colors_css_updater.js';
|
||||
import {Uuid} from '//resources/mojo/mojo/public/mojom/base/uuid.mojom-webui.js';
|
||||
import type {RectF} from '//resources/mojo/ui/gfx/geometry/mojom/geometry.mojom-webui.js';
|
||||
import type {Url as MojoUrl} from '//resources/mojo/url/mojom/url.mojom-webui.js';
|
||||
import {assertCast, MessagePipe} from '//system_apps/message_pipe.js';
|
||||
@ -443,12 +444,9 @@ const DELEGATE: ClientApiDelegate = {
|
||||
async isMantisAvailable() {
|
||||
return isMantisAvailable();
|
||||
},
|
||||
async initializeMantis() {
|
||||
async initializeMantis(dlcId: Uuid) {
|
||||
mantisUntrustedService?.$.close();
|
||||
// TODO(crbug.com/395511579): Make the dlcUuid a parameter of
|
||||
// initializeMantis.
|
||||
const dlcUuid = null;
|
||||
const response = await connectToMantisUntrustedService(dlcUuid);
|
||||
const response = await connectToMantisUntrustedService(dlcId);
|
||||
if (response.error) {
|
||||
return response.error;
|
||||
}
|
||||
|
@ -122,6 +122,9 @@ void ChromeMediaAppGuestUIDelegate::PopulateLoadTimeData(
|
||||
source->AddBoolean("flagsMenu", channel != version_info::Channel::BETA &&
|
||||
channel != version_info::Channel::STABLE);
|
||||
source->AddBoolean("isDevChannel", channel == version_info::Channel::DEV);
|
||||
source->AddString("mantisModel",
|
||||
ash::features::kMediaAppImageMantisModelParams.GetName(
|
||||
ash::features::kMediaAppImageMantisModelParams.Get()));
|
||||
}
|
||||
|
||||
std::unique_ptr<specialized_features::FeatureAccessChecker>
|
||||
|
Reference in New Issue
Block a user