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 "ppapi/host/ppapi_host.h" | 5 #include "ppapi/host/ppapi_host.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "ppapi/c/pp_errors.h" | 8 #include "ppapi/c/pp_errors.h" |
9 #include "ppapi/host/host_factory.h" | 9 #include "ppapi/host/host_factory.h" |
10 #include "ppapi/host/host_message_context.h" | 10 #include "ppapi/host/host_message_context.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 const IPC::Message& msg) { | 72 const IPC::Message& msg) { |
73 if (context.sync_reply_msg) { | 73 if (context.sync_reply_msg) { |
74 PpapiHostMsg_ResourceSyncCall::WriteReplyParams(context.sync_reply_msg, | 74 PpapiHostMsg_ResourceSyncCall::WriteReplyParams(context.sync_reply_msg, |
75 context.params, msg); | 75 context.params, msg); |
76 Send(context.sync_reply_msg); | 76 Send(context.sync_reply_msg); |
77 } else { | 77 } else { |
78 Send(new PpapiPluginMsg_ResourceReply(context.params, msg)); | 78 Send(new PpapiPluginMsg_ResourceReply(context.params, msg)); |
79 } | 79 } |
80 } | 80 } |
81 | 81 |
| 82 void PpapiHost::SendUnsolicitedReply(PP_Resource resource, |
| 83 const IPC::Message& msg) { |
| 84 proxy::ResourceMessageReplyParams params(resource, 0); |
| 85 Send(new PpapiPluginMsg_ResourceReply(params, msg)); |
| 86 } |
| 87 |
82 void PpapiHost::AddHostFactoryFilter(scoped_ptr<HostFactory> filter) { | 88 void PpapiHost::AddHostFactoryFilter(scoped_ptr<HostFactory> filter) { |
83 host_factory_filters_.push_back(filter.release()); | 89 host_factory_filters_.push_back(filter.release()); |
84 } | 90 } |
85 | 91 |
86 void PpapiHost::AddInstanceMessageFilter( | 92 void PpapiHost::AddInstanceMessageFilter( |
87 scoped_ptr<InstanceMessageFilter> filter) { | 93 scoped_ptr<InstanceMessageFilter> filter) { |
88 instance_message_filters_.push_back(filter.release()); | 94 instance_message_filters_.push_back(filter.release()); |
89 } | 95 } |
90 | 96 |
91 void PpapiHost::OnHostMsgResourceCall( | 97 void PpapiHost::OnHostMsgResourceCall( |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 resources_.erase(found); | 183 resources_.erase(found); |
178 } | 184 } |
179 | 185 |
180 ResourceHost* PpapiHost::GetResourceHost(PP_Resource resource) { | 186 ResourceHost* PpapiHost::GetResourceHost(PP_Resource resource) { |
181 ResourceMap::iterator found = resources_.find(resource); | 187 ResourceMap::iterator found = resources_.find(resource); |
182 return found == resources_.end() ? NULL : found->second.get(); | 188 return found == resources_.end() ? NULL : found->second.get(); |
183 } | 189 } |
184 | 190 |
185 } // namespace host | 191 } // namespace host |
186 } // namespace ppapi | 192 } // namespace ppapi |
OLD | NEW |