From 7445a61840911ec3c4786bcbcc79b9b9fc8029c5 Mon Sep 17 00:00:00 2001 From: "dmichael@chromium.org" Date: Wed, 31 Jul 2013 19:55:11 +0000 Subject: PPAPI: Remove references to content from ppapi/host As jam noted here: https://chromiumcodereview.appspot.com/16057021/ we should not reference "content" classes in ppapi/host code. This replaces "AsPepperFoo{Browser}Host" with "IsFooHost". Now, you have to follow the IsFooHost check with a static_cast to PepperFoo{Browser}Host*". Note that there are two hosts that return true for IsFileSystemHost, one in the browser, one in the renderer. But it seems pretty clear which one to use in any given context. BUG= Review URL: https://chromiumcodereview.appspot.com/21026004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@214808 0039d316-1c4b-4281-b951-d872f2087c98 --- ppapi/host/resource_host.cc | 17 ++++++----------- ppapi/host/resource_host.h | 17 +++++------------ 2 files changed, 11 insertions(+), 23 deletions(-) (limited to 'ppapi') diff --git a/ppapi/host/resource_host.cc b/ppapi/host/resource_host.cc index 6e08c01..4e12260 100644 --- a/ppapi/host/resource_host.cc +++ b/ppapi/host/resource_host.cc @@ -48,21 +48,16 @@ void ResourceHost::SendReply(const ReplyMessageContext& context, host_->SendReply(context, msg); } -content::PepperFileRefHost* ResourceHost::AsPepperFileRefHost() { - return NULL; +bool ResourceHost::IsFileRefHost() { + return false; } -content::PepperFileSystemBrowserHost* -ResourceHost::AsPepperFileSystemBrowserHost() { - return NULL; +bool ResourceHost::IsFileSystemHost() { + return false; } -content::PepperFileSystemHost* ResourceHost::AsPepperFileSystemHost() { - return NULL; -} - -content::PepperGraphics2DHost* ResourceHost::AsPepperGraphics2DHost() { - return NULL; +bool ResourceHost::IsGraphics2DHost() { + return false; } void ResourceHost::AddFilter(scoped_refptr filter) { diff --git a/ppapi/host/resource_host.h b/ppapi/host/resource_host.h index 2c40f62..37ccbed 100644 --- a/ppapi/host/resource_host.h +++ b/ppapi/host/resource_host.h @@ -14,13 +14,6 @@ #include "ppapi/host/resource_message_handler.h" #include "ppapi/shared_impl/host_resource.h" -namespace content { -class PepperFileRefHost; -class PepperFileSystemBrowserHost; -class PepperFileSystemHost; -class PepperGraphics2DHost; -} - namespace IPC { class Message; } @@ -61,11 +54,11 @@ class PPAPI_HOST_EXPORT ResourceHost : public ResourceMessageHandler { virtual void SendReply(const ReplyMessageContext& context, const IPC::Message& msg) OVERRIDE; - // Simple RTTI. Overidden by subclasses that implement the interface. - virtual content::PepperFileRefHost* AsPepperFileRefHost(); - virtual content::PepperFileSystemBrowserHost* AsPepperFileSystemBrowserHost(); - virtual content::PepperFileSystemHost* AsPepperFileSystemHost(); - virtual content::PepperGraphics2DHost* AsPepperGraphics2DHost(); + // Simple RTTI. A subclass that is a host for one of these APIs will override + // the appropriate function and return true. + virtual bool IsFileRefHost(); + virtual bool IsFileSystemHost(); + virtual bool IsGraphics2DHost(); protected: // Adds a ResourceMessageFilter to handle resource messages. Incoming -- cgit v1.1