| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/renderer/plugin_channel_host.h" | 5 #include "content/renderer/plugin_channel_host.h" |
| 6 | 6 |
| 7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
| 8 #include "base/time.h" | 8 #include "base/time.h" |
| 9 #include "content/common/child_process.h" | 9 #include "content/common/child_process.h" |
| 10 #include "content/common/npobject_base.h" | 10 #include "content/common/npobject_base.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 | 41 |
| 42 // GetRemoveTrackingFlag() exposes this so that | 42 // GetRemoveTrackingFlag() exposes this so that |
| 43 // WebPluginDelegateProxy::Initialize() can do scoped set/reset. When | 43 // WebPluginDelegateProxy::Initialize() can do scoped set/reset. When |
| 44 // true, RemoveRoute() knows WBDP::Initialize() is on the stack, and | 44 // true, RemoveRoute() knows WBDP::Initialize() is on the stack, and |
| 45 // records the backtrace. | 45 // records the backtrace. |
| 46 bool remove_tracking = false; | 46 bool remove_tracking = false; |
| 47 | 47 |
| 48 } // namespace | 48 } // namespace |
| 49 #endif | 49 #endif |
| 50 | 50 |
| 51 namespace content { |
| 52 |
| 51 // A simple MessageFilter that will ignore all messages and respond to sync | 53 // A simple MessageFilter that will ignore all messages and respond to sync |
| 52 // messages with an error when is_listening_ is false. | 54 // messages with an error when is_listening_ is false. |
| 53 class IsListeningFilter : public IPC::ChannelProxy::MessageFilter { | 55 class IsListeningFilter : public IPC::ChannelProxy::MessageFilter { |
| 54 public: | 56 public: |
| 55 IsListeningFilter() : channel_(NULL) {} | 57 IsListeningFilter() : channel_(NULL) {} |
| 56 | 58 |
| 57 // MessageFilter overrides | 59 // MessageFilter overrides |
| 58 virtual void OnFilterRemoved() {} | 60 virtual void OnFilterRemoved() {} |
| 59 virtual void OnFilterAdded(IPC::Channel* channel) { channel_ = channel; } | 61 virtual void OnFilterAdded(IPC::Channel* channel) { channel_ = channel; } |
| 60 virtual bool OnMessageReceived(const IPC::Message& message); | 62 virtual bool OnMessageReceived(const IPC::Message& message); |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 | 221 |
| 220 NPChannelBase::OnChannelError(); | 222 NPChannelBase::OnChannelError(); |
| 221 | 223 |
| 222 for (ProxyMap::iterator iter = proxies_.begin(); | 224 for (ProxyMap::iterator iter = proxies_.begin(); |
| 223 iter != proxies_.end(); iter++) { | 225 iter != proxies_.end(); iter++) { |
| 224 iter->second->OnChannelError(); | 226 iter->second->OnChannelError(); |
| 225 } | 227 } |
| 226 | 228 |
| 227 proxies_.clear(); | 229 proxies_.clear(); |
| 228 } | 230 } |
| 231 |
| 232 } // namespace content |
| OLD | NEW |