diff options
author | garykac@google.com <garykac@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-07 01:09:24 +0000 |
---|---|---|
committer | garykac@google.com <garykac@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-07 01:09:24 +0000 |
commit | 29810ee54b8cd8b3fd0177c48daffc1c85a94d65 (patch) | |
tree | 067adbba8f6237aba8d678fe83103cffccf9b05d /remoting | |
parent | c21714a74c8fb196b0003bbebb9f8026bec00bb2 (diff) | |
download | chromium_src-29810ee54b8cd8b3fd0177c48daffc1c85a94d65.zip chromium_src-29810ee54b8cd8b3fd0177c48daffc1c85a94d65.tar.gz chromium_src-29810ee54b8cd8b3fd0177c48daffc1c85a94d65.tar.bz2 |
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
Diffstat (limited to 'remoting')
-rw-r--r-- | remoting/client/plugin/chromoting_instance.cc (renamed from remoting/client/plugin/chromoting_plugin.cc) | 30 | ||||
-rw-r--r-- | remoting/client/plugin/chromoting_instance.h (renamed from remoting/client/plugin/chromoting_plugin.h) | 17 | ||||
-rw-r--r-- | remoting/client/plugin/chromoting_scriptable_object.cc | 9 | ||||
-rw-r--r-- | remoting/client/plugin/chromoting_scriptable_object.h | 10 | ||||
-rw-r--r-- | remoting/client/plugin/pepper_entrypoints.cc | 6 | ||||
-rw-r--r-- | remoting/client/plugin/pepper_view.cc | 24 | ||||
-rw-r--r-- | remoting/client/plugin/pepper_view.h | 6 | ||||
-rw-r--r-- | remoting/remoting.gyp | 4 |
8 files changed, 53 insertions, 53 deletions
diff --git a/remoting/client/plugin/chromoting_plugin.cc b/remoting/client/plugin/chromoting_instance.cc index 3814be5..819eec9 100644 --- a/remoting/client/plugin/chromoting_plugin.cc +++ b/remoting/client/plugin/chromoting_instance.cc @@ -2,7 +2,7 @@ // 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 "remoting/client/plugin/chromoting_instance.h" #include <string> #include <vector> @@ -25,14 +25,14 @@ namespace remoting { -const char* ChromotingPlugin::kMimeType = "pepper-application/x-chromoting"; +const char* ChromotingInstance::kMimeType = "pepper-application/x-chromoting"; -ChromotingPlugin::ChromotingPlugin(PP_Instance pp_instance) +ChromotingInstance::ChromotingInstance(PP_Instance pp_instance) : pp::Instance(pp_instance), pepper_main_loop_dont_post_to_me_(NULL) { } -ChromotingPlugin::~ChromotingPlugin() { +ChromotingInstance::~ChromotingInstance() { if (client_.get()) { client_->Stop(); } @@ -44,9 +44,9 @@ ChromotingPlugin::~ChromotingPlugin() { context_.Stop(); } -bool ChromotingPlugin::Init(uint32_t argc, - const char* argn[], - const char* argv[]) { +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 @@ -60,7 +60,7 @@ bool ChromotingPlugin::Init(uint32_t argc, // 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"; + LOG(INFO) << "Started ChromotingInstance::Init"; // Start all the threads. context_.Start(); @@ -76,7 +76,7 @@ bool ChromotingPlugin::Init(uint32_t argc, return true; } -void ChromotingPlugin::Connect(const ClientConfig& config) { +void ChromotingInstance::Connect(const ClientConfig& config) { DCHECK(CurrentlyOnPluginThread()); client_.reset(new ChromotingClient(config, @@ -90,7 +90,7 @@ void ChromotingPlugin::Connect(const ClientConfig& config) { client_->Start(); } -void ChromotingPlugin::ViewChanged(const pp::Rect& position, +void ChromotingInstance::ViewChanged(const pp::Rect& position, const pp::Rect& clip) { DCHECK(CurrentlyOnPluginThread()); @@ -107,11 +107,11 @@ void ChromotingPlugin::ViewChanged(const pp::Rect& position, view_->Paint(); } -bool ChromotingPlugin::CurrentlyOnPluginThread() const { +bool ChromotingInstance::CurrentlyOnPluginThread() const { return pepper_main_loop_dont_post_to_me_ == MessageLoop::current(); } -bool ChromotingPlugin::HandleEvent(const PP_Event& event) { +bool ChromotingInstance::HandleEvent(const PP_Event& event) { DCHECK(CurrentlyOnPluginThread()); switch (event.type) { @@ -120,11 +120,11 @@ bool ChromotingPlugin::HandleEvent(const PP_Event& event) { case PP_EVENT_TYPE_MOUSEMOVE: case PP_EVENT_TYPE_MOUSEENTER: case PP_EVENT_TYPE_MOUSELEAVE: - //client_->handle_mouse_event(npevent); + // client_->handle_mouse_event(npevent); break; case PP_EVENT_TYPE_CHAR: - //client_->handle_char_event(npevent); + // client_->handle_char_event(npevent); break; default: @@ -134,7 +134,7 @@ bool ChromotingPlugin::HandleEvent(const PP_Event& event) { return false; } -pp::Var ChromotingPlugin::GetInstanceObject() { +pp::Var ChromotingInstance::GetInstanceObject() { LOG(ERROR) << "Getting instance object."; if (instance_object_.is_void()) { ChromotingScriptableObject* object = new ChromotingScriptableObject(this); diff --git a/remoting/client/plugin/chromoting_plugin.h b/remoting/client/plugin/chromoting_instance.h index 6223c5d..9fe10b6 100644 --- a/remoting/client/plugin/chromoting_plugin.h +++ b/remoting/client/plugin/chromoting_instance.h @@ -5,13 +5,12 @@ // 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_ +#ifndef REMOTING_CLIENT_PLUGIN_CHROMOTING_INSTANCE_H_ +#define REMOTING_CLIENT_PLUGIN_CHROMOTING_INSTANCE_H_ #include <string> #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" @@ -43,13 +42,13 @@ class InputHandler; class JingleThread; class PepperView; -class ChromotingPlugin : public pp::Instance { +class ChromotingInstance : public pp::Instance { public: // The mimetype for which this plugin is registered. static const char *kMimeType; - ChromotingPlugin(PP_Instance instance); - virtual ~ChromotingPlugin(); + 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); @@ -60,7 +59,7 @@ class ChromotingPlugin : public pp::Instance { virtual bool CurrentlyOnPluginThread() const; private: - FRIEND_TEST_ALL_PREFIXES(ChromotingPluginTest, TestCaseSetup); + 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 @@ -77,9 +76,9 @@ class ChromotingPlugin : public pp::Instance { scoped_ptr<ChromotingClient> client_; pp::Var instance_object_; // JavaScript interface to control this instance. - DISALLOW_COPY_AND_ASSIGN(ChromotingPlugin); + DISALLOW_COPY_AND_ASSIGN(ChromotingInstance); }; } // namespace remoting -#endif // REMOTING_CLIENT_PLUGIN_CHROMOTING_PLUGIN_H_ +#endif // REMOTING_CLIENT_PLUGIN_CHROMOTING_INSTANCE_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<PropertyDescriptor> 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', |