diff options
author | dmichael@chromium.org <dmichael@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-31 19:55:11 +0000 |
---|---|---|
committer | dmichael@chromium.org <dmichael@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-31 19:55:11 +0000 |
commit | 7445a61840911ec3c4786bcbcc79b9b9fc8029c5 (patch) | |
tree | 63da5faf10947a74086bdac0ced03d3ffaa17d33 /ppapi | |
parent | 4ae74e10f25b8e92765eb7eff1b41126c51fce20 (diff) | |
download | chromium_src-7445a61840911ec3c4786bcbcc79b9b9fc8029c5.zip chromium_src-7445a61840911ec3c4786bcbcc79b9b9fc8029c5.tar.gz chromium_src-7445a61840911ec3c4786bcbcc79b9b9fc8029c5.tar.bz2 |
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
Diffstat (limited to 'ppapi')
-rw-r--r-- | ppapi/host/resource_host.cc | 17 | ||||
-rw-r--r-- | ppapi/host/resource_host.h | 17 |
2 files changed, 11 insertions, 23 deletions
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<ResourceMessageFilter> 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 |