Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2022)

Unified Diff: content/common/npobject_proxy.h

Issue 15047014: Move child-common classes to content/common_child (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/common/npobject_base.h ('k') | content/common/npobject_proxy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/npobject_proxy.h
diff --git a/content/common/npobject_proxy.h b/content/common/npobject_proxy.h
deleted file mode 100644
index f280a125a0896673092a23cd5a5f8befe8e07c81..0000000000000000000000000000000000000000
--- a/content/common/npobject_proxy.h
+++ /dev/null
@@ -1,127 +0,0 @@
-// Copyright (c) 2012 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.
-//
-// A proxy for NPObject that sends all calls to the object to an NPObjectStub
-// running in a different process.
-
-#ifndef CONTENT_COMMON_NPOBJECT_PROXY_H_
-#define CONTENT_COMMON_NPOBJECT_PROXY_H_
-
-#include "base/memory/ref_counted.h"
-#include "content/common/npobject_base.h"
-#include "googleurl/src/gurl.h"
-#include "ipc/ipc_listener.h"
-#include "ipc/ipc_sender.h"
-#include "third_party/npapi/bindings/npruntime.h"
-#include "ui/gfx/native_widget_types.h"
-
-struct NPObject;
-
-namespace content {
-class NPChannelBase;
-
-// When running a plugin in a different process from the renderer, we need to
-// proxy calls to NPObjects across process boundaries. This happens both ways,
-// as a plugin can get an NPObject for the window, and a page can get an
-// NPObject for the plugin. In the process that interacts with the NPobject we
-// give it an NPObjectProxy instead. All calls to it are sent across an IPC
-// channel (specifically, a NPChannelBase). The NPObjectStub on the other
-// side translates the IPC messages into calls to the actual NPObject, and
-// returns the marshalled result.
-class NPObjectProxy : public IPC::Listener,
- public IPC::Sender,
- public NPObjectBase {
- public:
- virtual ~NPObjectProxy();
-
- static NPObject* Create(NPChannelBase* channel,
- int route_id,
- int render_view_id,
- const GURL& page_url);
-
- // IPC::Sender implementation:
- virtual bool Send(IPC::Message* msg) OVERRIDE;
- int route_id() { return route_id_; }
- NPChannelBase* channel() { return channel_; }
-
- // The next 9 functions are called on NPObjects from the plugin and browser.
- static bool NPHasMethod(NPObject *obj,
- NPIdentifier name);
- static bool NPInvoke(NPObject *obj,
- NPIdentifier name,
- const NPVariant *args,
- uint32_t arg_count,
- NPVariant *result);
- static bool NPInvokeDefault(NPObject *npobj,
- const NPVariant *args,
- uint32_t arg_count,
- NPVariant *result);
- static bool NPHasProperty(NPObject *obj,
- NPIdentifier name);
- static bool NPGetProperty(NPObject *obj,
- NPIdentifier name,
- NPVariant *result);
- static bool NPSetProperty(NPObject *obj,
- NPIdentifier name,
- const NPVariant *value);
- static bool NPRemoveProperty(NPObject *obj,
- NPIdentifier name);
- static bool NPNEnumerate(NPObject *obj,
- NPIdentifier **value,
- uint32_t *count);
- static bool NPNConstruct(NPObject *npobj,
- const NPVariant *args,
- uint32_t arg_count,
- NPVariant *result);
-
- // The next two functions are only called on NPObjects from the browser.
- static bool NPNEvaluate(NPP npp,
- NPObject *obj,
- NPString *script,
- NPVariant *result);
-
- static bool NPInvokePrivate(NPP npp,
- NPObject *obj,
- bool is_default,
- NPIdentifier name,
- const NPVariant *args,
- uint32_t arg_count,
- NPVariant *result);
-
- static NPObjectProxy* GetProxy(NPObject* object);
- static const NPClass* npclass() { return &npclass_proxy_; }
-
- // NPObjectBase implementation.
- virtual NPObject* GetUnderlyingNPObject() OVERRIDE;
-
- virtual IPC::Listener* GetChannelListener() OVERRIDE;
-
- private:
- NPObjectProxy(NPChannelBase* channel,
- int route_id,
- int render_view_id,
- const GURL& page_url);
-
- // IPC::Listener implementation:
- virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE;
- virtual void OnChannelError() OVERRIDE;
-
- static NPObject* NPAllocate(NPP, NPClass*);
- static void NPDeallocate(NPObject* npObj);
-
- // This function is only caled on NPObjects from the plugin.
- static void NPPInvalidate(NPObject *obj);
- static NPClass npclass_proxy_;
-
- scoped_refptr<NPChannelBase> channel_;
- int route_id_;
- int render_view_id_;
-
- // The url of the main frame hosting the plugin.
- GURL page_url_;
-};
-
-} // namespace content
-
-#endif // CONTENT_COMMON_NPOBJECT_PROXY_H_
« no previous file with comments | « content/common/npobject_base.h ('k') | content/common/npobject_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698