Commit 66d4fa31 authored by Yuri Wiitala's avatar Yuri Wiitala Committed by Commit Bot

Roll src/third_party/openscreen/src/ 21b5adc84..fb75b0993 (8 commits)

Includes updates to "platform glue code" to support recent platform API
changes.

https://chromium.googlesource.com/openscreen/+log/21b5adc8409a..fb75b099385f

$ git log 21b5adc84..fb75b0993 --date=short --no-merges --format='%ad %ae %s'
2019-11-14 miu OpenScreen: Add WeakPtr, resolve some dangerous networking code issues.
2019-11-14 rwkeane PlatformClient: Use in Demos + Cleanup
2019-11-07 miu Move UdpPacket from platform/api to platform/base.
2019-11-08 jophba Move compound_rtcp_parser_seeds folder
2019-11-12 rwkeane DNS-SD: Publisher
2019-11-08 miu Merge platform/api/platform_client.h → platform/impl
2019-11-08 rwkeane DNS-SD: Implement GetDnsRecords method
2019-11-08 miu Minimize platform/api/logging.h, consolidate macros/impl elsewhere.

Created with:
  roll-dep src/third_party/openscreen/src

R=jophba@chromium.org,mfoltz@chromium.org

Change-Id: I864a5ce9f066d497beea1de4862cb36ae98f9cb3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1918362
Auto-Submit: Yuri Wiitala <miu@chromium.org>
Commit-Queue: Yuri Wiitala <miu@chromium.org>
Commit-Queue: Takumi Fujimoto <takumif@chromium.org>
Reviewed-by: default avatarTakumi Fujimoto <takumif@chromium.org>
Reviewed-by: default avatarmark a. foltz <mfoltz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#715535}
parent 74d7f8a4
......@@ -1273,7 +1273,7 @@ deps = {
Var('chromium_git') + '/external/github.com/cisco/openh264' + '@' + '6f26bce0b1c4e8ce0e13332f7c0083788def5fdf',
'src/third_party/openscreen/src':
Var('chromium_git') + '/openscreen' + '@' + '21b5adc8409a64f7902bda4f8e690a42f949395f',
Var('chromium_git') + '/openscreen' + '@' + 'fb75b099385fa64438a5980c2b3c51691c4095f7',
'src/third_party/openxr/src': {
'url': Var('chromium_git') + '/external/github.com/KhronosGroup/OpenXR-SDK' + '@' + '46d7cb392019e934e2944bdd317be8ed5176b3f2',
......
......@@ -154,8 +154,6 @@ static_library("router") {
"providers/openscreen/network_service_async_packet_sender.h",
"providers/openscreen/network_service_quic_packet_writer.cc",
"providers/openscreen/network_service_quic_packet_writer.h",
"providers/openscreen/platform/chrome_platform_client.cc",
"providers/openscreen/platform/chrome_platform_client.h",
"providers/openscreen/platform/chrome_task_runner.cc",
"providers/openscreen/platform/chrome_task_runner.h",
"providers/openscreen/platform/chrome_udp_socket.cc",
......
// Copyright (c) 2019 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 "chrome/browser/media/router/providers/openscreen/platform/chrome_platform_client.h"
#include "base/threading/thread_checker.h"
#include <utility>
namespace media_router {
ChromePlatformClient::~ChromePlatformClient() = default;
// static
void ChromePlatformClient::Create(
std::unique_ptr<network::mojom::NetworkContext> network_context,
scoped_refptr<base::SequencedTaskRunner> task_runner) {
PlatformClient::SetInstance(new ChromePlatformClient(
std::move(network_context), std::move(task_runner)));
}
// static
ChromePlatformClient* ChromePlatformClient::GetInstance() {
return reinterpret_cast<ChromePlatformClient*>(PlatformClient::GetInstance());
}
// static
void ChromePlatformClient::ShutDown() {
ChromePlatformClient* client = ChromePlatformClient::GetInstance();
if (client != nullptr) {
DCHECK_CALLED_ON_VALID_THREAD(client->thread_checker_);
PlatformClient::ShutDown();
}
}
openscreen::platform::TaskRunner* ChromePlatformClient::GetTaskRunner() {
return task_runner_.get();
}
ChromePlatformClient::ChromePlatformClient(
std::unique_ptr<network::mojom::NetworkContext> network_context,
scoped_refptr<base::SequencedTaskRunner> task_runner)
: network_context_(std::move(network_context)),
task_runner_(new ChromeTaskRunner(std::move(task_runner))) {}
} // namespace media_router
// Copyright 2019 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.
#ifndef CHROME_BROWSER_MEDIA_ROUTER_PROVIDERS_OPENSCREEN_PLATFORM_CHROME_PLATFORM_CLIENT_H_
#define CHROME_BROWSER_MEDIA_ROUTER_PROVIDERS_OPENSCREEN_PLATFORM_CHROME_PLATFORM_CLIENT_H_
#include <memory>
#include "base/threading/thread_checker.h"
#include "chrome/browser/media/router/providers/openscreen/platform/chrome_task_runner.h"
#include "services/network/public/mojom/network_context.mojom.h"
#include "third_party/openscreen/src/platform/api/platform_client.h"
namespace media_router {
class ChromePlatformClient : public openscreen::platform::PlatformClient {
public:
// NOTE: The initialization and shutdown routines are not threadsafe.
static void Create(
std::unique_ptr<network::mojom::NetworkContext> network_context,
scoped_refptr<base::SequencedTaskRunner> task_runner);
static ChromePlatformClient* GetInstance();
static void ShutDown();
// These methods are threadsafe.
network::mojom::NetworkContext* network_context() const {
return network_context_.get();
}
// PlatformClient overrides.
openscreen::platform::TaskRunner* GetTaskRunner() override;
protected:
~ChromePlatformClient() override;
private:
ChromePlatformClient(
std::unique_ptr<network::mojom::NetworkContext> network_context,
scoped_refptr<base::SequencedTaskRunner> task_runner);
const std::unique_ptr<network::mojom::NetworkContext> network_context_;
const std::unique_ptr<ChromeTaskRunner> task_runner_;
THREAD_CHECKER(thread_checker_);
};
} // namespace media_router
#endif // CHROME_BROWSER_MEDIA_ROUTER_PROVIDERS_OPENSCREEN_PLATFORM_CHROME_PLATFORM_CLIENT_H_
......@@ -9,13 +9,13 @@
#include "base/bind.h"
#include "base/containers/span.h"
#include "chrome/browser/media/router/providers/openscreen/platform/chrome_platform_client.h"
#include "chrome/browser/net/system_network_context_manager.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "net/base/address_family.h"
#include "net/base/ip_endpoint.h"
#include "net/base/net_errors.h"
#include "services/network/public/mojom/network_context.mojom.h"
#include "third_party/openscreen/src/platform/api/udp_packet.h"
#include "third_party/openscreen/src/platform/base/udp_packet.h"
// Open Screen expects us to provide linked implementations of some of its
// static create methods, which have to be in their namespace.
......@@ -27,8 +27,9 @@ ErrorOr<UdpSocketUniquePtr> UdpSocket::Create(
TaskRunner* task_runner,
Client* client,
const IPEndpoint& local_endpoint) {
auto* const manager = SystemNetworkContextManager::GetInstance();
network::mojom::NetworkContext* const network_context =
media_router::ChromePlatformClient::GetInstance()->network_context();
manager ? manager->GetContext() : nullptr;
if (!network_context) {
return Error::Code::kInitializationFailure;
}
......
......@@ -29,11 +29,12 @@ namespace {
} // namespace
// We don't initialize Chromium's logging.
void LogInit(const char* filename) {}
// We don't set Chromium's logging level.
void SetLogLevel(LogLevel level) {}
bool IsLoggingOn(LogLevel level, absl::string_view file) {
if (level == LogLevel::kVerbose) {
return ::logging::GetVlogLevelHelper(file.data(), file.size()) > 0;
}
return ::logging::ShouldCreateLogMessage(MapLogLevel(level));
}
void LogWithLevel(LogLevel level,
absl::string_view file,
......
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