From 79bc6c7180a746c664be2efe2f285281220d06af Mon Sep 17 00:00:00 2001 From: "raymes@chromium.org" Date: Thu, 3 Jan 2013 00:51:54 +0000 Subject: Remove InstanceMessageFilter This was previously used for handling PPB_Flash_Print IPCs which has now been moved to the pepper singleton-style resource model. The use of this class has largely been replaced by singleton-style resources and I don't forsee new uses of it in the near future. It can be added back in the future if needed. BUG= Review URL: https://chromiumcodereview.appspot.com/11645039 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@174905 0039d316-1c4b-4281-b951-d872f2087c98 --- ppapi/host/instance_message_filter.cc | 19 ---------------- ppapi/host/instance_message_filter.h | 41 ----------------------------------- ppapi/host/ppapi_host.cc | 20 +---------------- ppapi/host/ppapi_host.h | 11 ---------- 4 files changed, 1 insertion(+), 90 deletions(-) delete mode 100644 ppapi/host/instance_message_filter.cc delete mode 100644 ppapi/host/instance_message_filter.h (limited to 'ppapi/host') diff --git a/ppapi/host/instance_message_filter.cc b/ppapi/host/instance_message_filter.cc deleted file mode 100644 index 229235f..0000000 --- a/ppapi/host/instance_message_filter.cc +++ /dev/null @@ -1,19 +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. - -#include "ppapi/host/instance_message_filter.h" - -#include "ppapi/host/ppapi_host.h" - -namespace ppapi { -namespace host { - -InstanceMessageFilter::InstanceMessageFilter(PpapiHost* host) : host_(host) { -} - -InstanceMessageFilter::~InstanceMessageFilter() { -} - -} // namespace host -} // namespace ppapi diff --git a/ppapi/host/instance_message_filter.h b/ppapi/host/instance_message_filter.h deleted file mode 100644 index 2b072e9..0000000 --- a/ppapi/host/instance_message_filter.h +++ /dev/null @@ -1,41 +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. - -#ifndef PPAPI_HOST_INSTANCE_MESSAGE_FILTER_H_ -#define PPAPI_HOST_INSTANCE_MESSAGE_FILTER_H_ - -#include "base/basictypes.h" -#include "ppapi/host/ppapi_host_export.h" - -namespace IPC { -class Message; -} - -namespace ppapi { -namespace host { - -class PpapiHost; - -class PPAPI_HOST_EXPORT InstanceMessageFilter { - public: - explicit InstanceMessageFilter(PpapiHost* host); - virtual ~InstanceMessageFilter(); - - // Processes an instance message from the plugin process. Returns true if the - // message was handled. On false, the PpapiHost will forward the message to - // the next filter. - virtual bool OnInstanceMessageReceived(const IPC::Message& msg) = 0; - - PpapiHost* host() { return host_; } - - private: - PpapiHost* host_; - - DISALLOW_COPY_AND_ASSIGN(InstanceMessageFilter); -}; - -} // namespace host -} // namespace ppapi - -#endif // PPAPI_HOST_INSTANCE_MESSAGE_FILTER_H_ diff --git a/ppapi/host/ppapi_host.cc b/ppapi/host/ppapi_host.cc index 87dfb11..6423f1e 100644 --- a/ppapi/host/ppapi_host.cc +++ b/ppapi/host/ppapi_host.cc @@ -8,7 +8,6 @@ #include "ppapi/c/pp_errors.h" #include "ppapi/host/host_factory.h" #include "ppapi/host/host_message_context.h" -#include "ppapi/host/instance_message_filter.h" #include "ppapi/host/resource_host.h" #include "ppapi/proxy/ppapi_messages.h" #include "ppapi/proxy/resource_message_params.h" @@ -34,11 +33,8 @@ PpapiHost::PpapiHost(IPC::Sender* sender, PpapiHost::~PpapiHost() { // Delete these explicitly before destruction since then the host is still - // technically alive in case one of the filters accesses us from the + // technically alive in case one of the hosts accesses us from the // destructor. - instance_message_filters_.clear(); - - // The resources may also want to use us in their destructors. resources_.clear(); pending_resource_hosts_.clear(); } @@ -63,15 +59,6 @@ bool PpapiHost::OnMessageReceived(const IPC::Message& msg) { IPC_MESSAGE_UNHANDLED(handled = false) IPC_END_MESSAGE_MAP() - if (!handled) { - for (size_t i = 0; i < instance_message_filters_.size(); i++) { - if (instance_message_filters_[i]->OnInstanceMessageReceived(msg)) { - handled = true; - break; - } - } - } - return handled; } @@ -107,11 +94,6 @@ void PpapiHost::AddHostFactoryFilter(scoped_ptr filter) { host_factory_filters_.push_back(filter.release()); } -void PpapiHost::AddInstanceMessageFilter( - scoped_ptr filter) { - instance_message_filters_.push_back(filter.release()); -} - void PpapiHost::OnHostMsgResourceCall( const proxy::ResourceMessageCallParams& params, const IPC::Message& nested_msg) { diff --git a/ppapi/host/ppapi_host.h b/ppapi/host/ppapi_host.h index c661a9b..5e44d1a 100644 --- a/ppapi/host/ppapi_host.h +++ b/ppapi/host/ppapi_host.h @@ -30,7 +30,6 @@ namespace host { class HostFactory; struct HostMessageContext; -class InstanceMessageFilter; struct ReplyMessageContext; class ResourceHost; @@ -70,10 +69,6 @@ class PPAPI_HOST_EXPORT PpapiHost : public IPC::Sender, public IPC::Listener { // ownership of the pointer. void AddHostFactoryFilter(scoped_ptr filter); - // Adds the given message filter to the host. The PpapiHost will take - // ownership of the pointer. - void AddInstanceMessageFilter(scoped_ptr filter); - // Returns null if the resource doesn't exist. host::ResourceHost* GetResourceHost(PP_Resource resource) const; @@ -109,12 +104,6 @@ class PPAPI_HOST_EXPORT PpapiHost : public IPC::Sender, public IPC::Listener { // an ObserverList. ScopedVector host_factory_filters_; - // Filters for instance messages. Note that since we don't support deleting - // these dynamically we don't need to worry about modifications during - // iteration. If we add that capability, this should be replaced with an - // ObserverList. - ScopedVector instance_message_filters_; - typedef std::map > ResourceMap; ResourceMap resources_; -- cgit v1.1