From 29810ee54b8cd8b3fd0177c48daffc1c85a94d65 Mon Sep 17 00:00:00 2001 From: "garykac@google.com" Date: Sat, 7 Aug 2010 01:09:24 +0000 Subject: Rename ChromotingPlugin -> ChromotingInstance to be more consistent with Pepper terminology. BUG=50453 TEST=remoting unittests Review URL: http://codereview.chromium.org/3078005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55317 0039d316-1c4b-4281-b951-d872f2087c98 --- remoting/client/plugin/chromoting_instance.cc | 151 +++++++++++++++++++++ remoting/client/plugin/chromoting_instance.h | 84 ++++++++++++ remoting/client/plugin/chromoting_plugin.cc | 151 --------------------- remoting/client/plugin/chromoting_plugin.h | 85 ------------ .../client/plugin/chromoting_scriptable_object.cc | 9 +- .../client/plugin/chromoting_scriptable_object.h | 10 +- remoting/client/plugin/pepper_entrypoints.cc | 6 +- remoting/client/plugin/pepper_view.cc | 24 ++-- remoting/client/plugin/pepper_view.h | 6 +- remoting/remoting.gyp | 4 +- 10 files changed, 265 insertions(+), 265 deletions(-) create mode 100644 remoting/client/plugin/chromoting_instance.cc create mode 100644 remoting/client/plugin/chromoting_instance.h delete mode 100644 remoting/client/plugin/chromoting_plugin.cc delete mode 100644 remoting/client/plugin/chromoting_plugin.h (limited to 'remoting') diff --git a/remoting/client/plugin/chromoting_instance.cc b/remoting/client/plugin/chromoting_instance.cc new file mode 100644 index 0000000..819eec9 --- /dev/null +++ b/remoting/client/plugin/chromoting_instance.cc @@ -0,0 +1,151 @@ +// Copyright (c) 2010 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 "remoting/client/plugin/chromoting_instance.h" + +#include +#include + +#include "base/message_loop.h" +#include "base/string_util.h" +#include "base/thread.h" +#include "remoting/client/client_config.h" +#include "remoting/client/client_util.h" +#include "remoting/client/chromoting_client.h" +#include "remoting/client/host_connection.h" +#include "remoting/client/jingle_host_connection.h" +#include "remoting/client/plugin/chromoting_scriptable_object.h" +#include "remoting/client/plugin/pepper_input_handler.h" +#include "remoting/client/plugin/pepper_view.h" +#include "remoting/jingle_glue/jingle_thread.h" +#include "third_party/ppapi/c/pp_event.h" +#include "third_party/ppapi/cpp/completion_callback.h" +#include "third_party/ppapi/cpp/rect.h" + +namespace remoting { + +const char* ChromotingInstance::kMimeType = "pepper-application/x-chromoting"; + +ChromotingInstance::ChromotingInstance(PP_Instance pp_instance) + : pp::Instance(pp_instance), + pepper_main_loop_dont_post_to_me_(NULL) { +} + +ChromotingInstance::~ChromotingInstance() { + if (client_.get()) { + client_->Stop(); + } + + // TODO(ajwong): We need to ensure all objects have actually stopped posting + // to the message loop before this point. Right now, we don't have a well + // defined stop for the plugin process, and the thread shutdown is likely a + // race condition. + context_.Stop(); +} + +bool ChromotingInstance::Init(uint32_t argc, + const char* argn[], + const char* argv[]) { + CHECK(pepper_main_loop_dont_post_to_me_ == NULL); + + // Record the current thread. This function should only be invoked by the + // plugin thread, so we capture the current message loop and assume it is + // indeed the plugin thread. + // + // We're abusing the pepper API slightly here. We know we're running as an + // internal plugin, and thus we are on the pepper main thread that uses a + // message loop. + // + // TODO(ajwong): See if there is a method for querying what thread we're on + // from inside the pepper API. + pepper_main_loop_dont_post_to_me_ = MessageLoop::current(); + LOG(INFO) << "Started ChromotingInstance::Init"; + + // Start all the threads. + context_.Start(); + + // Create the chromoting objects. + host_connection_.reset(new JingleHostConnection(&context_)); + view_.reset(new PepperView(this)); + input_handler_.reset(new PepperInputHandler()); + + // Default to a medium grey. + view_->SetSolidFill(0xFFCDCDCD); + + return true; +} + +void ChromotingInstance::Connect(const ClientConfig& config) { + DCHECK(CurrentlyOnPluginThread()); + + client_.reset(new ChromotingClient(config, + &context_, + host_connection_.get(), + view_.get(), + input_handler_.get(), + NULL)); + + // Kick off the connection. + client_->Start(); +} + +void ChromotingInstance::ViewChanged(const pp::Rect& position, + const pp::Rect& clip) { + DCHECK(CurrentlyOnPluginThread()); + + // TODO(ajwong): This is going to be a race condition when the view changes + // and we're in the middle of a Paint(). + LOG(INFO) << "ViewChanged " + << position.x() << "," + << position.y() << "," + << position.width() << "," + << position.height(); + + view_->SetViewport(position.x(), position.y(), + position.width(), position.height()); + view_->Paint(); +} + +bool ChromotingInstance::CurrentlyOnPluginThread() const { + return pepper_main_loop_dont_post_to_me_ == MessageLoop::current(); +} + +bool ChromotingInstance::HandleEvent(const PP_Event& event) { + DCHECK(CurrentlyOnPluginThread()); + + switch (event.type) { + case PP_EVENT_TYPE_MOUSEDOWN: + case PP_EVENT_TYPE_MOUSEUP: + case PP_EVENT_TYPE_MOUSEMOVE: + case PP_EVENT_TYPE_MOUSEENTER: + case PP_EVENT_TYPE_MOUSELEAVE: + // client_->handle_mouse_event(npevent); + break; + + case PP_EVENT_TYPE_CHAR: + // client_->handle_char_event(npevent); + break; + + default: + break; + } + + return false; +} + +pp::Var ChromotingInstance::GetInstanceObject() { + LOG(ERROR) << "Getting instance object."; + if (instance_object_.is_void()) { + ChromotingScriptableObject* object = new ChromotingScriptableObject(this); + object->Init(); + + LOG(ERROR) << "Object initted."; + // The pp::Var takes ownership of object here. + instance_object_ = pp::Var(object); + } + + return instance_object_; +} + +} // namespace remoting diff --git a/remoting/client/plugin/chromoting_instance.h b/remoting/client/plugin/chromoting_instance.h new file mode 100644 index 0000000..9fe10b6 --- /dev/null +++ b/remoting/client/plugin/chromoting_instance.h @@ -0,0 +1,84 @@ +// Copyright (c) 2010 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. + +// TODO(ajwong): We need to come up with a better description of the +// responsibilities for each thread. + +#ifndef REMOTING_CLIENT_PLUGIN_CHROMOTING_INSTANCE_H_ +#define REMOTING_CLIENT_PLUGIN_CHROMOTING_INSTANCE_H_ + +#include + +#include "base/at_exit.h" +#include "base/scoped_ptr.h" +#include "remoting/client/client_context.h" +#include "remoting/client/host_connection.h" +#include "testing/gtest/include/gtest/gtest_prod.h" +#include "third_party/ppapi/c/pp_event.h" +#include "third_party/ppapi/c/pp_instance.h" +#include "third_party/ppapi/c/pp_rect.h" +#include "third_party/ppapi/c/pp_resource.h" +#include "third_party/ppapi/cpp/instance.h" +#include "third_party/ppapi/cpp/device_context_2d.h" +#include "third_party/ppapi/cpp/var.h" + +class MessageLoop; + +namespace base { +class Thread; +} // namespace base + +namespace pp { +class Module; +} // namespace pp + +namespace remoting { + +class ChromotingClient; +class ClientContext; +class HostConnection; +class InputHandler; +class JingleThread; +class PepperView; + +class ChromotingInstance : public pp::Instance { + public: + // The mimetype for which this plugin is registered. + static const char *kMimeType; + + explicit ChromotingInstance(PP_Instance instance); + virtual ~ChromotingInstance(); + + virtual bool Init(uint32_t argc, const char* argn[], const char* argv[]); + virtual void Connect(const ClientConfig& config); + virtual bool HandleEvent(const PP_Event& event); + virtual pp::Var GetInstanceObject(); + virtual void ViewChanged(const pp::Rect& position, const pp::Rect& clip); + + virtual bool CurrentlyOnPluginThread() const; + + private: + FRIEND_TEST(ChromotingInstanceTest, TestCaseSetup); + + // Since we're an internal plugin, we can just grab the message loop during + // init to figure out which thread we're on. This should only be used to + // sanity check which thread we're executing on. Do not post task here! + // Instead, use PPB_Core:CallOnMainThread() in the pepper api. + // + // TODO(ajwong): Think if there is a better way to safeguard this. + MessageLoop* pepper_main_loop_dont_post_to_me_; + + ClientContext context_; + scoped_ptr host_connection_; + scoped_ptr view_; + scoped_ptr input_handler_; + scoped_ptr client_; + pp::Var instance_object_; // JavaScript interface to control this instance. + + DISALLOW_COPY_AND_ASSIGN(ChromotingInstance); +}; + +} // namespace remoting + +#endif // REMOTING_CLIENT_PLUGIN_CHROMOTING_INSTANCE_H_ diff --git a/remoting/client/plugin/chromoting_plugin.cc b/remoting/client/plugin/chromoting_plugin.cc deleted file mode 100644 index 3814be5..0000000 --- a/remoting/client/plugin/chromoting_plugin.cc +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright (c) 2010 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 "remoting/client/plugin/chromoting_plugin.h" - -#include -#include - -#include "base/message_loop.h" -#include "base/string_util.h" -#include "base/thread.h" -#include "remoting/client/client_config.h" -#include "remoting/client/client_util.h" -#include "remoting/client/chromoting_client.h" -#include "remoting/client/host_connection.h" -#include "remoting/client/jingle_host_connection.h" -#include "remoting/client/plugin/chromoting_scriptable_object.h" -#include "remoting/client/plugin/pepper_input_handler.h" -#include "remoting/client/plugin/pepper_view.h" -#include "remoting/jingle_glue/jingle_thread.h" -#include "third_party/ppapi/c/pp_event.h" -#include "third_party/ppapi/cpp/completion_callback.h" -#include "third_party/ppapi/cpp/rect.h" - -namespace remoting { - -const char* ChromotingPlugin::kMimeType = "pepper-application/x-chromoting"; - -ChromotingPlugin::ChromotingPlugin(PP_Instance pp_instance) - : pp::Instance(pp_instance), - pepper_main_loop_dont_post_to_me_(NULL) { -} - -ChromotingPlugin::~ChromotingPlugin() { - if (client_.get()) { - client_->Stop(); - } - - // TODO(ajwong): We need to ensure all objects have actually stopped posting - // to the message loop before this point. Right now, we don't have a well - // defined stop for the plugin process, and the thread shutdown is likely a - // race condition. - context_.Stop(); -} - -bool ChromotingPlugin::Init(uint32_t argc, - const char* argn[], - const char* argv[]) { - CHECK(pepper_main_loop_dont_post_to_me_ == NULL); - - // Record the current thread. This function should only be invoked by the - // plugin thread, so we capture the current message loop and assume it is - // indeed the plugin thread. - // - // We're abusing the pepper API slightly here. We know we're running as an - // internal plugin, and thus we are on the pepper main thread that uses a - // message loop. - // - // TODO(ajwong): See if there is a method for querying what thread we're on - // from inside the pepper API. - pepper_main_loop_dont_post_to_me_ = MessageLoop::current(); - LOG(INFO) << "Started ChromotingPlugin::Init"; - - // Start all the threads. - context_.Start(); - - // Create the chromoting objects. - host_connection_.reset(new JingleHostConnection(&context_)); - view_.reset(new PepperView(this)); - input_handler_.reset(new PepperInputHandler()); - - // Default to a medium grey. - view_->SetSolidFill(0xFFCDCDCD); - - return true; -} - -void ChromotingPlugin::Connect(const ClientConfig& config) { - DCHECK(CurrentlyOnPluginThread()); - - client_.reset(new ChromotingClient(config, - &context_, - host_connection_.get(), - view_.get(), - input_handler_.get(), - NULL)); - - // Kick off the connection. - client_->Start(); -} - -void ChromotingPlugin::ViewChanged(const pp::Rect& position, - const pp::Rect& clip) { - DCHECK(CurrentlyOnPluginThread()); - - // TODO(ajwong): This is going to be a race condition when the view changes - // and we're in the middle of a Paint(). - LOG(INFO) << "ViewChanged " - << position.x() << "," - << position.y() << "," - << position.width() << "," - << position.height(); - - view_->SetViewport(position.x(), position.y(), - position.width(), position.height()); - view_->Paint(); -} - -bool ChromotingPlugin::CurrentlyOnPluginThread() const { - return pepper_main_loop_dont_post_to_me_ == MessageLoop::current(); -} - -bool ChromotingPlugin::HandleEvent(const PP_Event& event) { - DCHECK(CurrentlyOnPluginThread()); - - switch (event.type) { - case PP_EVENT_TYPE_MOUSEDOWN: - case PP_EVENT_TYPE_MOUSEUP: - case PP_EVENT_TYPE_MOUSEMOVE: - case PP_EVENT_TYPE_MOUSEENTER: - case PP_EVENT_TYPE_MOUSELEAVE: - //client_->handle_mouse_event(npevent); - break; - - case PP_EVENT_TYPE_CHAR: - //client_->handle_char_event(npevent); - break; - - default: - break; - } - - return false; -} - -pp::Var ChromotingPlugin::GetInstanceObject() { - LOG(ERROR) << "Getting instance object."; - if (instance_object_.is_void()) { - ChromotingScriptableObject* object = new ChromotingScriptableObject(this); - object->Init(); - - LOG(ERROR) << "Object initted."; - // The pp::Var takes ownership of object here. - instance_object_ = pp::Var(object); - } - - return instance_object_; -} - -} // namespace remoting diff --git a/remoting/client/plugin/chromoting_plugin.h b/remoting/client/plugin/chromoting_plugin.h deleted file mode 100644 index 6223c5d..0000000 --- a/remoting/client/plugin/chromoting_plugin.h +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) 2010 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. - -// TODO(ajwong): We need to come up with a better description of the -// responsibilities for each thread. - -#ifndef REMOTING_CLIENT_PLUGIN_CHROMOTING_PLUGIN_H_ -#define REMOTING_CLIENT_PLUGIN_CHROMOTING_PLUGIN_H_ - -#include - -#include "base/at_exit.h" -#include "base/gtest_prod_util.h" -#include "base/scoped_ptr.h" -#include "remoting/client/client_context.h" -#include "remoting/client/host_connection.h" -#include "testing/gtest/include/gtest/gtest_prod.h" -#include "third_party/ppapi/c/pp_event.h" -#include "third_party/ppapi/c/pp_instance.h" -#include "third_party/ppapi/c/pp_rect.h" -#include "third_party/ppapi/c/pp_resource.h" -#include "third_party/ppapi/cpp/instance.h" -#include "third_party/ppapi/cpp/device_context_2d.h" -#include "third_party/ppapi/cpp/var.h" - -class MessageLoop; - -namespace base { -class Thread; -} // namespace base - -namespace pp { -class Module; -} // namespace pp - -namespace remoting { - -class ChromotingClient; -class ClientContext; -class HostConnection; -class InputHandler; -class JingleThread; -class PepperView; - -class ChromotingPlugin : public pp::Instance { - public: - // The mimetype for which this plugin is registered. - static const char *kMimeType; - - ChromotingPlugin(PP_Instance instance); - virtual ~ChromotingPlugin(); - - virtual bool Init(uint32_t argc, const char* argn[], const char* argv[]); - virtual void Connect(const ClientConfig& config); - virtual bool HandleEvent(const PP_Event& event); - virtual pp::Var GetInstanceObject(); - virtual void ViewChanged(const pp::Rect& position, const pp::Rect& clip); - - virtual bool CurrentlyOnPluginThread() const; - - private: - FRIEND_TEST_ALL_PREFIXES(ChromotingPluginTest, TestCaseSetup); - - // Since we're an internal plugin, we can just grab the message loop during - // init to figure out which thread we're on. This should only be used to - // sanity check which thread we're executing on. Do not post task here! - // Instead, use PPB_Core:CallOnMainThread() in the pepper api. - // - // TODO(ajwong): Think if there is a better way to safeguard this. - MessageLoop* pepper_main_loop_dont_post_to_me_; - - ClientContext context_; - scoped_ptr host_connection_; - scoped_ptr view_; - scoped_ptr input_handler_; - scoped_ptr client_; - pp::Var instance_object_; // JavaScript interface to control this instance. - - DISALLOW_COPY_AND_ASSIGN(ChromotingPlugin); -}; - -} // namespace remoting - -#endif // REMOTING_CLIENT_PLUGIN_CHROMOTING_PLUGIN_H_ diff --git a/remoting/client/plugin/chromoting_scriptable_object.cc b/remoting/client/plugin/chromoting_scriptable_object.cc index 6c26e38..2ed3929 100644 --- a/remoting/client/plugin/chromoting_scriptable_object.cc +++ b/remoting/client/plugin/chromoting_scriptable_object.cc @@ -1,10 +1,11 @@ -// Copyright 2010 Google Inc. All Rights Reserved. -// Author: ajwong@google.com (Albert Wong) +// Copyright (c) 2010 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 "remoting/client/plugin/chromoting_scriptable_object.h" #include "remoting/client/client_config.h" -#include "remoting/client/plugin/chromoting_plugin.h" +#include "remoting/client/plugin/chromoting_instance.h" #include "third_party/ppapi/cpp/var.h" @@ -12,7 +13,7 @@ using pp::Var; namespace remoting { ChromotingScriptableObject::ChromotingScriptableObject( - ChromotingPlugin* instance) + ChromotingInstance* instance) : instance_(instance) { } diff --git a/remoting/client/plugin/chromoting_scriptable_object.h b/remoting/client/plugin/chromoting_scriptable_object.h index 3513120..5344271 100644 --- a/remoting/client/plugin/chromoting_scriptable_object.h +++ b/remoting/client/plugin/chromoting_scriptable_object.h @@ -2,11 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// This implements the JavaScript class entrypoint for the plugin. +// This implements the JavaScript class entrypoint for the plugin instance. // The Javascript API is defined as follows. // // interface ChromotingScriptableObject { -// // Called when the Chromoting plugin has had a state change such as +// // Called when the Chromoting instance has had a state change such as // // connection completed. // attribute Function onreadystatechange; // @@ -38,11 +38,11 @@ namespace remoting { -class ChromotingPlugin; +class ChromotingInstance; class ChromotingScriptableObject : public pp::ScriptableObject { public: - explicit ChromotingScriptableObject(ChromotingPlugin* instance); + explicit ChromotingScriptableObject(ChromotingInstance* instance); virtual ~ChromotingScriptableObject(); virtual void Init(); @@ -92,7 +92,7 @@ class ChromotingScriptableObject : public pp::ScriptableObject { PropertyNameMap property_names_; std::vector properties_; - ChromotingPlugin* instance_; + ChromotingInstance* instance_; }; } // namespace remoting diff --git a/remoting/client/plugin/pepper_entrypoints.cc b/remoting/client/plugin/pepper_entrypoints.cc index 1613c1d..6bcc814 100644 --- a/remoting/client/plugin/pepper_entrypoints.cc +++ b/remoting/client/plugin/pepper_entrypoints.cc @@ -5,7 +5,7 @@ #include "remoting/client/plugin/pepper_entrypoints.h" #include "base/message_loop.h" -#include "remoting/client/plugin/chromoting_plugin.h" +#include "remoting/client/plugin/chromoting_instance.h" #include "third_party/ppapi/c/pp_errors.h" #include "third_party/ppapi/c/pp_instance.h" #include "third_party/ppapi/c/pp_module.h" @@ -27,8 +27,8 @@ namespace remoting { class ChromotingModule : public pp::Module { protected: - virtual ChromotingPlugin* CreateInstance(PP_Instance instance) { - return new ChromotingPlugin(instance); + virtual ChromotingInstance* CreateInstance(PP_Instance instance) { + return new ChromotingInstance(instance); } }; diff --git a/remoting/client/plugin/pepper_view.cc b/remoting/client/plugin/pepper_view.cc index 9e6a7af..6715888 100644 --- a/remoting/client/plugin/pepper_view.cc +++ b/remoting/client/plugin/pepper_view.cc @@ -6,7 +6,7 @@ #include "base/message_loop.h" #include "remoting/base/decoder_zlib.h" -#include "remoting/client/plugin/chromoting_plugin.h" +#include "remoting/client/plugin/chromoting_instance.h" #include "remoting/client/plugin/pepper_util.h" #include "third_party/ppapi/cpp/device_context_2d.h" #include "third_party/ppapi/cpp/image_data.h" @@ -15,8 +15,8 @@ namespace remoting { -PepperView::PepperView(ChromotingPlugin* plugin) - : plugin_(plugin), +PepperView::PepperView(ChromotingInstance* instance) + : instance_(instance), backing_store_width_(0), backing_store_height_(0), viewport_x_(0), @@ -38,7 +38,7 @@ void PepperView::TearDown() { } void PepperView::Paint() { - if (!plugin_->CurrentlyOnPluginThread()) { + if (!instance_->CurrentlyOnPluginThread()) { RunTaskOnPluginThread(NewRunnableMethod(this, &PepperView::Paint)); return; } @@ -84,7 +84,7 @@ void PepperView::Paint() { } void PepperView::SetSolidFill(uint32 color) { - if (!plugin_->CurrentlyOnPluginThread()) { + if (!instance_->CurrentlyOnPluginThread()) { RunTaskOnPluginThread( NewRunnableMethod(this, &PepperView::SetSolidFill, color)); return; @@ -95,7 +95,7 @@ void PepperView::SetSolidFill(uint32 color) { } void PepperView::UnsetSolidFill() { - if (!plugin_->CurrentlyOnPluginThread()) { + if (!instance_->CurrentlyOnPluginThread()) { RunTaskOnPluginThread( NewRunnableMethod(this, &PepperView::UnsetSolidFill)); return; @@ -105,7 +105,7 @@ void PepperView::UnsetSolidFill() { } void PepperView::SetViewport(int x, int y, int width, int height) { - if (!plugin_->CurrentlyOnPluginThread()) { + if (!instance_->CurrentlyOnPluginThread()) { RunTaskOnPluginThread(NewRunnableMethod(this, &PepperView::SetViewport, x, y, width, height)); return; @@ -121,14 +121,14 @@ void PepperView::SetViewport(int x, int y, int width, int height) { device_context_ = pp::DeviceContext2D(pp::Size(viewport_width_, viewport_height_), false); - if (!plugin_->BindGraphicsDeviceContext(device_context_)) { + if (!instance_->BindGraphicsDeviceContext(device_context_)) { LOG(ERROR) << "Couldn't bind the device context."; return; } } void PepperView::SetHostScreenSize(int width, int height) { - if (!plugin_->CurrentlyOnPluginThread()) { + if (!instance_->CurrentlyOnPluginThread()) { RunTaskOnPluginThread(NewRunnableMethod(this, &PepperView::SetHostScreenSize, width, height)); @@ -140,7 +140,7 @@ void PepperView::SetHostScreenSize(int width, int height) { } void PepperView::HandleBeginUpdateStream(HostMessage* msg) { - if (!plugin_->CurrentlyOnPluginThread()) { + if (!instance_->CurrentlyOnPluginThread()) { RunTaskOnPluginThread( NewRunnableMethod(this, &PepperView::HandleBeginUpdateStream, msg)); @@ -170,7 +170,7 @@ void PepperView::HandleBeginUpdateStream(HostMessage* msg) { } void PepperView::HandleUpdateStreamPacket(HostMessage* msg) { - if (!plugin_->CurrentlyOnPluginThread()) { + if (!instance_->CurrentlyOnPluginThread()) { RunTaskOnPluginThread( NewRunnableMethod(this, &PepperView::HandleUpdateStreamPacket, msg)); @@ -181,7 +181,7 @@ void PepperView::HandleUpdateStreamPacket(HostMessage* msg) { } void PepperView::HandleEndUpdateStream(HostMessage* msg) { - if (!plugin_->CurrentlyOnPluginThread()) { + if (!instance_->CurrentlyOnPluginThread()) { RunTaskOnPluginThread( NewRunnableMethod(this, &PepperView::HandleEndUpdateStream, msg)); diff --git a/remoting/client/plugin/pepper_view.h b/remoting/client/plugin/pepper_view.h index 0a3147e..bb4557b 100644 --- a/remoting/client/plugin/pepper_view.h +++ b/remoting/client/plugin/pepper_view.h @@ -23,7 +23,7 @@ namespace remoting { -class ChromotingPlugin; +class ChromotingInstance; class Decoder; class PepperView : public ChromotingView { @@ -33,7 +33,7 @@ class PepperView : public ChromotingView { // // TODO(ajwong): This probably needs to synchronize with the pepper thread // to be safe. - explicit PepperView(ChromotingPlugin* plugin); + explicit PepperView(ChromotingInstance* instance); virtual ~PepperView(); // ChromotingView implementation. @@ -56,7 +56,7 @@ class PepperView : public ChromotingView { // Reference to the creating plugin instance. Needed for interacting with // pepper. Marking explciitly as const since it must be initialized at // object creation, and never change. - ChromotingPlugin* const plugin_; + ChromotingInstance* const instance_; pp::DeviceContext2D device_context_; diff --git a/remoting/remoting.gyp b/remoting/remoting.gyp index 5168970..51afbbf 100644 --- a/remoting/remoting.gyp +++ b/remoting/remoting.gyp @@ -76,8 +76,8 @@ '../third_party/ppapi/ppapi.gyp:ppapi_cpp_objects', ], 'sources': [ - 'client/plugin/chromoting_plugin.cc', - 'client/plugin/chromoting_plugin.h', + 'client/plugin/chromoting_instance.cc', + 'client/plugin/chromoting_instance.h', 'client/plugin/chromoting_scriptable_object.cc', 'client/plugin/chromoting_scriptable_object.h', 'client/plugin/pepper_entrypoints.cc', -- cgit v1.1