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 #ifndef CONTENT_COMMON_NP_CHANNEL_BASE_H_ | 5 #ifndef CONTENT_COMMON_NP_CHANNEL_BASE_H_ |
6 #define CONTENT_COMMON_NP_CHANNEL_BASE_H_ | 6 #define CONTENT_COMMON_NP_CHANNEL_BASE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 namespace stdext { | 37 namespace stdext { |
38 | 38 |
39 template<> | 39 template<> |
40 inline size_t hash_value(NPObject* const& ptr) { | 40 inline size_t hash_value(NPObject* const& ptr) { |
41 return hash_value(reinterpret_cast<size_t>(ptr)); | 41 return hash_value(reinterpret_cast<size_t>(ptr)); |
42 } | 42 } |
43 | 43 |
44 } // namespace stdext | 44 } // namespace stdext |
45 #endif // COMPILER | 45 #endif // COMPILER |
46 | 46 |
| 47 namespace content { |
| 48 |
47 // Encapsulates an IPC channel between a renderer and another process. Used to | 49 // Encapsulates an IPC channel between a renderer and another process. Used to |
48 // proxy access to NP objects. | 50 // proxy access to NP objects. |
49 class NPChannelBase : public IPC::Listener, | 51 class NPChannelBase : public IPC::Listener, |
50 public IPC::Sender, | 52 public IPC::Sender, |
51 public base::RefCountedThreadSafe<NPChannelBase> { | 53 public base::RefCountedThreadSafe<NPChannelBase> { |
52 public: | 54 public: |
53 | 55 |
54 // WebPlugin[Delegate] call these on construction and destruction to setup | 56 // WebPlugin[Delegate] call these on construction and destruction to setup |
55 // the routing and manage lifetime of this object (they pass NULL for | 57 // the routing and manage lifetime of this object (they pass NULL for |
56 // npobject). These are also called by NPObjectProxy and NPObjectStub (which | 58 // npobject). These are also called by NPObjectProxy and NPObjectStub (which |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 // However to avoid deadlock, we must ensure that any message that's sent as | 193 // However to avoid deadlock, we must ensure that any message that's sent as |
192 // a result of a sync call from the renderer must unblock the renderer. We | 194 // a result of a sync call from the renderer must unblock the renderer. We |
193 // additionally have to do this for async messages from the renderer that | 195 // additionally have to do this for async messages from the renderer that |
194 // have the unblock flag set, since they could be followed by a sync message | 196 // have the unblock flag set, since they could be followed by a sync message |
195 // that won't get dispatched until the call to the renderer is complete. | 197 // that won't get dispatched until the call to the renderer is complete. |
196 bool send_unblocking_only_during_unblock_dispatch_; | 198 bool send_unblocking_only_during_unblock_dispatch_; |
197 | 199 |
198 DISALLOW_COPY_AND_ASSIGN(NPChannelBase); | 200 DISALLOW_COPY_AND_ASSIGN(NPChannelBase); |
199 }; | 201 }; |
200 | 202 |
| 203 } // namespace content |
| 204 |
201 #endif // CONTENT_COMMON_NP_CHANNEL_BASE_H_ | 205 #endif // CONTENT_COMMON_NP_CHANNEL_BASE_H_ |
OLD | NEW |