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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 } | 67 } |
68 | 68 |
69 return handled; | 69 return handled; |
70 } | 70 } |
71 | 71 |
72 void PpapiHost::SendReply(const proxy::ResourceMessageReplyParams& params, | 72 void PpapiHost::SendReply(const proxy::ResourceMessageReplyParams& params, |
73 const IPC::Message& msg) { | 73 const IPC::Message& msg) { |
74 Send(new PpapiPluginMsg_ResourceReply(params, msg)); | 74 Send(new PpapiPluginMsg_ResourceReply(params, msg)); |
75 } | 75 } |
76 | 76 |
| 77 void PpapiHost::SendUnsolicitedReply(PP_Resource resource, |
| 78 const IPC::Message& msg) { |
| 79 proxy::ResourceMessageReplyParams params(resource, 0); |
| 80 Send(new PpapiPluginMsg_ResourceReply(params, msg)); |
| 81 } |
| 82 |
77 void PpapiHost::AddHostFactoryFilter(scoped_ptr<HostFactory> filter) { | 83 void PpapiHost::AddHostFactoryFilter(scoped_ptr<HostFactory> filter) { |
78 host_factory_filters_.push_back(filter.release()); | 84 host_factory_filters_.push_back(filter.release()); |
79 } | 85 } |
80 | 86 |
81 void PpapiHost::AddInstanceMessageFilter( | 87 void PpapiHost::AddInstanceMessageFilter( |
82 scoped_ptr<InstanceMessageFilter> filter) { | 88 scoped_ptr<InstanceMessageFilter> filter) { |
83 instance_message_filters_.push_back(filter.release()); | 89 instance_message_filters_.push_back(filter.release()); |
84 } | 90 } |
85 | 91 |
86 void PpapiHost::OnHostMsgResourceCall( | 92 void PpapiHost::OnHostMsgResourceCall( |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 resources_.erase(found); | 158 resources_.erase(found); |
153 } | 159 } |
154 | 160 |
155 ResourceHost* PpapiHost::GetResourceHost(PP_Resource resource) { | 161 ResourceHost* PpapiHost::GetResourceHost(PP_Resource resource) { |
156 ResourceMap::iterator found = resources_.find(resource); | 162 ResourceMap::iterator found = resources_.find(resource); |
157 return found == resources_.end() ? NULL : found->second.get(); | 163 return found == resources_.end() ? NULL : found->second.get(); |
158 } | 164 } |
159 | 165 |
160 } // namespace host | 166 } // namespace host |
161 } // namespace ppapi | 167 } // namespace ppapi |
OLD | NEW |