summaryrefslogtreecommitdiff
path: root/chromium/chrome/services
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/chrome/services')
-rw-r--r--chromium/chrome/services/app_service/BUILD.gn35
-rw-r--r--chromium/chrome/services/app_service/public/cpp/BUILD.gn129
-rw-r--r--chromium/chrome/services/app_service/public/mojom/BUILD.gn23
-rw-r--r--chromium/chrome/services/app_service/public/mojom/app_service.mojom227
-rw-r--r--chromium/chrome/services/app_service/public/mojom/types.mojom314
-rw-r--r--chromium/chrome/services/keymaster/public/mojom/cert_store.mojom5
-rw-r--r--chromium/chrome/services/sharing/BUILD.gn1
-rw-r--r--chromium/chrome/services/sharing/nearby_decoder/BUILD.gn47
-rw-r--r--chromium/chrome/services/sharing/nearby_decoder/proto/BUILD.gn (renamed from chromium/chrome/services/speech/proto/BUILD.gn)15
-rw-r--r--chromium/chrome/services/sharing/public/mojom/BUILD.gn4
-rw-r--r--chromium/chrome/services/sharing/public/mojom/nearby_connections.mojom13
-rw-r--r--chromium/chrome/services/sharing/public/mojom/nearby_connections_types.mojom201
-rw-r--r--chromium/chrome/services/sharing/public/mojom/nearby_decoder.mojom21
-rw-r--r--chromium/chrome/services/sharing/public/mojom/nearby_decoder_types.mojom210
-rw-r--r--chromium/chrome/services/sharing/public/mojom/sharing.mojom5
-rw-r--r--chromium/chrome/services/speech/BUILD.gn26
-rw-r--r--chromium/chrome/services/util_win/BUILD.gn2
-rw-r--r--chromium/chrome/services/util_win/public/mojom/BUILD.gn10
-rw-r--r--chromium/chrome/services/util_win/public/mojom/util_read_icon.mojom24
-rw-r--r--chromium/chrome/services/wilco_dtc_supportd/public/mojom/wilco_dtc_supportd.mojom13
20 files changed, 577 insertions, 748 deletions
diff --git a/chromium/chrome/services/app_service/BUILD.gn b/chromium/chrome/services/app_service/BUILD.gn
deleted file mode 100644
index 5aa18bbd834..00000000000
--- a/chromium/chrome/services/app_service/BUILD.gn
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright 2018 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-source_set("lib") {
- sources = [
- "app_service_impl.cc",
- "app_service_impl.h",
- ]
-
- deps = [
- "//base",
- "//components/prefs",
- "//content/public/browser",
- "//mojo/public/cpp/bindings",
- ]
-
- public_deps = [
- "//chrome/services/app_service/public/cpp:preferred_apps",
- "//chrome/services/app_service/public/mojom",
- ]
-}
-
-source_set("unit_tests") {
- testonly = true
-
- sources = [ "app_service_impl_unittest.cc" ]
-
- deps = [
- ":lib",
- "//chrome/services/app_service/public/cpp:intents",
- "//chrome/services/app_service/public/cpp:preferred_apps",
- "//testing/gtest",
- ]
-}
diff --git a/chromium/chrome/services/app_service/public/cpp/BUILD.gn b/chromium/chrome/services/app_service/public/cpp/BUILD.gn
deleted file mode 100644
index 3b3fc05ccfe..00000000000
--- a/chromium/chrome/services/app_service/public/cpp/BUILD.gn
+++ /dev/null
@@ -1,129 +0,0 @@
-# Copyright 2018 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-source_set("app_update") {
- sources = [
- "app_registry_cache.cc",
- "app_registry_cache.h",
- "app_update.cc",
- "app_update.h",
- ]
-
- public_deps = [ "//chrome/services/app_service/public/mojom" ]
-}
-
-if (is_chromeos) {
- source_set("instance_update") {
- sources = [
- "instance.cc",
- "instance.h",
- "instance_registry.cc",
- "instance_registry.h",
- "instance_update.cc",
- "instance_update.h",
- ]
- deps = [
- "//content/public/browser",
- "//skia",
- "//ui/aura",
- "//ui/compositor",
- ]
- }
-}
-
-source_set("icon_loader") {
- sources = [
- "icon_cache.cc",
- "icon_cache.h",
- "icon_coalescer.cc",
- "icon_coalescer.h",
- "icon_loader.cc",
- "icon_loader.h",
- ]
-
- public_deps = [ "//chrome/services/app_service/public/mojom" ]
-}
-
-source_set("icon_loader_test_support") {
- sources = [
- "stub_icon_loader.cc",
- "stub_icon_loader.h",
- ]
-
- deps = [ ":icon_loader" ]
-}
-
-source_set("intents") {
- sources = [
- "intent_filter_util.cc",
- "intent_filter_util.h",
- "intent_util.cc",
- "intent_util.h",
- ]
-
- deps = [
- "//base",
- "//chrome/services/app_service/public/mojom",
- "//components/services/app_service/public/cpp:intent_util",
- "//url",
- ]
-}
-
-source_set("preferred_apps") {
- sources = [
- "preferred_apps_converter.cc",
- "preferred_apps_converter.h",
- "preferred_apps_list.cc",
- "preferred_apps_list.h",
- ]
-
- deps = [
- ":intents",
- "//base",
- "//chrome/services/app_service/public/mojom",
- "//url",
- ]
-}
-
-source_set("publisher") {
- sources = [
- "publisher_base.cc",
- "publisher_base.h",
- ]
-
- deps = [ "//chrome/services/app_service/public/mojom" ]
-}
-
-source_set("unit_tests") {
- testonly = true
-
- sources = [
- "app_registry_cache_unittest.cc",
- "app_update_unittest.cc",
- "icon_cache_unittest.cc",
- "icon_coalescer_unittest.cc",
- "intent_test_util.cc",
- "intent_test_util.h",
- "intent_util_unittest.cc",
- "preferred_apps_converter_unittest.cc",
- "preferred_apps_list_unittest.cc",
- ]
-
- deps = [
- ":app_update",
- ":icon_loader",
- ":publisher",
- "//content/test:test_support",
- "//testing/gtest",
- ]
-
- if (is_chromeos) {
- sources += [
- "instance_registry_unittest.cc",
- "instance_update_unittest.cc",
- ]
-
- deps += [ ":instance_update" ]
- }
-}
diff --git a/chromium/chrome/services/app_service/public/mojom/BUILD.gn b/chromium/chrome/services/app_service/public/mojom/BUILD.gn
deleted file mode 100644
index c9c68e018ce..00000000000
--- a/chromium/chrome/services/app_service/public/mojom/BUILD.gn
+++ /dev/null
@@ -1,23 +0,0 @@
-# Copyright 2018 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import("//mojo/public/tools/bindings/mojom.gni")
-
-mojom("mojom") {
- sources = [ "app_service.mojom" ]
-
- public_deps = [
- ":types",
- "//components/services/app_service/public/mojom",
- ]
-}
-
-mojom("types") {
- sources = [ "types.mojom" ]
-
- public_deps = [
- "//mojo/public/mojom/base",
- "//ui/gfx/image/mojom",
- ]
-}
diff --git a/chromium/chrome/services/app_service/public/mojom/app_service.mojom b/chromium/chrome/services/app_service/public/mojom/app_service.mojom
deleted file mode 100644
index 0ff7c93e814..00000000000
--- a/chromium/chrome/services/app_service/public/mojom/app_service.mojom
+++ /dev/null
@@ -1,227 +0,0 @@
-// Copyright 2018 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-module apps.mojom;
-
-import "chrome/services/app_service/public/mojom/types.mojom";
-import "components/services/app_service/public/mojom/types.mojom";
-
-// An intermediary between M app consumers (e.g. app launcher UI, intent
-// pickers) and N app providers (also known as app platforms, e.g. Android
-// apps, Linux apps and Web apps). It abstracts over platform-specific
-// implementations and allow consumers to issue generic queries (e.g. for an
-// app's name and icon) that are satisfied by the appropriate provider.
-//
-// See chrome/services/app_service/README.md.
-interface AppService {
- // Called by a publisher of apps to register itself and its apps with the App
- // Service.
- RegisterPublisher(pending_remote<Publisher> publisher, AppType app_type);
-
- // Called by a consumer that wishes to know about available apps to register
- // itself with the App Service.
- RegisterSubscriber(pending_remote<Subscriber> subscriber, ConnectOptions? opts);
-
- // App Icon Factory methods.
- LoadIcon(
- AppType app_type,
- string app_id,
- IconKey icon_key,
- IconCompression icon_compression,
- int32 size_hint_in_dip,
- bool allow_placeholder_icon) => (IconValue icon_value);
-
- // App Runner methods.
- Launch(
- AppType app_type,
- string app_id,
- int32 event_flags,
- LaunchSource launch_source,
- int64 display_id);
-
- // Launches an app with |app_id| and |file_path|
- LaunchAppWithFiles(
- AppType app_type,
- string app_id,
- LaunchContainer container,
- int32 event_flags,
- LaunchSource launch_source,
- FilePaths file_paths);
-
- // Launches an app with |app_id| and Chrome OS generic |intent| irrespective
- // of app platform.
- LaunchAppWithIntent(
- AppType app_type,
- string app_id,
- int32 event_flags,
- Intent intent,
- LaunchSource launch_source,
- int64 display_id);
-
- SetPermission(
- AppType app_type,
- string app_id,
- Permission permission);
-
- // Directly uninstalls |app_id| without prompting the user.
- // |clear_site_data| is available for bookmark apps only. If true, any site
- // data associated with the app will be removed..
- // |report_abuse| is available for Chrome Apps only. If true, the app will be
- // reported for abuse to the Web Store.
- Uninstall(
- AppType app_type,
- string app_id,
- bool clear_site_data,
- bool report_abuse);
-
- // Pauses an app to stop the current running app, and apply the icon effect.
- PauseApp(
- AppType app_type,
- string app_id);
-
- // Unpauses an app, and recover the icon effect for the app.
- UnpauseApps(
- AppType app_type,
- string app_id);
-
- // Returns the menu items for an app with |app_id|.
- GetMenuModel(
- AppType app_type,
- string app_id,
- MenuType menu_type,
- int64 display_id) => (MenuItems menu_items);
-
- // Opens native settings for the app with |app_id|.
- OpenNativeSettings(
- AppType app_type,
- string app_id);
-
- // Sets app identified by |app_id| as preferred app for |intent_filter|.
- // |intent| is needed to set the preferred app in ARC.
- // If the request is |from_publisher|, we would not sync the preferred
- // app back to the publisher.
- AddPreferredApp(
- AppType app_type,
- string app_id,
- IntentFilter intent_filter,
- Intent? intent,
- bool from_publisher);
-
- // Removes all preferred app setting for an |app_id|.
- RemovePreferredApp(AppType app_type, string app_id);
-
- // Resets app identified by |app_id| as preferred app for |intent_filter|.
- RemovePreferredAppForFilter(
- AppType app_type,
- string app_id,
- IntentFilter intent_filter);
-};
-
-interface Publisher {
- // App Registry methods.
- Connect(pending_remote<Subscriber> subscriber, ConnectOptions? opts);
-
- // App Icon Factory methods.
- LoadIcon(
- string app_id,
- IconKey icon_key,
- IconCompression icon_compression,
- int32 size_hint_in_dip,
- bool allow_placeholder_icon) => (IconValue icon_value);
-
- // App Runner methods.
- Launch(
- string app_id,
- int32 event_flags,
- LaunchSource launch_source,
- int64 display_id);
-
- // Launches an app with |app_id| and |file_path|
- LaunchAppWithFiles(
- string app_id,
- LaunchContainer container,
- int32 event_flags,
- LaunchSource launch_source,
- FilePaths file_paths);
-
- // Launches an app with |app_id| and Chrome OS generic |intent| irrespective
- // of app platform.
- LaunchAppWithIntent(
- string app_id,
- int32 event_flags,
- Intent intent,
- LaunchSource launch_source,
- int64 display_id);
-
- SetPermission(
- string app_id,
- Permission permission);
-
- // Directly uninstalls |app_id| without prompting the user.
- // |clear_site_data| is available for bookmark apps only. If true, any site
- // data associated with the app will be removed..
- // |report_abuse| is available for Chrome Apps only. If true, the app will be
- // reported for abuse to the Web Store.
- Uninstall(
- string app_id,
- bool clear_site_data,
- bool report_abuse);
-
- // Pauses an app to stop the current running app, and apply the icon effect.
- PauseApp(
- string app_id);
-
- // Unpauses an app, and recover the icon effect for the app.
- UnpauseApps(
- string app_id);
-
- // Returns the menu items for an app with |app_id|.
- GetMenuModel(
- string app_id,
- MenuType menu_type,
- int64 display_id) => (MenuItems menu_items);
-
- // Opens native settings for the app with |app_id|.
- OpenNativeSettings(
- string app_id);
-
- // Indicates that the app identified by |app_id| has been set as a preferred
- // app for |intent_filter|, and the |replaced_app_preferences| is the apps
- // that are no longer preferred apps for their corresponding |intent_filters|.
- // This method is used by the App Service to sync the change to publishers.
- // |intent| is needed to set the preferred app in ARC.
- OnPreferredAppSet(
- string app_id,
- IntentFilter intent_filter,
- Intent intent,
- ReplacedAppPreferences replaced_app_preferences);
-};
-
-interface Subscriber {
- OnApps(array<App> deltas);
-
- // Binds this to the given receiver (message pipe endpoint), being to Mojo
- // interfaces what POSIX's dup is to file descriptors.
- //
- // See https://groups.google.com/a/chromium.org/d/msg/chromium-mojo/nFhBzGsb5Pg/V7t_8kNRAgAJ
- Clone(pending_receiver<Subscriber> receiver);
-
- // Indicates that the app identified by |app_id| has been set as a preferred
- // app for |intent_fitler|. This method is used by the App Service to sync
- // the change from one subscriber to the others.
- OnPreferredAppSet(string app_id,
- IntentFilter intent_filter);
-
- // Indicates that the app identified by |app_id| is no longer a preferred
- // app for |intent_filter|. This method is used by the App Service to sync
- // the change to all subscribers.
- OnPreferredAppRemoved(string app_id, IntentFilter intent_filter);
-
- // Initialize the |preferred_apps| in the subscribers from the app service.
- InitializePreferredApps(array<PreferredApp> preferred_apps);
-};
-
-struct ConnectOptions {
- // TODO: some way to represent l10n info such as the UI language.
-};
diff --git a/chromium/chrome/services/app_service/public/mojom/types.mojom b/chromium/chrome/services/app_service/public/mojom/types.mojom
deleted file mode 100644
index 932dfa0266e..00000000000
--- a/chromium/chrome/services/app_service/public/mojom/types.mojom
+++ /dev/null
@@ -1,314 +0,0 @@
-// Copyright 2018 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-module apps.mojom;
-
-import "mojo/public/mojom/base/file_path.mojom";
-import "mojo/public/mojom/base/time.mojom";
-import "ui/gfx/image/mojom/image.mojom";
-
-// Information about an app. See chrome/services/app_service/README.md.
-struct App {
- AppType app_type;
- string app_id;
-
- // The fields above are mandatory. Everything else below is optional.
-
- Readiness readiness;
- string? name;
- string? short_name;
-
- // The publisher-specific ID for this app, e.g. for Android apps, this field
- // contains the Android package name. May be empty if AppId() should be
- // considered as the canonical publisher ID.
- string? publisher_id;
-
- string? description;
- string? version;
- array<string> additional_search_terms;
- IconKey? icon_key;
- mojo_base.mojom.Time? last_launch_time;
- mojo_base.mojom.Time? install_time;
-
- // This vector must be treated atomically, if there is a permission
- // change, the publisher must send through the entire list of permissions.
- // Should contain no duplicate IDs.
- // If empty during updates, Subscriber can assume no changes.
- // There is no guarantee that this is sorted by any criteria.
- array<Permission> permissions;
-
- // Whether the app was installed by sync, policy or as a default app.
- InstallSource install_source;
-
- // Whether the app is an extensions::Extensions where is_platform_app()
- // returns true.
- OptionalBool is_platform_app;
-
- // TODO(nigeltao): be more principled, instead of ad hoc show_in_xxx and
- // show_in_yyy fields?
- OptionalBool recommendable;
- OptionalBool searchable;
- OptionalBool show_in_launcher;
- OptionalBool show_in_search;
- OptionalBool show_in_management;
-
- // Whether the app icon should add the notification badging.
- OptionalBool has_badge;
-
- // Paused apps cannot be launched, and any running apps that become paused
- // will be stopped. This is independent of whether or not the app is ready to
- // be launched (defined by the Readiness field).
- OptionalBool paused;
-
- // This vector stores all the intent filters defined in this app. Each
- // intent filter defines a matching criteria for whether an intent can
- // be handled by this app. One app can have multiple intent filters.
- array<IntentFilter> intent_filters;
-
- // When adding new fields, also update the Merge method and other helpers in
- // chrome/services/app_service/public/cpp/app_update.*
-};
-
-struct Permission {
- // An AppType-specific value, opaque to the App Service.
- // Different publishers (with different AppType's) can
- // re-use the same numerical value to mean different things.
- uint32 permission_id;
- PermissionValueType value_type;
- // The semantics of value depends on the value_type.
- uint32 value;
- // If the permission is managed by an enterprise policy.
- bool is_managed;
-};
-
-// The types of apps available in the registry.
-enum AppType {
- kUnknown = 0,
- kArc, // Android app.
- kBuiltIn, // Built-in app.
- kCrostini, // Linux (via Crostini) app.
- kExtension, // Extension-backed app.
- kWeb, // Web app.
- kMacNative, // Native Mac app.
- kPluginVm, // Plugin VM app.
- kLacros, // Lacros app.
-};
-
-// Whether an app is ready to launch, i.e. installed.
-enum Readiness {
- kUnknown = 0,
- kReady, // Installed and launchable.
- kDisabledByBlacklist, // Disabled by SafeBrowsing.
- kDisabledByPolicy, // Disabled by admin policy.
- kDisabledByUser, // Disabled by explicit user action.
- kTerminated, // Renderer process crashed.
- kUninstalledByUser,
-};
-
-// How the app was installed.
-enum InstallSource {
- kUnknown = 0,
- kSystem, // Installed with the system and is considered a part of the OS.
- kPolicy, // Installed by policy.
- kOem, // Installed by an OEM.
- kDefault, // Preinstalled by default, but is not considered a system app.
- kSync, // Installed by sync.
- kUser, // Installed by user action.
-};
-
-// Augments a bool to include an 'unknown' value.
-enum OptionalBool {
- kUnknown = 0,
- kFalse,
- kTrue,
-};
-
-struct IconKey {
- // A timeline value for icons that do not change.
- const uint64 kDoesNotChangeOverTime = 0;
-
- const int32 kInvalidResourceId = 0;
-
- // A monotonically increasing number so that, after an icon update, a new
- // IconKey, one that is different in terms of field-by-field equality, can be
- // broadcast by a Publisher.
- //
- // The exact value of the number isn't important, only that newer IconKey's
- // (those that were created more recently) have a larger timeline than older
- // IconKey's.
- //
- // This is, in some sense, *a* version number, but the field is not called
- // "version", to avoid any possible confusion that it encodes *the* app's
- // version number, e.g. the "2.3.5" in "FooBar version 2.3.5 is installed".
- //
- // For example, if an app is disabled for some reason (so that its icon is
- // grayed out), this would result in a different timeline even though the
- // app's version is unchanged.
- uint64 timeline;
- // If non-zero (or equivalently, not equal to kInvalidResourceId), the
- // compressed icon is compiled into the Chromium binary as a statically
- // available, int-keyed resource.
- int32 resource_id;
- // A bitmask of icon post-processing effects, such as desaturation to gray
- // and rounding the corners.
- uint32 icon_effects;
-
- // When adding new fields, also update the IconLoader::Key type in
- // chrome/services/app_service/public/cpp/icon_loader.*
-};
-
-enum IconCompression {
- kUnknown,
- kUncompressed,
- kCompressed,
-};
-
-struct IconValue {
- IconCompression icon_compression;
- gfx.mojom.ImageSkia? uncompressed;
- array<uint8>? compressed;
- bool is_placeholder_icon;
-};
-
-// Enumeration of possible app launch sources.
-// Note the enumeration is used in UMA histogram so entries
-// should not be re-ordered or removed.
-enum LaunchSource {
- kUnknown = 0,
- kFromAppListGrid = 1, // Grid of apps, not the search box.
- kFromAppListGridContextMenu = 2, // Grid of apps; context menu.
- kFromAppListQuery = 3, // Query-dependent results (larger icons).
- kFromAppListQueryContextMenu = 4, // Query-dependent results; context menu.
- kFromAppListRecommendation = 5, // Query-less recommendations (smaller
- // icons).
- kFromParentalControls = 6, // Parental Controls Settings Section and
- // Per App time notification.
- kFromShelf = 7, // Shelf.
- kFromFileManager = 8, // FileManager.
- kFromLink = 9, // Left-licking on links in the browser.
- kFromOmnibox = 10, // Enter URL in the Omnibox in the browser.
- kFromChromeInternal = 11, // Chrome internal call.
- kFromKeyboard = 12, // Keyboard shortcut for opening app.
- kFromOtherApp = 13, // Clicking link in another app or webui.
- kFromMenu = 14, // Menu.
- kFromInstalledNotification = 15, // Installed notification
- kFromTest = 16, // Test
- kFromArc = 17, // Arc.
-};
-
-enum TriState {
- kAllow,
- kBlock,
- kAsk,
-};
-
-enum PermissionValueType {
- kBool, // Permission.value is a Bool (either 0 or 1).
- kTriState, // Permission.value is a TriState.
-};
-
-// MenuItems are used to populate context menus, e.g. in the app list or shelf.
-// Note: Some menu item types only support a subset of these item features.
-// Please update comments below (MenuItemType -> [fields expected for usage])
-// when anything changed to MenuItemType or MenuItem.
-//
-// kCommand -> [command_id, string_id].
-// kRadio -> [command_id, string_id, radio_group_id].
-// kSeparator -> [command_id].
-// kSubmenu -> [command_id, string_id, submenu].
-// kArcCommand -> [command_id, shortcut_id, label, image].
-//
-struct MenuItems {
- array<MenuItem> items;
-};
-
-struct MenuItem {
- MenuItemType type; // The type of the menu item.
- int32 command_id; // The menu item command id.
- int32 string_id; // The id of the menu item label.
- array<MenuItem> submenu; // The optional nested submenu item list.
- int32 radio_group_id; // The radio group id.
- string shortcut_id; // The shortcut id, may be empty.
- string label; // The string label, may be empty.
- gfx.mojom.ImageSkia? image; // The image icon, may be null.
-};
-
-// The types of menu items shown in the app list or shelf.
-enum MenuItemType {
- kCommand, // Performs an action when selected.
- kRadio, // Can be selected/checked among a group of choices.
- kSeparator, // Shows a horizontal line separator.
- kSubmenu, // Presents a submenu within another menu.
- kArcCommand, // Performs an ARC shortcut action when selected.
-};
-
-// Which component requests context menus, the app list or shelf.
-enum MenuType {
- kAppList,
- kShelf,
-};
-
-// The intent filter matching condition types.
-enum ConditionType {
- kScheme, // Matches the URL scheme (e.g. https, tel).
- kHost, // Matches the URL host (e.g. www.google.com).
- kPattern, // Matches the URL pattern (e.g. /abc/*).
-};
-
-// The pattern match type for intent filter pattern condition.
-enum PatternMatchType {
- kNone = 0,
- kLiteral,
- kPrefix,
- kGlob,
-};
-
-// For pattern type of condition, the value match will be based on the pattern
-// match type. If the match_type is kNone, then an exact match with the value
-// will be required.
-struct ConditionValue {
- string value;
- PatternMatchType match_type; // This will be None for non pattern conditions.
-};
-
-// The condition for an intent filter. It matches if the intent contains this
-// condition type and the corresponding value matches with any of the
-// condition_values.
-struct Condition {
- ConditionType condition_type;
- array<ConditionValue> condition_values;
-};
-
-// An intent filter is defined by an app, and contains a list of conditions that
-// an intent needs to match. If all conditions match, then this intent filter
-// matches against an intent.
-struct IntentFilter {
- array<Condition> conditions;
-};
-
-// Action and resource handling request. This includes the scheme and URL at
-// the moment, and will be extended to handle MIME type and file extensions in
-// the future.
-struct Intent {
- string? scheme; // URL scheme. e.g. https.
- string? host; // URL host. e.g. www.google.com.
- string? port; // URL host. e.g. 8080.
- string? path; // URL path. e.g. /abc.
-};
-
-// Represents a group of |app_ids| that is no longer preferred app of their
-// corresponding |intent_filters|.
-struct ReplacedAppPreferences {
- map<string, array<IntentFilter>> replaced_preference;
-};
-
-// The preferred app represents by |app_id| for |intent_fitler|.
-struct PreferredApp {
- IntentFilter intent_filter;
- string app_id;
-};
-
-struct FilePaths {
- array<mojo_base.mojom.FilePath> file_paths;
-};
diff --git a/chromium/chrome/services/keymaster/public/mojom/cert_store.mojom b/chromium/chrome/services/keymaster/public/mojom/cert_store.mojom
index 9a705c1b3b0..d5c07397019 100644
--- a/chromium/chrome/services/keymaster/public/mojom/cert_store.mojom
+++ b/chromium/chrome/services/keymaster/public/mojom/cert_store.mojom
@@ -37,14 +37,15 @@ enum SignatureResult {
// Next method ID: 1
interface CertStoreHost {
// Returns an interface to SecurityTokenOperation.
- GetSecurityTokenOperation@0(SecurityTokenOperation& operation) => ();
+ GetSecurityTokenOperation@0(
+ pending_receiver<SecurityTokenOperation> operation) => ();
};
// Interface exposed by arc-keymaster daemon.
// Next method ID: 1
interface CertStoreInstance {
// Establishes full-duplex communication with the host.
- Init@0(CertStoreHost host_ptr) => ();
+ Init@0(pending_remote<CertStoreHost> host_remote) => ();
};
// Implemented in Chrome.
diff --git a/chromium/chrome/services/sharing/BUILD.gn b/chromium/chrome/services/sharing/BUILD.gn
index 2e78dd96183..7d3500d4f39 100644
--- a/chromium/chrome/services/sharing/BUILD.gn
+++ b/chromium/chrome/services/sharing/BUILD.gn
@@ -28,6 +28,7 @@ source_set("sharing") {
]
deps = [
+ "nearby_decoder",
"//jingle:webrtc_glue",
"//third_party/webrtc_overrides:webrtc_component",
]
diff --git a/chromium/chrome/services/sharing/nearby_decoder/BUILD.gn b/chromium/chrome/services/sharing/nearby_decoder/BUILD.gn
new file mode 100644
index 00000000000..6b7666f303d
--- /dev/null
+++ b/chromium/chrome/services/sharing/nearby_decoder/BUILD.gn
@@ -0,0 +1,47 @@
+# Copyright 2020 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import("//testing/libfuzzer/fuzzer_test.gni")
+
+source_set("nearby_decoder") {
+ sources = [
+ "advertisement.cc",
+ "advertisement.h",
+ "nearby_decoder.cc",
+ "nearby_decoder.h",
+ ]
+
+ deps = [ "//chrome/services/sharing/nearby_decoder/proto" ]
+
+ public_deps = [
+ "//base",
+ "//chrome/services/sharing/public/mojom",
+ "//mojo/public/cpp/bindings",
+ ]
+}
+
+source_set("unit_tests") {
+ testonly = true
+
+ sources = [
+ "advertisement_unittest.cc",
+ "nearby_decoder_unittest.cc",
+ ]
+
+ deps = [
+ ":nearby_decoder",
+ "//base/test:test_support",
+ "//testing/gmock",
+ "//testing/gtest",
+ ]
+}
+
+fuzzer_test("nearby_decoder_fuzzer") {
+ sources = [ "nearby_decoder_fuzzer.cc" ]
+ deps = [
+ ":nearby_decoder",
+ "//base",
+ "//mojo/core/embedder",
+ ]
+}
diff --git a/chromium/chrome/services/speech/proto/BUILD.gn b/chromium/chrome/services/sharing/nearby_decoder/proto/BUILD.gn
index de8ea1d0cef..eccfabf7f61 100644
--- a/chromium/chrome/services/speech/proto/BUILD.gn
+++ b/chromium/chrome/services/sharing/nearby_decoder/proto/BUILD.gn
@@ -2,18 +2,15 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-import("//third_party/grpc/grpc_library.gni")
import("//third_party/protobuf/proto_library.gni")
-proto_library("proto") {
- sources = [
- "any_speech.proto",
- "duration.proto",
- "status_speech.proto",
+group("proto_lite") {
+ public_deps = [
+ ":proto",
+ "//third_party/protobuf:protobuf_lite",
]
}
-cc_grpc_library("cloud_speech_library") {
- sources = [ "cloud_speech.proto" ]
- deps = [ ":proto" ]
+proto_library("proto") {
+ sources = [ "wire_format.proto" ]
}
diff --git a/chromium/chrome/services/sharing/public/mojom/BUILD.gn b/chromium/chrome/services/sharing/public/mojom/BUILD.gn
index be3e851d409..0d6cefed42e 100644
--- a/chromium/chrome/services/sharing/public/mojom/BUILD.gn
+++ b/chromium/chrome/services/sharing/public/mojom/BUILD.gn
@@ -3,11 +3,15 @@ import("//mojo/public/tools/bindings/mojom.gni")
mojom("mojom") {
sources = [
"nearby_connections.mojom",
+ "nearby_connections_types.mojom",
+ "nearby_decoder.mojom",
+ "nearby_decoder_types.mojom",
"sharing.mojom",
"webrtc.mojom",
]
public_deps = [
+ "//device/bluetooth/public/mojom:deprecated_experimental_interfaces",
"//mojo/public/mojom/base",
"//services/network/public/mojom",
"//url/mojom:url_mojom_gurl",
diff --git a/chromium/chrome/services/sharing/public/mojom/nearby_connections.mojom b/chromium/chrome/services/sharing/public/mojom/nearby_connections.mojom
index 1ac9134495d..3cf7aa72359 100644
--- a/chromium/chrome/services/sharing/public/mojom/nearby_connections.mojom
+++ b/chromium/chrome/services/sharing/public/mojom/nearby_connections.mojom
@@ -4,6 +4,9 @@
module location.nearby.connections.mojom;
+import "chrome/services/sharing/public/mojom/nearby_connections_types.mojom";
+import "device/bluetooth/public/mojom/adapter.mojom";
+
// Main interface to control the NearbyConnections library. Implemented in a
// sandboxed process. This interface is used by the browser process to connect
// to remote devices and send / receive raw data packets. Parsing of those
@@ -18,4 +21,14 @@ interface NearbyConnections {
// process and called from a sandboxed process typically at startup to get all
// available mediums.
interface NearbyConnectionsHost {
+ // Gets the current Bluetooth adapter from the host.
+ // There are three cases for the return value:
+ // 1) If Bluetooth is not supported by Chrome on the OS (see
+ // BluetoothAdapterFactory::IsBluetoothSupported) we return a null remote.
+ // 2) If Bluetooth is supported by Chrome on the OS but there is not a valid
+ // adapter, we return an adapter with the AdapterInfo.present=false because
+ // this is the way BluetoothAdapterFactory currently behaves.
+ // 3) If Bluetooth is supported by Chrome on the OS and there is valid adapter
+ // we return an adapter instance with the AdapterInfo.present=true.
+ GetBluetoothAdapter() => (pending_remote<bluetooth.mojom.Adapter>? adapter);
};
diff --git a/chromium/chrome/services/sharing/public/mojom/nearby_connections_types.mojom b/chromium/chrome/services/sharing/public/mojom/nearby_connections_types.mojom
new file mode 100644
index 00000000000..4442143eaac
--- /dev/null
+++ b/chromium/chrome/services/sharing/public/mojom/nearby_connections_types.mojom
@@ -0,0 +1,201 @@
+// Copyright 2020 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+module location.nearby.connections.mojom;
+
+import "mojo/public/mojom/base/file.mojom";
+
+// Generic result status of NearbyConnections API calls.
+enum Status {
+ // The operation was successful.
+ kSuccess,
+ // The operation failed, without any more information.
+ kError,
+ // The app called an API method out of order (i.e. another method is expected
+ // to be called first).
+ kOutOfOrderApiCall,
+ // The app already has active operations (advertising, discovering, or
+ // connected to other devices) with another Strategy. Stop these operations on
+ // the current Strategy before trying to advertise or discover with a new
+ // Strategy.
+ kAlreadyHaveActiveStrategy,
+ // The app is already advertising; call StopAdvertising() before trying to
+ // advertise again.
+ kAlreadyAdvertising,
+ // The app is already discovering; call StopDiscovery() before trying to
+ // discover again.
+ kAlreadyDiscovering,
+ // An attempt to read from/write to a connected remote endpoint failed. If
+ // this occurs repeatedly, consider invoking DisconnectFromEndpoint().
+ kEndpointIOError,
+ // An attempt to interact with a remote endpoint failed because it's unknown
+ // to us -- it's either an endpoint that was never discovered, or an endpoint
+ // that never connected to us (both of which are indicative of bad input from
+ // the client app).
+ kEndpointUnknown,
+ // The remote endpoint rejected the connection request.
+ kConnectionRejected,
+ // The app is already connected to the specified endpoint. Multiple
+ // connections to a remote endpoint cannot be maintained simultaneously.
+ kAlreadyConnectedToEndpoint,
+ // The remote endpoint is not connected; messages cannot be sent to it.
+ kNotConnectedToEndpoint,
+ // There was an error trying to use the device's Bluetooth/WiFi/NFC
+ // capabilities.
+ kRadioError,
+ // An attempt to interact with an in-flight Payload failed because it's
+ // unknown to us.
+ kPayloadUnknown,
+};
+
+// Information about a connection that is being initiated.
+struct ConnectionInfo {
+ // The name of the remote device we're connecting to.
+ string remote_endpoint_name;
+ // A short human-readable authentication token that has been given to both
+ // devices.
+ string authentication_token;
+ // The raw (significantly longer) version of the authentication token of
+ // authentication_token -- this is intended for headless authentication,
+ // typically on devices with no output capabilities, where the authentication
+ // is purely programmatic and does not have the luxury of human intervention.
+ array<uint8> raw_authentication_token;
+ // True if the connection request was initiated from a remote device. False if
+ // this device was the one to try and initiate the connection.
+ bool is_incoming_connection;
+ // Information that represents the remote device.
+ array<uint8> endpoint_info;
+};
+
+// Information about an endpoint when it's discovered.
+struct DiscoveredEndpointInfo {
+ // The ID of the service advertised by the remote endpoint.
+ string service_id;
+ // The human readable name of the remote endpoint.
+ string endpoint_name;
+ // Information advertised by the remote endpoint.
+ array<uint8> endpoint_info;
+};
+
+// The Strategy to be used when discovering or advertising to Nearby devices.
+// The Strategy defines the connectivity requirements for the device, and the
+// topology constraints of the connection.
+enum Strategy {
+ // Peer-to-peer strategy that supports an M-to-N, or cluster-shaped,
+ // connection topology. In other words, this enables connecting amorphous
+ // clusters of devices within radio range (~100m), where each device can both
+ // initiate outgoing connections to M other devices and accept incoming
+ // connections from N other devices.
+ kP2pCluster,
+ // Peer-to-peer strategy that supports a 1-to-N, or star-shaped, connection
+ // topology. In other words, this enables connecting devices within radio
+ // range (~100m) in a star shape, where each device can, at any given time,
+ // play the role of either a hub (where it can accept incoming connections
+ // from N other devices), or a spoke (where it can initiate an outgoing
+ // connection to a single hub), but not both.
+ kP2pStar,
+ // Peer-to-peer strategy that supports a 1-to-1 connection topology. In other
+ // words, this enables connecting to a single device within radio range
+ // (~100m). This strategy will give the absolute highest bandwidth, but will
+ // not allow multiple connections at a time.
+ kP2pPointToPoint,
+};
+
+// Options for a call to NearbyConnections::StartAdvertising().
+struct AdvertisingOptions {
+ // The strategy to use for advertising. Must match the strategy used in
+ // DiscoveryOptions for remote devices to see this advertisement.
+ Strategy strategy;
+ // By default, this option is true. If false, we will not attempt to upgrade
+ // the bandwidth until a call to InitiateBandwidthUpgrade() is made.
+ bool auto_upgrade_bandwidth = true;
+ // By default, this option is true. If false, restrictions on topology will be
+ // ignored. This allows you treat all strategies as kP2pCluster (N to M),
+ // although bandwidth will be severely throttled if you don't maintain the
+ // original topology. When used in conjunction with auto_upgrade_bandwidth,
+ // you can initially connect as a kP2pCluster and then trim connections until
+ // you match kP2pStar or kP2pPointToPoint before upgrading the bandwidth.
+ bool enforce_topology_constraints = true;
+};
+
+// Options for a call to NearbyConnections::StartDiscovery().
+struct DiscoveryOptions {
+ // The strategy to use for discovering. Must match the strategy used in
+ // AdvertisingOptions in order to see advertisements.
+ Strategy strategy;
+};
+
+// A simple payload containing raw bytes.
+struct BytesPayload {
+ // The bytes of this payload.
+ array<uint8> bytes;
+};
+
+// A file payload representing a file.
+struct FilePayload {
+ // The file to which this payload points to. When sending this payload, the
+ // NearbyConnections library reads from this file. When receiving a file
+ // payload it writes to this file.
+ mojo_base.mojom.File file;
+};
+
+// Union of all supported payload types.
+union PayloadContent {
+ // A Payload consisting of a single byte array.
+ BytesPayload bytes;
+ // A Payload representing a file on the device.
+ FilePayload file;
+};
+
+// A Payload sent between devices. Payloads sent with a particular content type
+// will be received as that same type on the other device, e.g. the content for
+// a Payload of type BytesPayload must be received by reading from the bytes
+// field returned by Payload::content::bytes.
+struct Payload {
+ // A unique identifier for this payload. Generated by the sender of the
+ // payload and used to keep track of the transfer progress.
+ int64 id;
+ // The content of this payload which is one of multiple types, see
+ // PayloadContent for all possible types.
+ PayloadContent content;
+};
+
+// The status of the payload transfer at the time of this update.
+enum PayloadStatus {
+ // The payload transfer has completed successfully.
+ kSuccess,
+ // The payload transfer failed.
+ kFailure,
+ // The payload transfer is still in progress.
+ kInProgress,
+ // The payload transfer has been canceled.
+ kCanceled,
+};
+
+// Describes the status for an active Payload transfer, either incoming or
+// outgoing. Delivered to PayloadListener::OnPayloadTransferUpdate.
+struct PayloadTransferUpdate {
+ // The ID for the payload related to this update. Clients should match this
+ // with Payload::id.
+ int64 payload_id;
+ // The status of this payload transfer. Always starts with kInProgress and
+ // ends with one of kSuccess, kFailure or kCanceled.
+ PayloadStatus status;
+ // The total expected bytes of this transfer.
+ uint64 total_bytes;
+ // The number of bytes transferred so far.
+ uint64 bytes_transferred;
+};
+
+// Bandwidth quality of a connection.
+enum BandwidthQuality {
+ // Unknown connection quality.
+ kUnknown,
+ // Low quality, e.g. connected via NFC or BLE.
+ kLow,
+ // Medium quality, e.g. connected via Bluetooth Classic.
+ kMedium,
+ // High quality, e.g. connected via WebRTC or WiFi LAN.
+ kHigh,
+};
diff --git a/chromium/chrome/services/sharing/public/mojom/nearby_decoder.mojom b/chromium/chrome/services/sharing/public/mojom/nearby_decoder.mojom
new file mode 100644
index 00000000000..b8e85d95cdf
--- /dev/null
+++ b/chromium/chrome/services/sharing/public/mojom/nearby_decoder.mojom
@@ -0,0 +1,21 @@
+// Copyright 2020 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+module sharing.mojom;
+
+import "chrome/services/sharing/public/mojom/nearby_decoder_types.mojom";
+import "mojo/public/mojom/base/time.mojom";
+
+// Decode raw data into structured. Runs in the sharing utility process.
+// Called by the NearbySharingService running in the browser process.
+interface NearbySharingDecoder {
+ // Decode the advertisement. The advertisement is sent by a device in
+ // the receiver mode, and may be advertising to everyone or only
+ // known contacts.
+ DecodeAdvertisement(array<uint8> data) => (Advertisement? advertisement);
+
+ // Decode a payload frame. The frame may be one of several types, and is
+ // used by NearbySharingService to manage the connections protocol.
+ DecodeFrame(array<uint8> data) => (Frame? frame);
+};
diff --git a/chromium/chrome/services/sharing/public/mojom/nearby_decoder_types.mojom b/chromium/chrome/services/sharing/public/mojom/nearby_decoder_types.mojom
new file mode 100644
index 00000000000..7c59fb1af35
--- /dev/null
+++ b/chromium/chrome/services/sharing/public/mojom/nearby_decoder_types.mojom
@@ -0,0 +1,210 @@
+// Copyright 2020 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+module sharing.mojom;
+
+import "mojo/public/mojom/base/time.mojom";
+
+// An advertisement send by a device in receiving mode.
+struct Advertisement {
+ // Random data erived from a device's private key.
+ array<uint8, 2> salt;
+
+ // Derived from a device's private key. Identifying data for the device.
+ array<uint8, 14> encrypted_metadata;
+
+ // If present, the device is visible to everyone rather than contacts only.
+ string? device_name;
+};
+
+// A frame used when sending messages over the wire.
+union Frame {
+ // A frame of one possible type.
+ V1Frame v1;
+};
+
+// The possible types of a frame.
+union V1Frame {
+ IntroductionFrame introduction;
+
+ ConnectionResponseFrame connection_response;
+
+ PairedKeyEncryptionFrame paired_key_encryption;
+
+ PairedKeyResultFrame paired_key_result;
+
+ CertificateInfoFrame certificate_info;
+};
+
+// An introduction packet sent by the sending side. Contains a list of files
+// they'd like to share.
+struct IntroductionFrame {
+ // Description of a file to be sent.
+ array<FileMetadata> file_metadata;
+
+ // Description of text to be sent.
+ array<TextMetadata> text_metadata;
+
+ // The required app package to open the content. May be null.
+ string? required_package;
+
+ // Credentials of the wifi network.
+ array<WifiCredentialsMetadata> wifi_credentials_metadata;
+};
+
+// File metadata. Does not include the actual bytes of the shared file
+// in transit.
+struct FileMetadata {
+ enum Type {
+ kUnknown = 0,
+ kImage = 1,
+ kVideo = 2,
+ kApp = 3,
+ kAudio = 4
+ };
+
+ // The human readable name of this file (eg. 'Cookbook.pdf').
+ string name;
+
+ // The type of file (eg. 'kImage' from 'dog.jpg'). Specifying a type helps
+ // provide a richer experience on the receiving side.
+ Type type = kUnknown;
+
+ // The FILE payload id that will be sent as a follow up containing the actual
+ // bytes of the file.
+ int64 payload_id;
+
+ // The total size of the file.
+ uint64 size;
+
+ // The mimeType of file (eg. 'image/jpeg' from 'dog.jpg'). Specifying a
+ // mimeType helps provide a richer experience on receiving side.
+ string mime_type = "application/octet-stream";
+};
+
+// Text metadata. Does not include the actual bytes of the text in transit.
+struct TextMetadata {
+ enum Type {
+ kUnknown = 0,
+ kText = 1,
+ // Open with browsers.
+ kUrl = 2,
+ // Open with map apps.
+ kAddress = 3,
+ // Dial.
+ kPhoneNumber = 4
+ };
+
+ // The title of the text content.
+ string text_title;
+
+ // The type of text (phone number, url, address, or plain text).
+ Type type = kUnknown;
+
+ // The BYTE payload id that will be sent as a follow up containing the actual
+ // bytes of the text.
+ int64 payload_id;
+
+ // The size of the text content.
+ uint64 size;
+};
+
+// Wifi credentails metadata. Describes the wifi network to be used by the
+// connection.
+struct WifiCredentialsMetadata {
+ enum SecurityType {
+ kUnknownSecurityType = 0,
+ kOpen = 1,
+ kWpaPsk = 2,
+ kWep = 3
+ };
+
+ // The Wifi network name. This will be sent in introduction.
+ string ssid;
+
+ // The security type of network (OPEN, WPA_PSK, WEP).
+ SecurityType security_type = kUnknownSecurityType;
+
+ // The BYTE payload id that will be sent as a follow up containing the
+ // password.
+ int64 payload_id;
+};
+
+// A response packet sent by the receiving side. Accepts or rejects the list of
+// files.
+struct ConnectionResponseFrame {
+ enum Status {
+ kUnknown = 0,
+ kAccept = 1,
+ kReject = 2,
+ kNotEnoughSpace = 3,
+ kUnsupportedAttachmentType = 4,
+ kTimedOut = 5
+ };
+
+ // The receiving side's response.
+ Status status;
+};
+
+// A paired key encryption packet sent between devices, contains signed data.
+struct PairedKeyEncryptionFrame {
+ // The encrypted data in byte array format.
+ // The size of byte array generated by signing should be 72.
+ array<uint8> signed_data;
+
+ // The HMAC 256 based HKDF of UKEY2 authentication key with
+ // authenticity_key salt.
+ // The size of bytes of secret id after hash should be 6.
+ array<uint8> secret_id_hash;
+};
+
+// A paired key verification result packet sent between devices.
+struct PairedKeyResultFrame {
+ enum Status {
+ kUnknown = 0,
+ kSuccess = 1,
+ kFail = 2,
+ kUnable = 3
+ };
+
+ // The verification result.
+ Status status;
+};
+
+// A package containing certificate info to be shared to remote device offline.
+struct CertificateInfoFrame {
+ // The public certificates to be shared with remote devices.
+ array<PublicCertificate> public_certificate;
+};
+
+// A public certificate from the local device.
+struct PublicCertificate {
+ // The unique id of the public certificate.
+ array<uint8> secret_id;
+
+ // A bytes representation of a Secret Key owned by contact, to decrypt the
+ // metadata_key stored within the advertisement.
+ // The size should be 32.
+ array<uint8> authenticity_key;
+
+ // A bytes representation a public key of X509Certificate, owned by contact,
+ // to decrypt UKEY2 (from Nearby Connections API) as a hand shake in
+ // contact verification phase.
+ array<uint8> public_key;
+
+ // Time from epoch when this certificate becomes effective.
+ mojo_base.mojom.Time start_time;
+
+ // Time from epoch when this certificate expires.
+ mojo_base.mojom.Time end_time;
+
+ // The encrypted metadata in bytes, contains personal information of the
+ // device/user who created this certificate. Needs to be decrypted into bytes,
+ // and converted back to EncryptedMetadata object to access fields.
+ array<uint8> encrypted_metadata_bytes;
+
+ // The tag for verifying metadata_encryption_key.
+ // The size should be 32.
+ array<uint8> metadata_encryption_key_tag;
+};
diff --git a/chromium/chrome/services/sharing/public/mojom/sharing.mojom b/chromium/chrome/services/sharing/public/mojom/sharing.mojom
index 6718bac85fc..300955eb765 100644
--- a/chromium/chrome/services/sharing/public/mojom/sharing.mojom
+++ b/chromium/chrome/services/sharing/public/mojom/sharing.mojom
@@ -5,6 +5,7 @@
module sharing.mojom;
import "chrome/services/sharing/public/mojom/nearby_connections.mojom";
+import "chrome/services/sharing/public/mojom/nearby_decoder.mojom";
import "chrome/services/sharing/public/mojom/webrtc.mojom";
import "services/network/public/mojom/p2p.mojom";
import "services/network/public/mojom/mdns_responder.mojom";
@@ -41,4 +42,8 @@ interface Sharing {
host)
=> (pending_remote<location.nearby.connections.mojom.NearbyConnections>
connections);
+
+ // Creates a new Nearby Sharing Decoder.
+ CreateNearbySharingDecoder()
+ => (pending_remote<sharing.mojom.NearbySharingDecoder> decoder);
};
diff --git a/chromium/chrome/services/speech/BUILD.gn b/chromium/chrome/services/speech/BUILD.gn
index ebfdec781ff..c9c50a55dbe 100644
--- a/chromium/chrome/services/speech/BUILD.gn
+++ b/chromium/chrome/services/speech/BUILD.gn
@@ -12,6 +12,8 @@ buildflag_header("buildflags") {
source_set("lib") {
sources = [
+ "cloud_speech_recognition_client.cc",
+ "cloud_speech_recognition_client.h",
"speech_recognition_recognizer_impl.cc",
"speech_recognition_recognizer_impl.h",
"speech_recognition_service_impl.cc",
@@ -27,10 +29,32 @@ source_set("lib") {
deps = [
":buildflags",
"//base",
- "//services/service_manager/public/cpp",
+ "//components/speech",
+ "//content/public/browser:proto",
+ "//mojo/public/cpp/bindings",
+ "//net",
+ "//services/network/public/cpp",
+ "//services/network/public/mojom",
]
if (enable_soda) {
deps += [ "//chrome/services/soda/internal" ]
}
}
+
+source_set("unit_tests") {
+ testonly = true
+
+ sources = [ "cloud_speech_recognition_client_unittest.cc" ]
+
+ deps = [
+ ":lib",
+ "//base",
+ "//base/test:test_support",
+ "//chrome/test:test_support",
+ "//components/speech",
+ "//content/public/browser:proto",
+ "//testing/gmock",
+ "//testing/gtest",
+ ]
+}
diff --git a/chromium/chrome/services/util_win/BUILD.gn b/chromium/chrome/services/util_win/BUILD.gn
index 265c4609a0e..141967acdb5 100644
--- a/chromium/chrome/services/util_win/BUILD.gn
+++ b/chromium/chrome/services/util_win/BUILD.gn
@@ -10,6 +10,8 @@ source_set("lib") {
"av_products.h",
"processor_metrics.cc",
"processor_metrics.h",
+ "util_read_icon.cc",
+ "util_read_icon.h",
"util_win_impl.cc",
"util_win_impl.h",
]
diff --git a/chromium/chrome/services/util_win/public/mojom/BUILD.gn b/chromium/chrome/services/util_win/public/mojom/BUILD.gn
index 9a6444c68b4..1f34f8be1d4 100644
--- a/chromium/chrome/services/util_win/public/mojom/BUILD.gn
+++ b/chromium/chrome/services/util_win/public/mojom/BUILD.gn
@@ -5,7 +5,13 @@
import("//mojo/public/tools/bindings/mojom.gni")
mojom("mojom") {
- sources = [ "util_win.mojom" ]
+ sources = [
+ "util_read_icon.mojom",
+ "util_win.mojom",
+ ]
- public_deps = [ "//mojo/public/mojom/base" ]
+ public_deps = [
+ "//mojo/public/mojom/base",
+ "//ui/gfx/image/mojom",
+ ]
}
diff --git a/chromium/chrome/services/util_win/public/mojom/util_read_icon.mojom b/chromium/chrome/services/util_win/public/mojom/util_read_icon.mojom
new file mode 100644
index 00000000000..22ca4790280
--- /dev/null
+++ b/chromium/chrome/services/util_win/public/mojom/util_read_icon.mojom
@@ -0,0 +1,24 @@
+// Copyright 2020 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+module chrome.mojom;
+
+import "mojo/public/mojom/base/file_path.mojom";
+import "mojo/public/mojom/base/string16.mojom";
+import "ui/gfx/image/mojom/image.mojom";
+
+// Correspond to SHGFI_*ICON.
+enum IconSize {
+ kSmall,
+ kNormal,
+ kLarge,
+};
+
+// Utility process interface exposed to the browser process on OS_WIN. Allows
+// for sandboxing when reading icons from downloaded files.
+interface UtilReadIcon {
+ // Reads the primary icon from |file| using |size| as a hint.
+ ReadIcon(mojo_base.mojom.FilePath filename, IconSize size) =>
+ (gfx.mojom.ImageSkia? icon, mojo_base.mojom.String16 group);
+};
diff --git a/chromium/chrome/services/wilco_dtc_supportd/public/mojom/wilco_dtc_supportd.mojom b/chromium/chrome/services/wilco_dtc_supportd/public/mojom/wilco_dtc_supportd.mojom
index 7dad6f23b03..70e2d0715a5 100644
--- a/chromium/chrome/services/wilco_dtc_supportd/public/mojom/wilco_dtc_supportd.mojom
+++ b/chromium/chrome/services/wilco_dtc_supportd/public/mojom/wilco_dtc_supportd.mojom
@@ -18,6 +18,7 @@ enum WilcoDtcSupportdWebRequestHttpMethod {
kHead,
kPost,
kPut,
+ kPatch,
};
[Extensible]
@@ -70,7 +71,7 @@ interface WilcoDtcSupportdService {
// JSON. Delivery of the message is not guaranteed (for example, if the
// wilco_dtc daemon isn't running at the moment).
//
- // NOTE: the |json_message| message must not exceed 1 MB (1'000'000 bytes).
+ // NOTE: the |json_message| message must not exceed 1 MB (1 000 000 bytes).
//
// The response will contain the JSON message returned by the wilco_dtc
// daemon. The response handle will be unset if the request wasn't delivered
@@ -110,7 +111,7 @@ interface WilcoDtcSupportdClient {
// * |headers| - the list of HTTP headers.
// * |request_body| - the body of the HTTP request.
// NOTE: the total size of all |handle| fields in the request must not exceed
- // 1 MB (1'000'000 bytes).
+ // 1 MB (1 000 000 bytes).
//
// The response to that web request:
// * the |status| of the web request,
@@ -118,7 +119,7 @@ interface WilcoDtcSupportdClient {
// |kHttpError|, otherwise the HTTP status code is 0.
// * |response_body| - the web response payload. The handle is valid only
// if |status| is |kOk| or |kHttpError|. And the length
- // is guaranteed to not exceed 1 MB (1'000'000 bytes).
+ // is guaranteed to not exceed 1 MB (1 000 000 bytes).
PerformWebRequest@0(WilcoDtcSupportdWebRequestHttpMethod http_method,
handle url,
array<handle> headers,
@@ -131,13 +132,13 @@ interface WilcoDtcSupportdClient {
// JSON. Delivery of the message is not guaranteed (for example, if no user is
// currently logged in that has the wilco_dtc UI extension installed).
//
- // NOTE: the size of the |json_message| must not exceed 1 MB (1'000'000
+ // NOTE: the size of the |json_message| must not exceed 1 MB (1 000 000
// bytes).
//
// The response will contain the JSON message returned by the extension. The
// response handle will be unset if the request wasn't delivered to the
// extension or the extension made no reply. The response is guaranteed to not
- // exceed 1 MB (1'000'000 bytes).
+ // exceed 1 MB (1 000 000 bytes).
//
// NOTE: Both request and response messages are opaque to Chrome and not
// interpreted by it in any way (except for the JSON validity verification
@@ -149,7 +150,7 @@ interface WilcoDtcSupportdClient {
=> (handle? response_json_message);
// Retrieves a JSON-formatted configuration data. The length of
- // |json_configuration_data| does not exceed 20'000 bytes.
+ // |json_configuration_data| does not exceed 20 000 bytes.
GetConfigurationData@2() => (string json_configuration_data);
// Handles actionable EC events related to power (i.e., battery,