| OLD | NEW |
| 1 // Copyright (c) 2011 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" |
| 11 #include "content/common/plugin_messages.h" | 11 #include "content/common/plugin_messages.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 22 public: | 22 public: |
| 23 IsListeningFilter() : channel_(NULL) {} | 23 IsListeningFilter() : channel_(NULL) {} |
| 24 | 24 |
| 25 // MessageFilter overrides | 25 // MessageFilter overrides |
| 26 virtual void OnFilterRemoved() {} | 26 virtual void OnFilterRemoved() {} |
| 27 virtual void OnFilterAdded(IPC::Channel* channel) { channel_ = channel; } | 27 virtual void OnFilterAdded(IPC::Channel* channel) { channel_ = channel; } |
| 28 virtual bool OnMessageReceived(const IPC::Message& message); | 28 virtual bool OnMessageReceived(const IPC::Message& message); |
| 29 | 29 |
| 30 static bool is_listening_; | 30 static bool is_listening_; |
| 31 | 31 |
| 32 protected: |
| 33 virtual ~IsListeningFilter() {} |
| 34 |
| 32 private: | 35 private: |
| 33 IPC::Channel* channel_; | 36 IPC::Channel* channel_; |
| 34 | 37 |
| 35 DISALLOW_COPY_AND_ASSIGN(IsListeningFilter); | 38 DISALLOW_COPY_AND_ASSIGN(IsListeningFilter); |
| 36 }; | 39 }; |
| 37 | 40 |
| 38 bool IsListeningFilter::OnMessageReceived(const IPC::Message& message) { | 41 bool IsListeningFilter::OnMessageReceived(const IPC::Message& message) { |
| 39 if (IsListeningFilter::is_listening_) { | 42 if (IsListeningFilter::is_listening_) { |
| 40 // Proceed with normal operation. | 43 // Proceed with normal operation. |
| 41 return false; | 44 return false; |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 void PluginChannelHost::OnChannelError() { | 157 void PluginChannelHost::OnChannelError() { |
| 155 NPChannelBase::OnChannelError(); | 158 NPChannelBase::OnChannelError(); |
| 156 | 159 |
| 157 for (ProxyMap::iterator iter = proxies_.begin(); | 160 for (ProxyMap::iterator iter = proxies_.begin(); |
| 158 iter != proxies_.end(); iter++) { | 161 iter != proxies_.end(); iter++) { |
| 159 iter->second->OnChannelError(); | 162 iter->second->OnChannelError(); |
| 160 } | 163 } |
| 161 | 164 |
| 162 proxies_.clear(); | 165 proxies_.clear(); |
| 163 } | 166 } |
| OLD | NEW |