From fd495c25ccc4448f41ad188e602582c9032ef5d2 Mon Sep 17 00:00:00 2001 From: "sergeyu@chromium.org" Date: Mon, 19 May 2014 06:28:51 +0000 Subject: Revert 271343 "Build remoting for PNaCl" > Build remoting for PNaCl > > BUG=276739 > R=jamiewalch@chromium.org, rsleevi@chromium.org > > Review URL: https://codereview.chromium.org/234023003 TBR=sergeyu@chromium.org Review URL: https://codereview.chromium.org/285243003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@271344 0039d316-1c4b-4281-b951-d872f2087c98 --- remoting/client/plugin/chromoting_instance.cc | 43 +++++++-------------------- remoting/client/plugin/chromoting_instance.h | 7 ----- remoting/client/plugin/pepper_module.cc | 32 -------------------- 3 files changed, 11 insertions(+), 71 deletions(-) delete mode 100644 remoting/client/plugin/pepper_module.cc (limited to 'remoting/client') diff --git a/remoting/client/plugin/chromoting_instance.cc b/remoting/client/plugin/chromoting_instance.cc index 8a07ecb..3504c71 100644 --- a/remoting/client/plugin/chromoting_instance.cc +++ b/remoting/client/plugin/chromoting_instance.cc @@ -8,11 +8,6 @@ #include #include -#if defined(OS_NACL) -#include -#include -#endif - #include "base/bind.h" #include "base/callback.h" #include "base/json/json_reader.h" @@ -26,7 +21,7 @@ #include "base/values.h" #include "crypto/random.h" #include "jingle/glue/thread_wrapper.h" -#include "media/base/yuv_convert.h" +#include "media/base/media.h" #include "net/socket/ssl_server_socket.h" #include "ppapi/cpp/completion_callback.h" #include "ppapi/cpp/dev/url_util_dev.h" @@ -215,24 +210,6 @@ 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); @@ -287,15 +264,18 @@ bool ChromotingInstance::Init(uint32_t argc, VLOG(1) << "Started ChromotingInstance::Init"; - // 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) + // 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. if (!IsCallerAppOrExtension()) { LOG(ERROR) << "Not an app or extension"; return false; } -#endif // Start all the threads. context_.Start(); @@ -365,9 +345,6 @@ 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); } @@ -650,6 +627,8 @@ 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 { diff --git a/remoting/client/plugin/chromoting_instance.h b/remoting/client/plugin/chromoting_instance.h index f56074d..0ed6d3d 100644 --- a/remoting/client/plugin/chromoting_instance.h +++ b/remoting/client/plugin/chromoting_instance.h @@ -13,7 +13,6 @@ #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" @@ -46,10 +45,6 @@ class Module; class VarDictionary; } // namespace pp -namespace jingle_glue { -class JingleThreadWrapper; -} // namespace jingle_glue - namespace webrtc { class DesktopRegion; class DesktopSize; @@ -264,8 +259,6 @@ class ChromotingInstance : PepperPluginThreadDelegate plugin_thread_delegate_; scoped_refptr plugin_task_runner_; - scoped_ptr thread_task_runner_handle_; - scoped_ptr thread_wrapper_; ClientContext context_; scoped_ptr video_renderer_; scoped_ptr view_; diff --git a/remoting/client/plugin/pepper_module.cc b/remoting/client/plugin/pepper_module.cc deleted file mode 100644 index b8e3bc5..0000000 --- a/remoting/client/plugin/pepper_module.cc +++ /dev/null @@ -1,32 +0,0 @@ -// 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 -- cgit v1.1