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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/hash_tables.h" | 12 #include "base/hash_tables.h" |
13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "base/process.h" | |
16 #include "content/common/message_router.h" | 15 #include "content/common/message_router.h" |
17 #include "content/common/npobject_base.h" | 16 #include "content/common/npobject_base.h" |
18 #include "ipc/ipc_channel_handle.h" | 17 #include "ipc/ipc_channel_handle.h" |
19 #include "ipc/ipc_sync_channel.h" | 18 #include "ipc/ipc_sync_channel.h" |
20 #include "ui/gfx/native_widget_types.h" | 19 #include "ui/gfx/native_widget_types.h" |
21 | 20 |
22 namespace base { | 21 namespace base { |
23 class MessageLoopProxy; | 22 class MessageLoopProxy; |
24 } | 23 } |
25 | 24 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 void AddMappingForNPObjectStub(int route_id, NPObject* object); | 68 void AddMappingForNPObjectStub(int route_id, NPObject* object); |
70 void RemoveMappingForNPObjectStub(int route_id, NPObject* object); | 69 void RemoveMappingForNPObjectStub(int route_id, NPObject* object); |
71 | 70 |
72 NPObject* GetExistingNPObjectProxy(int route_id); | 71 NPObject* GetExistingNPObjectProxy(int route_id); |
73 int GetExistingRouteForNPObjectStub(NPObject* npobject); | 72 int GetExistingRouteForNPObjectStub(NPObject* npobject); |
74 | 73 |
75 | 74 |
76 // IPC::Message::Sender implementation: | 75 // IPC::Message::Sender implementation: |
77 virtual bool Send(IPC::Message* msg) OVERRIDE; | 76 virtual bool Send(IPC::Message* msg) OVERRIDE; |
78 | 77 |
79 base::ProcessId peer_pid() { return channel_->peer_pid(); } | 78 int peer_pid() { return peer_pid_; } |
80 IPC::ChannelHandle channel_handle() const { return channel_handle_; } | 79 IPC::ChannelHandle channel_handle() const { return channel_handle_; } |
81 | 80 |
82 // Returns the number of open NPObject channels in this process. | 81 // Returns the number of open NPObject channels in this process. |
83 static int Count(); | 82 static int Count(); |
84 | 83 |
85 // Returns a new route id. | 84 // Returns a new route id. |
86 virtual int GenerateRouteID() = 0; | 85 virtual int GenerateRouteID() = 0; |
87 | 86 |
88 // Returns whether the channel is valid or not. A channel is invalid | 87 // Returns whether the channel is valid or not. A channel is invalid |
89 // if it is disconnected due to a channel error. | 88 // if it is disconnected due to a channel error. |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 // a result of a sync call from the renderer must unblock the renderer. We | 193 // a result of a sync call from the renderer must unblock the renderer. We |
195 // additionally have to do this for async messages from the renderer that | 194 // additionally have to do this for async messages from the renderer that |
196 // have the unblock flag set, since they could be followed by a sync message | 195 // have the unblock flag set, since they could be followed by a sync message |
197 // that won't get dispatched until the call to the renderer is complete. | 196 // that won't get dispatched until the call to the renderer is complete. |
198 bool send_unblocking_only_during_unblock_dispatch_; | 197 bool send_unblocking_only_during_unblock_dispatch_; |
199 | 198 |
200 DISALLOW_COPY_AND_ASSIGN(NPChannelBase); | 199 DISALLOW_COPY_AND_ASSIGN(NPChannelBase); |
201 }; | 200 }; |
202 | 201 |
203 #endif // CONTENT_COMMON_NP_CHANNEL_BASE_H_ | 202 #endif // CONTENT_COMMON_NP_CHANNEL_BASE_H_ |
OLD | NEW |