diff options
author | rsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-28 16:22:44 +0000 |
---|---|---|
committer | rsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-28 16:22:44 +0000 |
commit | 3d988d5dca3a77097a7176d7e753e43b1e6214b0 (patch) | |
tree | 2095bbebacd8771763d23e34f4be42c4d8da8725 /remoting/client/plugin/chromoting_scriptable_object.h | |
parent | aa6a03930d8ea36b7d0b5950e395b09d6bf62978 (diff) | |
download | chromium_src-3d988d5dca3a77097a7176d7e753e43b1e6214b0.zip chromium_src-3d988d5dca3a77097a7176d7e753e43b1e6214b0.tar.gz chromium_src-3d988d5dca3a77097a7176d7e753e43b1e6214b0.tar.bz2 |
Revert 53892 - Initial scriptable object implementation.
Broke ChromiumOS ARM build, reverting. Errors from log:
remoting/client/plugin/chromoting_scriptable_object.cc: In member function 'virtual bool remoting::ChromotingScriptableObject::HasProperty(const pp::Var&, pp::Var*)':
remoting/client/plugin/chromoting_scriptable_object.cc:48: error: NULL used in arithmetic
remoting/client/plugin/chromoting_scriptable_object.cc: In member function 'virtual bool remoting::ChromotingScriptableObject::HasMethod(const pp::Var&, pp::Var*)':
remoting/client/plugin/chromoting_scriptable_object.cc:63: error: NULL used in arithmetic
BUG=50248
TEST=write javascript to manually setup connection.
Review URL: http://codereview.chromium.org/3064009
TBR=ajwong@chromium.org
Review URL: http://codereview.chromium.org/3020038
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53949 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/client/plugin/chromoting_scriptable_object.h')
-rw-r--r-- | remoting/client/plugin/chromoting_scriptable_object.h | 100 |
1 files changed, 0 insertions, 100 deletions
diff --git a/remoting/client/plugin/chromoting_scriptable_object.h b/remoting/client/plugin/chromoting_scriptable_object.h deleted file mode 100644 index 3513120..0000000 --- a/remoting/client/plugin/chromoting_scriptable_object.h +++ /dev/null @@ -1,100 +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. - -// This implements the JavaScript class entrypoint for the plugin. -// The Javascript API is defined as follows. -// -// interface ChromotingScriptableObject { -// // Called when the Chromoting plugin has had a state change such as -// // connection completed. -// attribute Function onreadystatechange; -// -// // Constants for states, etc. -// const unsigned short NOT_CONNECTED = 0; -// const unsigned short CONNECTED = 1; -// -// // Methods on the object. -// void connect(string username, string host_jid, string auth_token); -// -// // Attributes. -// readonly attribute unsigned short status; -// } -// -// onreadystatechange -// -// Methods: -// Connect(username, auth_token, host_jid, onstatechange); - -#ifndef REMOTING_CLIENT_PLUGIN_CHROMOTING_SCRIPTABLE_OBJECT_H_ -#define REMOTING_CLIENT_PLUGIN_CHROMOTING_SCRIPTABLE_OBJECT_H_ - -#include <map> -#include <string> -#include <vector> - -#include "third_party/ppapi/cpp/scriptable_object.h" -#include "third_party/ppapi/cpp/var.h" - -namespace remoting { - -class ChromotingPlugin; - -class ChromotingScriptableObject : public pp::ScriptableObject { - public: - explicit ChromotingScriptableObject(ChromotingPlugin* instance); - virtual ~ChromotingScriptableObject(); - - virtual void Init(); - - // Override the ScriptableObject functions. - virtual bool HasProperty(const pp::Var& name, pp::Var* exception); - virtual bool HasMethod(const pp::Var& name, pp::Var* exception); - virtual pp::Var GetProperty(const pp::Var& name, pp::Var* exception); - virtual void GetAllPropertyNames(std::vector<pp::Var>* properties, - pp::Var* exception); - virtual void SetProperty(const pp::Var& name, - const pp::Var& value, - pp::Var* exception); - virtual pp::Var Call(const pp::Var& method_name, - const std::vector<pp::Var>& args, - pp::Var* exception); - - private: - typedef std::map<std::string, int> PropertyNameMap; - typedef pp::Var (ChromotingScriptableObject::*MethodHandler)( - const std::vector<pp::Var>& args, pp::Var* exception); - struct PropertyDescriptor { - explicit PropertyDescriptor(const std::string& n, pp::Var a) - : name(n), attribute(a), method(NULL) { - } - - explicit PropertyDescriptor(const std::string& n, MethodHandler m) - : name(n), method(m) { - } - - enum Type { - ATTRIBUTE, - METHOD, - } type; - - std::string name; - pp::Var attribute; - MethodHandler method; - }; - - - void AddAttribute(const std::string& name, pp::Var attribute); - void AddMethod(const std::string& name, MethodHandler handler); - - pp::Var DoConnect(const std::vector<pp::Var>& args, pp::Var* exception); - - PropertyNameMap property_names_; - std::vector<PropertyDescriptor> properties_; - - ChromotingPlugin* instance_; -}; - -} // namespace remoting - -#endif // REMOTING_CLIENT_PLUGIN_CHROMOTING_SCRIPTABLE_OBJECT_H_ |