mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Update source files for bracket style
This commit is contained in:
@@ -70,8 +70,9 @@ void CefMediaRouteImpl::Terminate() {
|
||||
}
|
||||
|
||||
auto browser_context = GetBrowserContext(browser_context_getter_);
|
||||
if (!browser_context)
|
||||
if (!browser_context) {
|
||||
return;
|
||||
}
|
||||
|
||||
browser_context->GetMediaRouterManager()->TerminateRoute(
|
||||
route_.media_route_id());
|
||||
@@ -79,8 +80,9 @@ void CefMediaRouteImpl::Terminate() {
|
||||
|
||||
void CefMediaRouteImpl::SendRouteMessageInternal(std::string message) {
|
||||
auto browser_context = GetBrowserContext(browser_context_getter_);
|
||||
if (!browser_context)
|
||||
if (!browser_context) {
|
||||
return;
|
||||
}
|
||||
|
||||
browser_context->GetMediaRouterManager()->SendRouteMessage(
|
||||
route_.media_route_id(), message);
|
||||
|
@@ -38,12 +38,14 @@ class CefRegistrationImpl : public CefRegistration,
|
||||
CEF_REQUIRE_UIT();
|
||||
|
||||
// May be null if OnMediaRouterDestroyed was called.
|
||||
if (browser_context_getter_.is_null())
|
||||
if (browser_context_getter_.is_null()) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto browser_context = GetBrowserContext(browser_context_getter_);
|
||||
if (!browser_context)
|
||||
if (!browser_context) {
|
||||
return;
|
||||
}
|
||||
|
||||
browser_context->GetMediaRouterManager()->RemoveObserver(this);
|
||||
}
|
||||
@@ -55,8 +57,9 @@ class CefRegistrationImpl : public CefRegistration,
|
||||
browser_context_getter_ = browser_context_getter;
|
||||
|
||||
auto browser_context = GetBrowserContext(browser_context_getter_);
|
||||
if (!browser_context)
|
||||
if (!browser_context) {
|
||||
return;
|
||||
}
|
||||
|
||||
browser_context->GetMediaRouterManager()->AddObserver(this);
|
||||
}
|
||||
@@ -165,8 +168,9 @@ void CefMediaRouterImpl::Initialize(
|
||||
|
||||
CefRefPtr<CefRegistration> CefMediaRouterImpl::AddObserver(
|
||||
CefRefPtr<CefMediaObserver> observer) {
|
||||
if (!observer)
|
||||
if (!observer) {
|
||||
return nullptr;
|
||||
}
|
||||
CefRefPtr<CefRegistrationImpl> registration =
|
||||
new CefRegistrationImpl(observer);
|
||||
StoreOrTriggerInitCallback(base::BindOnce(
|
||||
@@ -175,8 +179,9 @@ CefRefPtr<CefRegistration> CefMediaRouterImpl::AddObserver(
|
||||
}
|
||||
|
||||
CefRefPtr<CefMediaSource> CefMediaRouterImpl::GetSource(const CefString& urn) {
|
||||
if (urn.empty())
|
||||
if (urn.empty()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Check for a valid URL and supported Cast/DIAL schemes.
|
||||
GURL presentation_url(urn.ToString());
|
||||
@@ -222,8 +227,9 @@ void CefMediaRouterImpl::NotifyCurrentSinksInternal() {
|
||||
DCHECK(ValidContext());
|
||||
|
||||
auto browser_context = GetBrowserContext(browser_context_getter_);
|
||||
if (!browser_context)
|
||||
if (!browser_context) {
|
||||
return;
|
||||
}
|
||||
|
||||
browser_context->GetMediaRouterManager()->NotifyCurrentSinks();
|
||||
}
|
||||
@@ -268,8 +274,9 @@ void CefMediaRouterImpl::NotifyCurrentRoutesInternal() {
|
||||
DCHECK(ValidContext());
|
||||
|
||||
auto browser_context = GetBrowserContext(browser_context_getter_);
|
||||
if (!browser_context)
|
||||
if (!browser_context) {
|
||||
return;
|
||||
}
|
||||
|
||||
browser_context->GetMediaRouterManager()->NotifyCurrentRoutes();
|
||||
}
|
||||
@@ -284,8 +291,9 @@ void CefMediaRouterImpl::CreateRouteCallback(
|
||||
<< result.result_code() << ")";
|
||||
}
|
||||
|
||||
if (!callback)
|
||||
if (!callback) {
|
||||
return;
|
||||
}
|
||||
|
||||
CefRefPtr<CefMediaRoute> route;
|
||||
if (result.result_code() == media_router::mojom::RouteRequestResultCode::OK &&
|
||||
|
@@ -283,14 +283,16 @@ void CefMediaRouterManager::CreateRouteState(
|
||||
CefMediaRouterManager::RouteState* CefMediaRouterManager::GetRouteState(
|
||||
const media_router::MediaRoute::Id& route_id) {
|
||||
const auto it = route_state_map_.find(route_id);
|
||||
if (it != route_state_map_.end())
|
||||
if (it != route_state_map_.end()) {
|
||||
return it->second.get();
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void CefMediaRouterManager::RemoveRouteState(
|
||||
const media_router::MediaRoute::Id& route_id) {
|
||||
auto it = route_state_map_.find(route_id);
|
||||
if (it != route_state_map_.end())
|
||||
if (it != route_state_map_.end()) {
|
||||
route_state_map_.erase(it);
|
||||
}
|
||||
}
|
||||
|
@@ -35,8 +35,9 @@ void GetSinkInternalAndContinue(
|
||||
|
||||
for (auto service : services) {
|
||||
sink_internal = service->GetSinkById(sink_id);
|
||||
if (sink_internal)
|
||||
if (sink_internal) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (sink_internal) {
|
||||
@@ -131,10 +132,12 @@ bool CefMediaSinkImpl::IsDialSink() {
|
||||
|
||||
bool CefMediaSinkImpl::IsCompatibleWith(CefRefPtr<CefMediaSource> source) {
|
||||
if (source) {
|
||||
if (IsCastSink())
|
||||
if (IsCastSink()) {
|
||||
return source->IsCastSource();
|
||||
if (IsDialSink())
|
||||
}
|
||||
if (IsDialSink()) {
|
||||
return source->IsDialSource();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user