Commit e0c15284 authored by Hidehiko Abe's avatar Hidehiko Abe Committed by Chromium LUCI CQ

Rename AshChromeService to Crosapi.

In order to make crosapi more isolated from actual ash/lacros
implementations, this CL renames AshChromeService and its
corresponding variables to Crosapi.
Also, AshChromeServiceImpl is renamed to CrosapiAsh,
following the common naming convention in Chrome that
it is the crosapi implementation in Ash.

BUG=1148448
TEST=Launch lacros on a device.

Change-Id: I600188445949a4de60325f5419f137f61360d0e4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2640523
Commit-Queue: Hidehiko Abe <hidehiko@chromium.org>
Reviewed-by: default avatarJames Cook <jamescook@chromium.org>
Cr-Commit-Position: refs/heads/master@{#845941}
parent 38fad67d
......@@ -1049,8 +1049,6 @@ source_set("chromeos") {
"chrome_content_browser_client_chromeos_part.h",
"concierge_helper_service.cc",
"concierge_helper_service.h",
"crosapi/ash_chrome_service_impl.cc",
"crosapi/ash_chrome_service_impl.h",
"crosapi/browser_loader.cc",
"crosapi/browser_loader.h",
"crosapi/browser_manager.cc",
......@@ -1062,6 +1060,8 @@ source_set("chromeos") {
"crosapi/cert_database_ash.h",
"crosapi/clipboard_ash.cc",
"crosapi/clipboard_ash.h",
"crosapi/crosapi_ash.cc",
"crosapi/crosapi_ash.h",
"crosapi/device_attributes_ash.cc",
"crosapi/device_attributes_ash.h",
"crosapi/environment_provider.cc",
......
......@@ -31,9 +31,9 @@
#include "base/task/task_traits.h"
#include "base/task/thread_pool.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chromeos/crosapi/ash_chrome_service_impl.h"
#include "chrome/browser/chromeos/crosapi/browser_loader.h"
#include "chrome/browser/chromeos/crosapi/browser_util.h"
#include "chrome/browser/chromeos/crosapi/crosapi_ash.h"
#include "chrome/browser/chromeos/crosapi/environment_provider.h"
#include "chrome/browser/chromeos/crosapi/test_mojo_connection_manager.h"
#include "chrome/browser/component_updater/cros_component_manager.h"
......@@ -399,7 +399,7 @@ void BrowserManager::StartWithLogFile(base::ScopedFD logfd) {
environment_provider_.get(), channel.TakeLocalEndpoint(),
base::BindOnce(&BrowserManager::OnMojoDisconnected,
weak_factory_.GetWeakPtr()),
base::BindOnce(&BrowserManager::OnAshChromeServiceReceiverReceived,
base::BindOnce(&BrowserManager::OnCrosapiReceiverReceived,
weak_factory_.GetWeakPtr()));
browser_service_.QueryVersion(
......@@ -422,11 +422,10 @@ void BrowserManager::StartWithLogFile(base::ScopedFD logfd) {
channel.RemoteProcessLaunchAttempted();
}
void BrowserManager::OnAshChromeServiceReceiverReceived(
mojo::PendingReceiver<crosapi::mojom::AshChromeService> pending_receiver) {
void BrowserManager::OnCrosapiReceiverReceived(
mojo::PendingReceiver<mojom::Crosapi> pending_receiver) {
DCHECK_EQ(state_, State::STARTING);
ash_chrome_service_ =
std::make_unique<AshChromeServiceImpl>(std::move(pending_receiver));
crosapi_ = std::make_unique<CrosapiAsh>(std::move(pending_receiver));
state_ = State::RUNNING;
base::UmaHistogramMediumTimes("ChromeOS.Lacros.StartTime",
base::TimeTicks::Now() - lacros_launch_time_);
......@@ -444,7 +443,7 @@ void BrowserManager::OnMojoDisconnected() {
state_ = State::TERMINATING;
browser_service_.reset();
ash_chrome_service_ = nullptr;
crosapi_ = nullptr;
base::ThreadPool::PostTaskAndReply(
FROM_HERE, {base::WithBaseSyncPrimitives()},
base::BindOnce(&TerminateLacrosChrome, std::move(lacros_process_)),
......
......@@ -25,8 +25,10 @@ class CrOSComponentManager;
} // namespace component_updater
namespace crosapi {
namespace mojom {
class Crosapi;
} // namespace mojom
class AshChromeServiceImpl;
class BrowserLoader;
class TestMojoConnectionManager;
......@@ -154,10 +156,9 @@ class BrowserManager : public session_manager::SessionManagerObserver {
// by logfd.
void StartWithLogFile(base::ScopedFD logfd);
// Called when PendingReceiver of AshChromeService is passed from
// lacros-chrome.
void OnAshChromeServiceReceiverReceived(
mojo::PendingReceiver<crosapi::mojom::AshChromeService> pending_receiver);
// Called when PendingReceiver of Crosapi is passed from lacros-chrome.
void OnCrosapiReceiverReceived(
mojo::PendingReceiver<mojom::Crosapi> pending_receiver);
// Called when the Mojo connection to lacros-chrome is disconnected.
// It may be "just a Mojo error" or "lacros-chrome crash".
......@@ -207,11 +208,11 @@ class BrowserManager : public session_manager::SessionManagerObserver {
// Proxy to BrowserService mojo service in lacros-chrome.
// Available during lacros-chrome is running.
mojo::Remote<crosapi::mojom::BrowserService> browser_service_;
mojo::Remote<mojom::BrowserService> browser_service_;
// Implementation of AshChromeService Mojo APIs.
// Implementation of Crosapi Mojo APIs.
// Instantiated on receiving the PendingReceiver from lacros-chrome.
std::unique_ptr<AshChromeServiceImpl> ash_chrome_service_;
std::unique_ptr<mojom::Crosapi> crosapi_;
// Helps set up and manage the mojo connections between lacros-chrome and
// ash-chrome in testing environment. Only applicable when
......
......@@ -96,8 +96,7 @@ void AddVersion(InterfaceVersions* map) {
mojom::BrowserInitParamsPtr GetBrowserInitParams(
EnvironmentProvider* environment_provider) {
auto params = mojom::BrowserInitParams::New();
params->ash_chrome_service_version =
crosapi::mojom::AshChromeService::Version_;
params->crosapi_version = crosapi::mojom::Crosapi::Version_;
params->deprecated_ash_metrics_enabled_has_value = true;
PrefService* local_state = g_browser_process->local_state();
params->ash_metrics_enabled =
......@@ -216,13 +215,13 @@ bool IsLacrosWindow(const aura::Window* window) {
base::flat_map<base::Token, uint32_t> GetInterfaceVersions() {
static_assert(
crosapi::mojom::AshChromeService::Version_ == 13,
crosapi::mojom::Crosapi::Version_ == 13,
"if you add a new crosapi, please add it to the version map here");
InterfaceVersions versions;
AddVersion<crosapi::mojom::AccountManager>(&versions);
AddVersion<crosapi::mojom::AshChromeService>(&versions);
AddVersion<crosapi::mojom::CertDatabase>(&versions);
AddVersion<crosapi::mojom::Clipboard>(&versions);
AddVersion<crosapi::mojom::Crosapi>(&versions);
AddVersion<crosapi::mojom::DeviceAttributes>(&versions);
AddVersion<crosapi::mojom::Feedback>(&versions);
AddVersion<crosapi::mojom::FileManager>(&versions);
......@@ -246,9 +245,8 @@ mojo::Remote<crosapi::mojom::BrowserService> SendMojoInvitationToLacrosChrome(
EnvironmentProvider* environment_provider,
mojo::PlatformChannelEndpoint local_endpoint,
base::OnceClosure mojo_disconnected_callback,
base::OnceCallback<
void(mojo::PendingReceiver<crosapi::mojom::AshChromeService>)>
ash_chrome_service_callback) {
base::OnceCallback<void(mojo::PendingReceiver<crosapi::mojom::Crosapi>)>
crosapi_callback) {
mojo::OutgoingInvitation invitation;
mojo::Remote<crosapi::mojom::BrowserService> browser_service;
browser_service.Bind(mojo::PendingRemote<crosapi::mojom::BrowserService>(
......@@ -260,8 +258,7 @@ mojo::Remote<crosapi::mojom::BrowserService> SendMojoInvitationToLacrosChrome(
// becomes mature enough.
browser_service->InitDeprecated(GetBrowserInitParams(environment_provider));
browser_service->RequestAshChromeServiceReceiver(
std::move(ash_chrome_service_callback));
browser_service->RequestCrosapiReceiver(std::move(crosapi_callback));
mojo::OutgoingInvitation::Send(std::move(invitation),
base::kNullProcessHandle,
std::move(local_endpoint));
......
......@@ -77,9 +77,8 @@ mojo::Remote<crosapi::mojom::BrowserService> SendMojoInvitationToLacrosChrome(
::crosapi::EnvironmentProvider* environment_provider,
mojo::PlatformChannelEndpoint local_endpoint,
base::OnceClosure mojo_disconnected_callback,
base::OnceCallback<
void(mojo::PendingReceiver<crosapi::mojom::AshChromeService>)>
ash_chrome_service_callback);
base::OnceCallback<void(mojo::PendingReceiver<crosapi::mojom::Crosapi>)>
crosapi_callback);
// Creates a memory backed file containing the serialized |params|,
// and returns its FD.
......
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/chromeos/crosapi/ash_chrome_service_impl.h"
#include "chrome/browser/chromeos/crosapi/crosapi_ash.h"
#include <memory>
#include <utility>
......@@ -43,8 +43,7 @@
namespace crosapi {
AshChromeServiceImpl::AshChromeServiceImpl(
mojo::PendingReceiver<mojom::AshChromeService> pending_receiver)
CrosapiAsh::CrosapiAsh(mojo::PendingReceiver<mojom::Crosapi> pending_receiver)
: receiver_(this, std::move(pending_receiver)),
device_attributes_ash_(std::make_unique<DeviceAttributesAsh>()),
file_manager_ash_(std::make_unique<FileManagerAsh>()),
......@@ -64,12 +63,12 @@ AshChromeServiceImpl::AshChromeServiceImpl(
url_handler_ash_(std::make_unique<UrlHandlerAsh>()) {
// TODO(hidehiko): Remove non-critical log from here.
// Currently this is the signal that the connection is established.
LOG(WARNING) << "AshChromeService connected.";
LOG(WARNING) << "Crosapi connected.";
}
AshChromeServiceImpl::~AshChromeServiceImpl() = default;
CrosapiAsh::~CrosapiAsh() = default;
void AshChromeServiceImpl::BindAccountManager(
void CrosapiAsh::BindAccountManager(
mojo::PendingReceiver<mojom::AccountManager> receiver) {
// Assumptions:
// 1. TODO(https://crbug.com/1102768): Multi-Signin / Fast-User-Switching is
......@@ -99,97 +98,94 @@ void AshChromeServiceImpl::BindAccountManager(
account_manager_ash->BindReceiver(std::move(receiver));
}
void AshChromeServiceImpl::BindFileManager(
void CrosapiAsh::BindFileManager(
mojo::PendingReceiver<crosapi::mojom::FileManager> receiver) {
file_manager_ash_->BindReceiver(std::move(receiver));
}
void AshChromeServiceImpl::BindKeystoreService(
void CrosapiAsh::BindKeystoreService(
mojo::PendingReceiver<crosapi::mojom::KeystoreService> receiver) {
keystore_service_ash_->BindReceiver(std::move(receiver));
}
void AshChromeServiceImpl::BindMessageCenter(
void CrosapiAsh::BindMessageCenter(
mojo::PendingReceiver<mojom::MessageCenter> receiver) {
message_center_ash_->BindReceiver(std::move(receiver));
}
void AshChromeServiceImpl::BindMetricsReporting(
void CrosapiAsh::BindMetricsReporting(
mojo::PendingReceiver<mojom::MetricsReporting> receiver) {
metrics_reporting_ash_->BindReceiver(std::move(receiver));
}
void AshChromeServiceImpl::BindSelectFile(
void CrosapiAsh::BindSelectFile(
mojo::PendingReceiver<mojom::SelectFile> receiver) {
select_file_ash_->BindReceiver(std::move(receiver));
}
void AshChromeServiceImpl::BindScreenManager(
void CrosapiAsh::BindScreenManager(
mojo::PendingReceiver<mojom::ScreenManager> receiver) {
screen_manager_ash_->BindReceiver(std::move(receiver));
}
void AshChromeServiceImpl::BindHidManager(
void CrosapiAsh::BindHidManager(
mojo::PendingReceiver<device::mojom::HidManager> receiver) {
content::GetDeviceService().BindHidManager(std::move(receiver));
}
void AshChromeServiceImpl::BindFeedback(
mojo::PendingReceiver<mojom::Feedback> receiver) {
void CrosapiAsh::BindFeedback(mojo::PendingReceiver<mojom::Feedback> receiver) {
feedback_ash_->BindReceiver(std::move(receiver));
}
void AshChromeServiceImpl::BindMediaSessionController(
void CrosapiAsh::BindMediaSessionController(
mojo::PendingReceiver<media_session::mojom::MediaControllerManager>
receiver) {
content::GetMediaSessionService().BindMediaControllerManager(
std::move(receiver));
}
void AshChromeServiceImpl::BindMediaSessionAudioFocus(
void CrosapiAsh::BindMediaSessionAudioFocus(
mojo::PendingReceiver<media_session::mojom::AudioFocusManager> receiver) {
content::GetMediaSessionService().BindAudioFocusManager(std::move(receiver));
}
void AshChromeServiceImpl::BindMediaSessionAudioFocusDebug(
void CrosapiAsh::BindMediaSessionAudioFocusDebug(
mojo::PendingReceiver<media_session::mojom::AudioFocusManagerDebug>
receiver) {
content::GetMediaSessionService().BindAudioFocusManagerDebug(
std::move(receiver));
}
void AshChromeServiceImpl::BindCertDatabase(
void CrosapiAsh::BindCertDatabase(
mojo::PendingReceiver<mojom::CertDatabase> receiver) {
cert_database_ash_->BindReceiver(std::move(receiver));
}
void AshChromeServiceImpl::BindTestController(
void CrosapiAsh::BindTestController(
mojo::PendingReceiver<mojom::TestController> receiver) {
test_controller_ash_->BindReceiver(std::move(receiver));
}
void AshChromeServiceImpl::BindClipboard(
void CrosapiAsh::BindClipboard(
mojo::PendingReceiver<mojom::Clipboard> receiver) {
clipboard_ash_->BindReceiver(std::move(receiver));
}
void AshChromeServiceImpl::BindDeviceAttributes(
void CrosapiAsh::BindDeviceAttributes(
mojo::PendingReceiver<mojom::DeviceAttributes> receiver) {
device_attributes_ash_->BindReceiver(std::move(receiver));
}
void AshChromeServiceImpl::BindPrefs(
mojo::PendingReceiver<mojom::Prefs> receiver) {
void CrosapiAsh::BindPrefs(mojo::PendingReceiver<mojom::Prefs> receiver) {
prefs_ash_->BindReceiver(std::move(receiver));
}
void AshChromeServiceImpl::BindUrlHandler(
void CrosapiAsh::BindUrlHandler(
mojo::PendingReceiver<mojom::UrlHandler> receiver) {
url_handler_ash_->BindReceiver(std::move(receiver));
}
void AshChromeServiceImpl::OnBrowserStartup(
mojom::BrowserInfoPtr browser_info) {
void CrosapiAsh::OnBrowserStartup(mojom::BrowserInfoPtr browser_info) {
BrowserManager::Get()->set_browser_version(browser_info->browser_version);
}
......
......@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_CHROMEOS_CROSAPI_ASH_CHROME_SERVICE_IMPL_H_
#define CHROME_BROWSER_CHROMEOS_CROSAPI_ASH_CHROME_SERVICE_IMPL_H_
#ifndef CHROME_BROWSER_CHROMEOS_CROSAPI_CROSAPI_ASH_H_
#define CHROME_BROWSER_CHROMEOS_CROSAPI_CROSAPI_ASH_H_
#include <memory>
......@@ -27,15 +27,14 @@ class SelectFileAsh;
class TestControllerAsh;
class UrlHandlerAsh;
// Implementation of AshChromeService. It provides a set of APIs that
// lacros-chrome can call into.
class AshChromeServiceImpl : public mojom::AshChromeService {
// Implementation of Crosapi in Ash. It provides a set of APIs that
// crosapi clients, such as lacros-chrome, can call into.
class CrosapiAsh : public mojom::Crosapi {
public:
explicit AshChromeServiceImpl(
mojo::PendingReceiver<mojom::AshChromeService> pending_receiver);
~AshChromeServiceImpl() override;
explicit CrosapiAsh(mojo::PendingReceiver<mojom::Crosapi> pending_receiver);
~CrosapiAsh() override;
// crosapi::mojom::AshChromeService:
// crosapi::mojom::Crosapi:
void BindAccountManager(
mojo::PendingReceiver<mojom::AccountManager> receiver) override;
void BindCertDatabase(
......@@ -75,7 +74,7 @@ class AshChromeServiceImpl : public mojom::AshChromeService {
mojo::PendingReceiver<mojom::UrlHandler> receiver) override;
private:
mojo::Receiver<mojom::AshChromeService> receiver_;
mojo::Receiver<mojom::Crosapi> receiver_;
std::unique_ptr<DeviceAttributesAsh> device_attributes_ash_;
std::unique_ptr<FileManagerAsh> file_manager_ash_;
......@@ -94,4 +93,4 @@ class AshChromeServiceImpl : public mojom::AshChromeService {
} // namespace crosapi
#endif // CHROME_BROWSER_CHROMEOS_CROSAPI_ASH_CHROME_SERVICE_IMPL_H_
#endif // CHROME_BROWSER_CHROMEOS_CROSAPI_CROSAPI_ASH_H_
......@@ -13,8 +13,8 @@
#include "base/task/post_task.h"
#include "base/task/task_traits.h"
#include "base/task/thread_pool.h"
#include "chrome/browser/chromeos/crosapi/ash_chrome_service_impl.h"
#include "chrome/browser/chromeos/crosapi/browser_util.h"
#include "chrome/browser/chromeos/crosapi/crosapi_ash.h"
#include "chrome/common/chrome_paths.h"
#include "chromeos/constants/chromeos_switches.h"
#include "mojo/public/cpp/platform/named_platform_channel.h"
......@@ -103,9 +103,8 @@ void TestMojoConnectionManager::OnTestingSocketAvailable() {
environment_provider_.get(), channel.TakeLocalEndpoint(),
base::BindOnce(&TestMojoConnectionManager::OnMojoDisconnected,
weak_factory_.GetWeakPtr()),
base::BindOnce(
&TestMojoConnectionManager::OnAshChromeServiceReceiverReceived,
weak_factory_.GetWeakPtr()));
base::BindOnce(&TestMojoConnectionManager::OnCrosapiReceiverReceived,
weak_factory_.GetWeakPtr()));
base::ScopedFD startup_fd =
browser_util::CreateStartupData(environment_provider_.get());
......@@ -129,16 +128,15 @@ void TestMojoConnectionManager::OnTestingSocketAvailable() {
}
}
void TestMojoConnectionManager::OnAshChromeServiceReceiverReceived(
mojo::PendingReceiver<crosapi::mojom::AshChromeService> pending_receiver) {
ash_chrome_service_ =
std::make_unique<AshChromeServiceImpl>(std::move(pending_receiver));
void TestMojoConnectionManager::OnCrosapiReceiverReceived(
mojo::PendingReceiver<crosapi::mojom::Crosapi> pending_receiver) {
crosapi_ = std::make_unique<CrosapiAsh>(std::move(pending_receiver));
LOG(INFO) << "Connection to lacros-chrome is established.";
}
void TestMojoConnectionManager::OnMojoDisconnected() {
browser_service_.reset();
ash_chrome_service_ = nullptr;
crosapi_ = nullptr;
LOG(WARNING) << "Mojo to lacros-chrome is disconnected.";
}
......
......@@ -18,8 +18,9 @@
#include "mojo/public/cpp/bindings/remote.h"
namespace crosapi {
class AshChromeServiceImpl;
namespace mojom {
class Crosapi;
} // namespace mojom
// An extension of BrowserManager to help set up and manage the mojo connections
// between the test executable and ash-chrome in testing environment.
......@@ -52,10 +53,9 @@ class TestMojoConnectionManager {
// Called when a client, such as a test launcher, attempts to connect.
void OnTestingSocketAvailable();
// Called when PendingReceiver of AshChromeService is passed from
// lacros-chrome.
void OnAshChromeServiceReceiverReceived(
mojo::PendingReceiver<crosapi::mojom::AshChromeService> pending_receiver);
// Called when PendingReceiver of Crosapi is passed from lacros-chrome.
void OnCrosapiReceiverReceived(
mojo::PendingReceiver<crosapi::mojom::Crosapi> pending_receiver);
// Called when the Mojo connection to lacros-chrome is disconnected.
// It may be "just a Mojo error" or "test is finished".
......@@ -66,9 +66,9 @@ class TestMojoConnectionManager {
// Available during the connected browser is running.
mojo::Remote<crosapi::mojom::BrowserService> browser_service_;
// Implementation of AshChromeService Mojo APIs.
// Implementation of Crosapi Mojo APIs.
// Instantiated on receiving the PendingReceiver from lacros-chrome.
std::unique_ptr<AshChromeServiceImpl> ash_chrome_service_;
std::unique_ptr<crosapi::mojom::Crosapi> crosapi_;
// A socket for a client, such as a test launcher, to connect to.
base::ScopedFD testing_socket_;
......
......@@ -45,11 +45,11 @@ class TestBrowserService : public crosapi::mojom::BrowserService {
init_is_called_ = true;
}
void RequestAshChromeServiceReceiver(
RequestAshChromeServiceReceiverCallback callback) override {
void RequestCrosapiReceiver(
RequestCrosapiReceiverCallback callback) override {
EXPECT_TRUE(init_is_called_);
std::move(callback).Run(ash_chrome_service_.BindNewPipeAndPassReceiver());
request_ash_chrome_service_is_called_ = true;
std::move(callback).Run(crosapi_.BindNewPipeAndPassReceiver());
request_crosapi_is_called_ = true;
run_loop_.Quit();
}
......@@ -60,19 +60,17 @@ class TestBrowserService : public crosapi::mojom::BrowserService {
bool init_is_called() { return init_is_called_; }
bool request_ash_chrome_service_is_called() {
return request_ash_chrome_service_is_called_;
}
bool request_crosapi_is_called() { return request_crosapi_is_called_; }
private:
mojo::Receiver<mojom::BrowserService> receiver_;
bool init_is_called_ = false;
bool request_ash_chrome_service_is_called_ = false;
bool request_crosapi_is_called_ = false;
base::RunLoop& run_loop_;
mojo::Remote<crosapi::mojom::AshChromeService> ash_chrome_service_;
mojo::Remote<crosapi::mojom::Crosapi> crosapi_;
};
using TestMojoConnectionManagerTest = testing::Test;
......@@ -170,7 +168,7 @@ MULTIPROCESS_TEST_MAIN(LacrosMain) {
run_loop);
run_loop.Run();
DCHECK(test_browser_service.init_is_called());
DCHECK(test_browser_service.request_ash_chrome_service_is_called());
DCHECK(test_browser_service.request_crosapi_is_called());
return 0;
}
......
......@@ -41,16 +41,16 @@ struct BrowserInfo {
// TODO(crbug.com/1119925): Add more parameters later.
};
// AshChromeService defines the APIs that live in ash-chrome and are
// accessed from client applications (such as lacros-chrome). When adding a
// major new API please note the milestone when you added it, to help us
// reason about compatibility between the client applications and older
// ash-chrome binaries.
// Crosapi defines the APIs that live in ash-chrome and are accessed from
// client applications (such as lacros-chrome). When adding a major new API
// please note the milestone when you added it, to help us reason about
// compatibility between the client applications and older ash-chrome binaries.
//
// Next version: 14
// Next method id: 19
[Stable, Uuid="8b79c34f-2bf8-4499-979a-b17cac522c1e"]
interface AshChromeService {
[Stable, Uuid="8b79c34f-2bf8-4499-979a-b17cac522c1e",
RenamedFrom="crosapi.mojom.AshChromeService"]
interface Crosapi {
// Binds Chrome OS Account Manager for Identity management.
// Added in M87.
[MinVersion=4]
......@@ -234,11 +234,10 @@ enum ExoImeSupport {
// Next version: 12
[Stable, RenamedFrom="crosapi.mojom.LacrosInitParams"]
struct BrowserInitParams {
// This is ash-chrome's version of the AshChromeService interface. This is
// used by lacros-chrome to determine which interface methods are safe to
// call.
// This is ash-chrome's version of the Crosapi interface. This is used by
// lacros-chrome to determine which interface methods are safe to call.
[MinVersion=1]
uint32 ash_chrome_service_version@0;
uint32 crosapi_version@0;
// Deprecated in M88. |ash_metrics_enabled| always has a value.
[MinVersion=2]
......@@ -321,13 +320,12 @@ interface BrowserService {
// The parameters are available on the browser startup.
InitDeprecated@2(BrowserInitParams params);
// Returns the pending_receiver of AshChromeService.
// Returns the pending_receiver of Crosapi.
// Ash-chrome is expected to call this method on initialization.
// The browser may call AshChromeService APIs earlier than this
// invocation. In the case, the calls are queued, and processed
// sequentially, when ash-chrome binds the receiver to the service.
RequestAshChromeServiceReceiver@0() => (
pending_receiver<AshChromeService> receiver);
// The browser may call Crosapi APIs earlier than this invocation.
// In the case, the calls are queued, and processed sequentially, when
// ash-chrome binds the receiver to the service.
RequestCrosapiReceiver@0() => (pending_receiver<Crosapi> receiver);
// Opens a new window in the browser with, currently, the last used profile.
// The callback is called on the command execution.
......
......@@ -44,7 +44,7 @@ class LacrosChromeServiceNeverBlockingState;
// This class is responsible for receiving and routing mojo messages from
// ash-chrome via the mojo::Receiver |sequenced_state_.receiver_|. This class is
// responsible for sending and routing messages to ash-chrome via the
// mojo::Remote |sequenced_state_.ash_chrome_service_|. Messages are sent and
// mojo::Remote |sequenced_state_.crosapi_|. Messages are sent and
// received on a dedicated, never-blocking sequence to avoid deadlocks.
//
// This object is constructed, destroyed, and mostly used on an "affine
......@@ -270,8 +270,8 @@ class COMPONENT_EXPORT(CHROMEOS_LACROS) LacrosChromeServiceImpl {
void BindAccountManagerReceiver(
mojo::PendingReceiver<crosapi::mojom::AccountManager> pending_receiver);
// OnLacrosStartup method of AshChromeService crosapi can only be called
// if this method returns true.
// OnLacrosStartup method of Crosapi can only be called if this method
// returns true.
bool IsOnBrowserStartupAvailable() const;
// Returns BrowserInitParams which is passed from ash-chrome. On launching
......@@ -326,10 +326,10 @@ class COMPONENT_EXPORT(CHROMEOS_LACROS) LacrosChromeServiceImpl {
scoped_refptr<base::TaskRunner> callback_task_runner,
GetActiveTabUrlCallback callback);
// Returns ash's version of the AshChromeService mojo interface version. This
// Returns ash's version of the Crosapi mojo interface version. This
// determines which interface methods are available. This is safe to call from
// any sequence. This can only be called after BindReceiver().
base::Optional<uint32_t> AshChromeServiceVersion() const;
base::Optional<uint32_t> CrosapiVersion() const;
// Delegate instance to inject Chrome dependent code. Must only be used on the
// affine sequence.
......
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