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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 | 50 |
51 namespace content { | 51 namespace content { |
52 | 52 |
53 // 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 |
54 // messages with an error when is_listening_ is false. | 54 // messages with an error when is_listening_ is false. |
55 class IsListeningFilter : public IPC::ChannelProxy::MessageFilter { | 55 class IsListeningFilter : public IPC::ChannelProxy::MessageFilter { |
56 public: | 56 public: |
57 IsListeningFilter() : channel_(NULL) {} | 57 IsListeningFilter() : channel_(NULL) {} |
58 | 58 |
59 // MessageFilter overrides | 59 // MessageFilter overrides |
60 virtual void OnFilterRemoved() {} | 60 virtual void OnFilterRemoved() OVERRIDE {} |
61 virtual void OnFilterAdded(IPC::Channel* channel) { channel_ = channel; } | 61 virtual void OnFilterAdded(IPC::Channel* channel) OVERRIDE { |
62 virtual bool OnMessageReceived(const IPC::Message& message); | 62 channel_ = channel; |
| 63 } |
| 64 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
63 | 65 |
64 static bool is_listening_; | 66 static bool is_listening_; |
65 | 67 |
66 protected: | 68 protected: |
67 virtual ~IsListeningFilter() {} | 69 virtual ~IsListeningFilter() {} |
68 | 70 |
69 private: | 71 private: |
70 IPC::Channel* channel_; | 72 IPC::Channel* channel_; |
71 | 73 |
72 DISALLOW_COPY_AND_ASSIGN(IsListeningFilter); | 74 DISALLOW_COPY_AND_ASSIGN(IsListeningFilter); |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 | 225 |
224 for (ProxyMap::iterator iter = proxies_.begin(); | 226 for (ProxyMap::iterator iter = proxies_.begin(); |
225 iter != proxies_.end(); iter++) { | 227 iter != proxies_.end(); iter++) { |
226 iter->second->OnChannelError(); | 228 iter->second->OnChannelError(); |
227 } | 229 } |
228 | 230 |
229 proxies_.clear(); | 231 proxies_.clear(); |
230 } | 232 } |
231 | 233 |
232 } // namespace content | 234 } // namespace content |
OLD | NEW |