Build remoting for PNaCl
BUG=276739 R=jamiewalch@chromium.org, rsleevi@chromium.org Review URL: https://codereview.chromium.org/234023003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@271351 0039d316-1c4b-4281-b951-d872f2087c98
This commit is contained in:
jingle
net
remoting
third_party/libwebm
@ -24,6 +24,11 @@
|
||||
'sources': [
|
||||
'<@(jingle_glue_sources)',
|
||||
],
|
||||
'sources!': [
|
||||
'glue/chrome_async_socket.cc',
|
||||
'glue/proxy_resolving_client_socket.cc',
|
||||
'glue/xmpp_client_socket_factory.cc',
|
||||
],
|
||||
'dependencies': [
|
||||
'../base/base_nacl.gyp:base_nacl',
|
||||
'../native_client/tools.gyp:prep_toolchain',
|
||||
|
@ -114,6 +114,8 @@
|
||||
'socket/client_socket_pool_histograms.cc',
|
||||
'socket/client_socket_pool_histograms.h',
|
||||
'socket/next_proto.h',
|
||||
'socket/openssl_ssl_util.cc',
|
||||
'socket/openssl_ssl_util.h',
|
||||
'socket/socket.h',
|
||||
'socket/ssl_client_socket.cc',
|
||||
'socket/ssl_client_socket.h',
|
||||
@ -954,8 +956,6 @@
|
||||
'socket/client_socket_pool_manager_impl.h',
|
||||
'socket/nss_ssl_util.cc',
|
||||
'socket/nss_ssl_util.h',
|
||||
'socket/openssl_ssl_util.cc',
|
||||
'socket/openssl_ssl_util.h',
|
||||
'socket/server_socket.h',
|
||||
'socket/socket_descriptor.cc',
|
||||
'socket/socket_descriptor.h',
|
||||
|
@ -27,6 +27,7 @@
|
||||
'../native_client_sdk/native_client_sdk_untrusted.gyp:nacl_io_untrusted',
|
||||
'../third_party/openssl/openssl_nacl.gyp:openssl_nacl',
|
||||
'../url/url_nacl.gyp:url_nacl',
|
||||
'net.gyp:net_derived_sources',
|
||||
'net.gyp:net_resources',
|
||||
],
|
||||
'defines': [
|
||||
|
@ -8,6 +8,11 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#if defined(OS_NACL)
|
||||
#include <sys/mount.h>
|
||||
#include <nacl_io/nacl_io.h>
|
||||
#endif
|
||||
|
||||
#include "base/bind.h"
|
||||
#include "base/callback.h"
|
||||
#include "base/json/json_reader.h"
|
||||
@ -21,7 +26,7 @@
|
||||
#include "base/values.h"
|
||||
#include "crypto/random.h"
|
||||
#include "jingle/glue/thread_wrapper.h"
|
||||
#include "media/base/media.h"
|
||||
#include "media/base/yuv_convert.h"
|
||||
#include "net/socket/ssl_server_socket.h"
|
||||
#include "ppapi/cpp/completion_callback.h"
|
||||
#include "ppapi/cpp/dev/url_util_dev.h"
|
||||
@ -210,6 +215,24 @@ ChromotingInstance::ChromotingInstance(PP_Instance pp_instance)
|
||||
use_async_pin_dialog_(false),
|
||||
use_media_source_rendering_(false),
|
||||
weak_factory_(this) {
|
||||
#if defined(OS_NACL)
|
||||
// In NaCl global resources need to be initialized differently because they
|
||||
// are not shared with Chrome.
|
||||
thread_task_runner_handle_.reset(
|
||||
new base::ThreadTaskRunnerHandle(plugin_task_runner_));
|
||||
thread_wrapper_.reset(
|
||||
new jingle_glue::JingleThreadWrapper(plugin_task_runner_));
|
||||
media::InitializeCPUSpecificYUVConversions();
|
||||
#else
|
||||
jingle_glue::JingleThreadWrapper::EnsureForCurrentMessageLoop();
|
||||
#endif
|
||||
|
||||
#if defined(OS_NACL)
|
||||
nacl_io_init_ppapi(pp_instance, pp::Module::Get()->get_browser_interface());
|
||||
mount("", "/etc", "memfs", 0, "");
|
||||
mount("", "/usr", "memfs", 0, "");
|
||||
#endif
|
||||
|
||||
RequestInputEvents(PP_INPUTEVENT_CLASS_MOUSE | PP_INPUTEVENT_CLASS_WHEEL);
|
||||
RequestFilteringInputEvents(PP_INPUTEVENT_CLASS_KEYBOARD);
|
||||
|
||||
@ -264,18 +287,15 @@ bool ChromotingInstance::Init(uint32_t argc,
|
||||
|
||||
VLOG(1) << "Started ChromotingInstance::Init";
|
||||
|
||||
// Check to make sure the media library is initialized.
|
||||
// http://crbug.com/91521.
|
||||
if (!media::IsMediaLibraryInitialized()) {
|
||||
LOG(ERROR) << "Media library not initialized.";
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check that the calling content is part of an app or extension.
|
||||
// Check that the calling content is part of an app or extension. This is only
|
||||
// necessary for non-PNaCl version of the plugin. Also PPB_URLUtil_Dev doesn't
|
||||
// work in NaCl at the moment so the check fails in NaCl builds.
|
||||
#if !defined(OS_NACL)
|
||||
if (!IsCallerAppOrExtension()) {
|
||||
LOG(ERROR) << "Not an app or extension";
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Start all the threads.
|
||||
context_.Start();
|
||||
@ -345,6 +365,9 @@ void ChromotingInstance::HandleMessage(const pp::Var& message) {
|
||||
void ChromotingInstance::DidChangeFocus(bool has_focus) {
|
||||
DCHECK(plugin_task_runner_->BelongsToCurrentThread());
|
||||
|
||||
if (!IsConnected())
|
||||
return;
|
||||
|
||||
input_handler_.DidChangeFocus(has_focus);
|
||||
}
|
||||
|
||||
@ -627,8 +650,6 @@ void ChromotingInstance::ConnectWithConfig(const ClientConfig& config,
|
||||
const std::string& local_jid) {
|
||||
DCHECK(plugin_task_runner_->BelongsToCurrentThread());
|
||||
|
||||
jingle_glue::JingleThreadWrapper::EnsureForCurrentMessageLoop();
|
||||
|
||||
if (use_media_source_rendering_) {
|
||||
video_renderer_.reset(new MediaSourceVideoRenderer(this));
|
||||
} else {
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include "base/gtest_prod_util.h"
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include "base/memory/weak_ptr.h"
|
||||
#include "base/thread_task_runner_handle.h"
|
||||
#include "ppapi/c/pp_instance.h"
|
||||
#include "ppapi/c/pp_rect.h"
|
||||
#include "ppapi/c/pp_resource.h"
|
||||
@ -45,6 +46,10 @@ class Module;
|
||||
class VarDictionary;
|
||||
} // namespace pp
|
||||
|
||||
namespace jingle_glue {
|
||||
class JingleThreadWrapper;
|
||||
} // namespace jingle_glue
|
||||
|
||||
namespace webrtc {
|
||||
class DesktopRegion;
|
||||
class DesktopSize;
|
||||
@ -259,6 +264,8 @@ class ChromotingInstance :
|
||||
|
||||
PepperPluginThreadDelegate plugin_thread_delegate_;
|
||||
scoped_refptr<PluginThreadTaskRunner> plugin_task_runner_;
|
||||
scoped_ptr<base::ThreadTaskRunnerHandle> thread_task_runner_handle_;
|
||||
scoped_ptr<jingle_glue::JingleThreadWrapper> thread_wrapper_;
|
||||
ClientContext context_;
|
||||
scoped_ptr<VideoRenderer> video_renderer_;
|
||||
scoped_ptr<PepperView> view_;
|
||||
|
32
remoting/client/plugin/pepper_module.cc
Normal file
32
remoting/client/plugin/pepper_module.cc
Normal file
@ -0,0 +1,32 @@
|
||||
// Copyright 2014 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 "base/at_exit.h"
|
||||
#include "base/compiler_specific.h"
|
||||
#include "ppapi/cpp/instance.h"
|
||||
#include "ppapi/cpp/module.h"
|
||||
#include "remoting/client/plugin/chromoting_instance.h"
|
||||
|
||||
namespace remoting {
|
||||
|
||||
class ChromotingModule : public pp::Module {
|
||||
protected:
|
||||
virtual pp::Instance* CreateInstance(PP_Instance instance) OVERRIDE {
|
||||
pp::Instance* result = new ChromotingInstance(instance);
|
||||
return result;
|
||||
}
|
||||
private:
|
||||
base::AtExitManager at_exit_manager_;
|
||||
};
|
||||
|
||||
} // namespace remoting
|
||||
|
||||
namespace pp {
|
||||
|
||||
// Factory function for your specialization of the Module object.
|
||||
Module* CreateModule() {
|
||||
return new remoting::ChromotingModule();
|
||||
}
|
||||
|
||||
} // namespace pp
|
@ -9,6 +9,7 @@
|
||||
#include "base/run_loop.h"
|
||||
#include "base/test/test_timeouts.h"
|
||||
#include "base/time/time.h"
|
||||
#include "jingle/glue/thread_wrapper.h"
|
||||
#include "net/socket/socket.h"
|
||||
#include "net/socket/stream_socket.h"
|
||||
#include "net/url_request/url_request_context_getter.h"
|
||||
@ -94,6 +95,7 @@ class JingleSessionTest : public testing::Test {
|
||||
public:
|
||||
JingleSessionTest() {
|
||||
message_loop_.reset(new base::MessageLoopForIO());
|
||||
jingle_glue::JingleThreadWrapper::EnsureForCurrentMessageLoop();
|
||||
}
|
||||
|
||||
// Helper method that handles OnIncomingSession().
|
||||
|
@ -12,7 +12,6 @@
|
||||
#include "base/timer/timer.h"
|
||||
#include "jingle/glue/channel_socket_adapter.h"
|
||||
#include "jingle/glue/pseudotcp_adapter.h"
|
||||
#include "jingle/glue/thread_wrapper.h"
|
||||
#include "jingle/glue/utils.h"
|
||||
#include "net/base/net_errors.h"
|
||||
#include "remoting/base/constants.h"
|
||||
@ -424,7 +423,6 @@ LibjingleTransportFactory::LibjingleTransportFactory(
|
||||
: signal_strategy_(signal_strategy),
|
||||
port_allocator_(port_allocator.Pass()),
|
||||
network_settings_(network_settings) {
|
||||
jingle_glue::JingleThreadWrapper::EnsureForCurrentMessageLoop();
|
||||
}
|
||||
|
||||
LibjingleTransportFactory::~LibjingleTransportFactory() {
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include "net/socket/client_socket_factory.h"
|
||||
#include "net/socket/client_socket_handle.h"
|
||||
#include "net/socket/ssl_client_socket.h"
|
||||
#include "net/socket/ssl_client_socket_openssl.h"
|
||||
#include "net/socket/ssl_server_socket.h"
|
||||
#include "net/ssl/ssl_config_service.h"
|
||||
#include "remoting/base/rsa_key_pair.h"
|
||||
@ -63,6 +64,12 @@ void SslHmacChannelAuthenticator::SecureAndAuthenticate(
|
||||
|
||||
int result;
|
||||
if (is_ssl_server()) {
|
||||
#if defined(OS_NACL)
|
||||
// Client plugin doesn't use server SSL sockets, and so SSLServerSocket
|
||||
// implementation is not compiled for NaCl as part of net_nacl.
|
||||
NOTREACHED();
|
||||
result = net::ERR_FAILED;
|
||||
#else
|
||||
scoped_refptr<net::X509Certificate> cert =
|
||||
net::X509Certificate::CreateFromBytes(
|
||||
local_cert_.data(), local_cert_.length());
|
||||
@ -85,6 +92,7 @@ void SslHmacChannelAuthenticator::SecureAndAuthenticate(
|
||||
result = raw_server_socket->Handshake(
|
||||
base::Bind(&SslHmacChannelAuthenticator::OnConnected,
|
||||
base::Unretained(this)));
|
||||
#endif
|
||||
} else {
|
||||
transport_security_state_.reset(new net::TransportSecurityState);
|
||||
|
||||
@ -104,11 +112,19 @@ void SslHmacChannelAuthenticator::SecureAndAuthenticate(
|
||||
net::HostPortPair host_and_port(kSslFakeHostName, 0);
|
||||
net::SSLClientSocketContext context;
|
||||
context.transport_security_state = transport_security_state_.get();
|
||||
scoped_ptr<net::ClientSocketHandle> connection(new net::ClientSocketHandle);
|
||||
connection->SetSocket(socket.Pass());
|
||||
scoped_ptr<net::ClientSocketHandle> socket_handle(
|
||||
new net::ClientSocketHandle);
|
||||
socket_handle->SetSocket(socket.Pass());
|
||||
|
||||
#if defined(OS_NACL)
|
||||
// net_nacl doesn't include ClientSocketFactory.
|
||||
socket_.reset(new net::SSLClientSocketOpenSSL(
|
||||
socket_handle.Pass(), host_and_port, ssl_config, context));
|
||||
#else
|
||||
socket_ =
|
||||
net::ClientSocketFactory::GetDefaultFactory()->CreateSSLClientSocket(
|
||||
connection.Pass(), host_and_port, ssl_config, context);
|
||||
socket_handle.Pass(), host_and_port, ssl_config, context);
|
||||
#endif
|
||||
|
||||
result = socket_->Connect(
|
||||
base::Bind(&SslHmacChannelAuthenticator::OnConnected,
|
||||
|
@ -101,6 +101,13 @@
|
||||
'remoting_webapp_v1',
|
||||
'remoting_webapp_v2',
|
||||
],
|
||||
'conditions': [
|
||||
['disable_nacl==0 and disable_nacl_untrusted==0', {
|
||||
'dependencies': [
|
||||
'remoting_webapp_pnacl',
|
||||
],
|
||||
}],
|
||||
],
|
||||
}, # end of target 'remoting_webapp'
|
||||
|
||||
{
|
||||
@ -127,4 +134,23 @@
|
||||
'includes': [ 'remoting_webapp.gypi', ],
|
||||
}, # end of target 'remoting_webapp_v2'
|
||||
], # end of targets
|
||||
|
||||
'conditions': [
|
||||
['disable_nacl==0 and disable_nacl_untrusted==0', {
|
||||
'targets': [
|
||||
{
|
||||
'target_name': 'remoting_webapp_pnacl',
|
||||
'type': 'none',
|
||||
'variables': {
|
||||
'output_dir': '<(PRODUCT_DIR)/remoting/remoting.webapp.pnacl',
|
||||
'zip_path': '<(PRODUCT_DIR)/remoting-webapp-pnacl.zip',
|
||||
'extra_files': [ 'webapp/background.js' ],
|
||||
'webapp_type': 'v2_pnacl',
|
||||
},
|
||||
'includes': [ 'remoting_webapp.gypi', ],
|
||||
}, # end of target 'remoting_webapp_pnacl'
|
||||
],
|
||||
}],
|
||||
],
|
||||
|
||||
}
|
||||
|
236
remoting/remoting_nacl.gyp
Normal file
236
remoting/remoting_nacl.gyp
Normal file
@ -0,0 +1,236 @@
|
||||
# Copyright 2014 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.
|
||||
|
||||
{
|
||||
'includes': [
|
||||
'../native_client/build/untrusted.gypi',
|
||||
'remoting_srcs.gypi',
|
||||
],
|
||||
|
||||
'variables': {
|
||||
'protoc': '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)protoc<(EXECUTABLE_SUFFIX)',
|
||||
'proto_out_base': '<(SHARED_INTERMEDIATE_DIR)/protoc_out',
|
||||
'proto_out_dir': '<(proto_out_base)/remoting/proto',
|
||||
'use_nss': 0,
|
||||
'nacl_untrusted_build': 1,
|
||||
'chromium_code': 1,
|
||||
},
|
||||
|
||||
'targets': [
|
||||
{
|
||||
'target_name': 'remoting_webrtc_nacl',
|
||||
'type': 'none',
|
||||
'variables': {
|
||||
'nacl_untrusted_build': 1,
|
||||
'nlib_target': 'libremoting_webrtc_nacl.a',
|
||||
'build_glibc': 0,
|
||||
'build_newlib': 0,
|
||||
'build_pnacl_newlib': 1,
|
||||
},
|
||||
'include_dirs': [
|
||||
'../third_party',
|
||||
'../third_party/webrtc',
|
||||
],
|
||||
'sources': [
|
||||
'../third_party/webrtc/modules/desktop_capture/desktop_frame.cc',
|
||||
'../third_party/webrtc/modules/desktop_capture/desktop_frame.h',
|
||||
'../third_party/webrtc/modules/desktop_capture/desktop_geometry.cc',
|
||||
'../third_party/webrtc/modules/desktop_capture/desktop_geometry.h',
|
||||
'../third_party/webrtc/modules/desktop_capture/desktop_region.cc',
|
||||
'../third_party/webrtc/modules/desktop_capture/desktop_region.h',
|
||||
'../third_party/webrtc/modules/desktop_capture/shared_desktop_frame.cc',
|
||||
'../third_party/webrtc/modules/desktop_capture/shared_desktop_frame.h',
|
||||
],
|
||||
'direct_dependent_settings': {
|
||||
'include_dirs': [
|
||||
'../third_party',
|
||||
'../third_party/webrtc',
|
||||
],
|
||||
}
|
||||
}, # end of target 'remoting_webrtc_nacl'
|
||||
|
||||
{
|
||||
'target_name': 'remoting_proto_nacl',
|
||||
'type': 'none',
|
||||
'variables': {
|
||||
'nacl_untrusted_build': 1,
|
||||
'nlib_target': 'libremoting_proto_nacl.a',
|
||||
'build_glibc': 0,
|
||||
'build_newlib': 0,
|
||||
'build_pnacl_newlib': 1,
|
||||
'files_list': [
|
||||
'<(proto_out_dir)/audio.pb.cc',
|
||||
'<(proto_out_dir)/control.pb.cc',
|
||||
'<(proto_out_dir)/event.pb.cc',
|
||||
'<(proto_out_dir)/internal.pb.cc',
|
||||
'<(proto_out_dir)/video.pb.cc',
|
||||
'<(proto_out_dir)/mux.pb.cc',
|
||||
],
|
||||
'extra_deps': [ '<@(files_list)' ],
|
||||
'extra_args': [ '<@(files_list)' ],
|
||||
},
|
||||
'defines': [
|
||||
'GOOGLE_PROTOBUF_HOST_ARCH_64_BIT=1'
|
||||
],
|
||||
'dependencies': [
|
||||
'../native_client/tools.gyp:prep_toolchain',
|
||||
'../third_party/protobuf/protobuf_nacl.gyp:protobuf_lite_nacl',
|
||||
'proto/chromotocol.gyp:chromotocol_proto_lib',
|
||||
],
|
||||
'export_dependent_settings': [
|
||||
'../third_party/protobuf/protobuf_nacl.gyp:protobuf_lite_nacl',
|
||||
],
|
||||
'direct_dependent_settings': {
|
||||
'include_dirs': [
|
||||
'<(proto_out_base)',
|
||||
],
|
||||
},
|
||||
}, # end of target 'remoting_proto_nacl'
|
||||
|
||||
{
|
||||
'target_name': 'remoting_client_plugin_lib_nacl',
|
||||
'type': 'none',
|
||||
'variables': {
|
||||
'nacl_untrusted_build': 1,
|
||||
'nlib_target': 'libremoting_client_plugin_lib_nacl.a',
|
||||
'build_glibc': 0,
|
||||
'build_newlib': 0,
|
||||
'build_pnacl_newlib': 1,
|
||||
},
|
||||
'dependencies': [
|
||||
'../base/base_nacl.gyp:base_nacl',
|
||||
'../jingle/jingle_nacl.gyp:jingle_glue_nacl',
|
||||
'../native_client/tools.gyp:prep_toolchain',
|
||||
'../native_client_sdk/native_client_sdk_untrusted.gyp:nacl_io_untrusted',
|
||||
'../net/net_nacl.gyp:net_nacl',
|
||||
'../third_party/libjingle/libjingle_nacl.gyp:libjingle_nacl',
|
||||
'../third_party/libvpx/libvpx_nacl.gyp:libvpx_nacl',
|
||||
'../third_party/libwebm/libwebm_nacl.gyp:libwebm_nacl',
|
||||
'../third_party/libyuv/libyuv_nacl.gyp:libyuv_nacl',
|
||||
'../third_party/openssl/openssl_nacl.gyp:openssl_nacl',
|
||||
'../third_party/opus/opus_nacl.gyp:opus_nacl',
|
||||
'remoting_proto_nacl',
|
||||
'remoting_webrtc_nacl',
|
||||
],
|
||||
'sources': [
|
||||
'../ui/events/keycodes/dom4/keycode_converter.cc',
|
||||
'<@(remoting_base_sources)',
|
||||
'<@(remoting_client_plugin_sources)',
|
||||
'<@(remoting_client_sources)',
|
||||
'<@(remoting_protocol_sources)',
|
||||
],
|
||||
'sources!': [
|
||||
'base/url_request_context.cc',
|
||||
'jingle_glue/chromium_socket_factory.cc',
|
||||
]
|
||||
}, # end of target 'remoting_client_plugin_lib_nacl'
|
||||
|
||||
{
|
||||
'target_name': 'remoting_client_plugin_nacl',
|
||||
'type': 'none',
|
||||
'variables': {
|
||||
'nacl_untrusted_build': 1,
|
||||
'nexe_target': 'remoting_client_plugin',
|
||||
'build_glibc': 0,
|
||||
'build_newlib': 0,
|
||||
'build_pnacl_newlib': 1,
|
||||
'enable_x86_32': 0,
|
||||
'enable_x86_64': 0,
|
||||
'extra_deps_pnacl_newlib': [
|
||||
'>(tc_lib_dir_pnacl_newlib)/libbase_i18n_nacl.a',
|
||||
'>(tc_lib_dir_pnacl_newlib)/libbase_nacl.a',
|
||||
'>(tc_lib_dir_pnacl_newlib)/libexpat_nacl.a',
|
||||
'>(tc_lib_dir_pnacl_newlib)/libicudata_nacl.a',
|
||||
'>(tc_lib_dir_pnacl_newlib)/libcrypto_nacl.a',
|
||||
'>(tc_lib_dir_pnacl_newlib)/libicui18n_nacl.a',
|
||||
'>(tc_lib_dir_pnacl_newlib)/libicuuc_nacl.a',
|
||||
'>(tc_lib_dir_pnacl_newlib)/libjingle_nacl.a',
|
||||
'>(tc_lib_dir_pnacl_newlib)/libjingle_p2p_constants_nacl.a',
|
||||
'>(tc_lib_dir_pnacl_newlib)/libmedia_yuv_nacl.a',
|
||||
'>(tc_lib_dir_pnacl_newlib)/libmodp_b64_nacl.a',
|
||||
'>(tc_lib_dir_pnacl_newlib)/libopenssl_nacl.a',
|
||||
'>(tc_lib_dir_pnacl_newlib)/libopus_nacl.a',
|
||||
'>(tc_lib_dir_pnacl_newlib)/libppapi.a',
|
||||
'>(tc_lib_dir_pnacl_newlib)/libppapi_cpp.a',
|
||||
'>(tc_lib_dir_pnacl_newlib)/libprotobuf_lite_nacl.a',
|
||||
'>(tc_lib_dir_pnacl_newlib)/libjingle_glue_nacl.a',
|
||||
'>(tc_lib_dir_pnacl_newlib)/libnet_nacl.a',
|
||||
'>(tc_lib_dir_pnacl_newlib)/libremoting_client_plugin_lib_nacl.a',
|
||||
'>(tc_lib_dir_pnacl_newlib)/libremoting_proto_nacl.a',
|
||||
'>(tc_lib_dir_pnacl_newlib)/libremoting_webrtc_nacl.a',
|
||||
'>(tc_lib_dir_pnacl_newlib)/liburl_nacl.a',
|
||||
'>(tc_lib_dir_pnacl_newlib)/libvpx_nacl.a',
|
||||
'>(tc_lib_dir_pnacl_newlib)/libwebm_nacl.a',
|
||||
'>(tc_lib_dir_pnacl_newlib)/libyuv_nacl.a',
|
||||
],
|
||||
},
|
||||
'dependencies': [
|
||||
'../base/base_nacl.gyp:base_i18n_nacl',
|
||||
'../base/base_nacl.gyp:base_nacl',
|
||||
'../crypto/crypto_nacl.gyp:crypto_nacl',
|
||||
'../jingle/jingle_nacl.gyp:jingle_glue_nacl',
|
||||
'../media/media_nacl.gyp:media_yuv_nacl',
|
||||
'../native_client/tools.gyp:prep_toolchain',
|
||||
'../native_client_sdk/native_client_sdk_untrusted.gyp:nacl_io_untrusted',
|
||||
'../net/net_nacl.gyp:net_nacl',
|
||||
'../ppapi/native_client/native_client.gyp:nacl_irt',
|
||||
'../ppapi/native_client/native_client.gyp:ppapi_lib',
|
||||
'../ppapi/ppapi_nacl.gyp:ppapi_cpp_lib',
|
||||
'../third_party/expat/expat_nacl.gyp:expat_nacl',
|
||||
'../third_party/icu/icu_nacl.gyp:icudata_nacl',
|
||||
'../third_party/icu/icu_nacl.gyp:icui18n_nacl',
|
||||
'../third_party/icu/icu_nacl.gyp:icuuc_nacl',
|
||||
'../third_party/libjingle/libjingle_nacl.gyp:libjingle_nacl',
|
||||
'../third_party/libwebm/libwebm_nacl.gyp:libwebm_nacl',
|
||||
'../third_party/libyuv/libyuv_nacl.gyp:libyuv_nacl',
|
||||
'../third_party/modp_b64/modp_b64_nacl.gyp:modp_b64_nacl',
|
||||
'../third_party/openssl/openssl_nacl.gyp:openssl_nacl',
|
||||
'../url/url_nacl.gyp:url_nacl',
|
||||
'remoting_client_plugin_lib_nacl',
|
||||
'remoting_proto_nacl',
|
||||
'remoting_webrtc_nacl',
|
||||
],
|
||||
'link_flags': [
|
||||
'-lppapi_stub',
|
||||
|
||||
# Plugin code.
|
||||
'-lremoting_client_plugin_lib_nacl',
|
||||
'-lremoting_proto_nacl',
|
||||
|
||||
# Chromium libraries.
|
||||
'-ljingle_glue_nacl',
|
||||
'-lmedia_yuv_nacl',
|
||||
'-lnet_nacl',
|
||||
'-lcrypto_nacl',
|
||||
'-lbase_i18n_nacl',
|
||||
'-lbase_nacl',
|
||||
'-lurl_nacl',
|
||||
|
||||
# Third-party libraries.
|
||||
'-lremoting_webrtc_nacl',
|
||||
'-lyuv_nacl',
|
||||
'-lvpx_nacl',
|
||||
'-ljingle_p2p_constants_nacl',
|
||||
'-ljingle_nacl',
|
||||
'-lexpat_nacl',
|
||||
'-lmodp_b64_nacl',
|
||||
'-lopus_nacl',
|
||||
'-lopenssl_nacl',
|
||||
'-licui18n_nacl',
|
||||
'-licuuc_nacl',
|
||||
'-licudata_nacl',
|
||||
'-lprotobuf_lite_nacl',
|
||||
'-lwebm_nacl',
|
||||
|
||||
# Base NaCl libraries.
|
||||
'-lppapi_cpp',
|
||||
'-lpthread',
|
||||
'-lnacl_io',
|
||||
],
|
||||
'sources': [
|
||||
'client/plugin/pepper_module.cc',
|
||||
],
|
||||
}, # end of target 'remoting_client_plugin_nacl'
|
||||
]
|
||||
}
|
@ -35,6 +35,17 @@
|
||||
'plugin_args': [],
|
||||
},
|
||||
}],
|
||||
['webapp_type=="v2_pnacl"', {
|
||||
'dependencies': [
|
||||
'remoting_nacl.gyp:remoting_client_plugin_nacl',
|
||||
],
|
||||
'variables': {
|
||||
'extra_files': [
|
||||
'webapp/remoting_client_pnacl.nmf',
|
||||
'<(PRODUCT_DIR)/remoting_client_plugin_newlib.pexe',
|
||||
],
|
||||
},
|
||||
}],
|
||||
['run_jscompile != 0', {
|
||||
'variables': {
|
||||
'success_stamp': '<(PRODUCT_DIR)/remoting_webapp_jscompile.stamp',
|
||||
|
@ -189,6 +189,11 @@ def buildWebApp(buildtype, version, mimetype, destination, zip_path,
|
||||
findAndReplace(os.path.join(destination, 'plugin_settings.js'),
|
||||
'HOST_PLUGIN_MIMETYPE', hostPluginMimeType)
|
||||
|
||||
# Set client plugin type.
|
||||
client_plugin = 'pnacl' if webapp_type == 'v2_pnacl' else 'native'
|
||||
findAndReplace(os.path.join(destination, 'plugin_settings.js'),
|
||||
"'CLIENT_PLUGIN_TYPE'", "'" + client_plugin + "'")
|
||||
|
||||
# Allow host names for google services/apis to be overriden via env vars.
|
||||
oauth2AccountsHost = os.environ.get(
|
||||
'OAUTH2_ACCOUNTS_HOST', 'https://accounts.google.com')
|
||||
|
@ -363,8 +363,17 @@ remoting.ClientSession.prototype.createClientPlugin_ =
|
||||
document.createElement('embed');
|
||||
|
||||
plugin.id = id;
|
||||
plugin.src = 'about://none';
|
||||
plugin.type = 'application/vnd.chromium.remoting-viewer';
|
||||
if (remoting.settings.CLIENT_PLUGIN_TYPE == 'pnacl') {
|
||||
plugin.src = 'remoting_client_pnacl.nmf';
|
||||
plugin.type = 'application/x-pnacl';
|
||||
} else if (remoting.settings.CLIENT_PLUGIN_TYPE == 'nacl') {
|
||||
plugin.src = 'remoting_client_nacl.nmf';
|
||||
plugin.type = 'application/x-nacl';
|
||||
} else {
|
||||
plugin.src = 'about://none';
|
||||
plugin.type = 'application/vnd.chromium.remoting-viewer';
|
||||
}
|
||||
|
||||
plugin.width = 0;
|
||||
plugin.height = 0;
|
||||
plugin.tabIndex = 0; // Required, otherwise focus() doesn't work.
|
||||
@ -1500,4 +1509,4 @@ remoting.ClientSession.prototype.getClientArea_ = function() {
|
||||
return remoting.windowFrame ?
|
||||
remoting.windowFrame.getClientArea() :
|
||||
{ 'width': window.innerWidth, 'height': window.innerHeight };
|
||||
}
|
||||
}
|
||||
|
@ -58,6 +58,19 @@
|
||||
"identity",
|
||||
"contextMenus",
|
||||
"overrideEscFullscreen"
|
||||
{% endif %}
|
||||
{% if webapp_type == 'v2_pnacl' %}
|
||||
,{
|
||||
"socket": [
|
||||
"tcp-connect",
|
||||
"tcp-listen",
|
||||
"udp-send-to",
|
||||
"udp-bind",
|
||||
"udp-multicast-membership",
|
||||
"resolve-host",
|
||||
"network-state"
|
||||
]
|
||||
}
|
||||
{% endif %}
|
||||
],
|
||||
|
||||
|
@ -54,3 +54,6 @@ remoting.Settings.prototype.THIRD_PARTY_AUTH_REDIRECT_URI =
|
||||
|
||||
// Whether to use MediaSource API for video rendering.
|
||||
remoting.Settings.prototype.USE_MEDIA_SOURCE_RENDERING = false;
|
||||
|
||||
// 'native', 'nacl' or 'pnacl'.
|
||||
remoting.Settings.prototype.CLIENT_PLUGIN_TYPE = 'CLIENT_PLUGIN_TYPE';
|
||||
|
10
remoting/webapp/remoting_client_pnacl.nmf
Normal file
10
remoting/webapp/remoting_client_pnacl.nmf
Normal file
@ -0,0 +1,10 @@
|
||||
{
|
||||
"program": {
|
||||
"portable": {
|
||||
"pnacl-translate": {
|
||||
"url": "remoting_client_plugin_newlib.pexe",
|
||||
"optlevel": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
5
third_party/libwebm/libwebm_nacl.gyp
vendored
5
third_party/libwebm/libwebm_nacl.gyp
vendored
@ -23,6 +23,11 @@
|
||||
'sources': [
|
||||
'<@(libwebm_sources)',
|
||||
],
|
||||
'defines': [
|
||||
# LLONG_MIN and UULONG_MAX are defined in newlib only for C++11.
|
||||
'LLONG_MIN=LONG_LONG_MIN',
|
||||
'ULLONG_MAX=ULONG_LONG_MAX',
|
||||
],
|
||||
}, # target libwebm_nacl
|
||||
]
|
||||
}
|
||||
|
Reference in New Issue
Block a user