forked from Pissandshittium/pissandshittium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlacros_service_never_blocking_state.cc
43 lines (35 loc) · 1.54 KB
/
lacros_service_never_blocking_state.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Copyright 2021 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.
#include "chromeos/lacros/lacros_service_never_blocking_state.h"
namespace chromeos {
LacrosServiceNeverBlockingState::LacrosServiceNeverBlockingState() {
DETACH_FROM_SEQUENCE(sequence_checker_);
}
LacrosServiceNeverBlockingState::~LacrosServiceNeverBlockingState() {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
}
// Crosapi is the interface that lacros-chrome uses to message
// ash-chrome. This method binds the remote, which allows queuing of message
// to ash-chrome. The messages will not go through until
// RequestCrosapiReceiver() is invoked.
void LacrosServiceNeverBlockingState::BindCrosapi() {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
pending_crosapi_receiver_ = crosapi_.BindNewPipeAndPassReceiver();
}
void LacrosServiceNeverBlockingState::FusePipeCrosapi(
mojo::PendingRemote<crosapi::mojom::Crosapi> pending_remote) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
mojo::FusePipes(std::move(pending_crosapi_receiver_),
std::move(pending_remote));
}
void LacrosServiceNeverBlockingState::OnBrowserStartup(
crosapi::mojom::BrowserInfoPtr browser_info) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
crosapi_->OnBrowserStartup(std::move(browser_info));
}
base::WeakPtr<LacrosServiceNeverBlockingState>
LacrosServiceNeverBlockingState::GetWeakPtr() {
return weak_factory_.GetWeakPtr();
}
} // namespace chromeos