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/proxy/ppp_printing_proxy.h" | 5 #include "ppapi/proxy/ppp_printing_proxy.h" |
6 | 6 |
7 #include <string.h> | 7 #include <string.h> |
8 | 8 |
9 #include "ppapi/c/dev/ppp_printing_dev.h" | 9 #include "ppapi/c/dev/ppp_printing_dev.h" |
10 #include "ppapi/proxy/host_dispatcher.h" | 10 #include "ppapi/proxy/host_dispatcher.h" |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 | 173 |
174 void PPP_Printing_Proxy::OnPluginMsgPrintPages( | 174 void PPP_Printing_Proxy::OnPluginMsgPrintPages( |
175 PP_Instance instance, | 175 PP_Instance instance, |
176 const std::vector<PP_PrintPageNumberRange_Dev>& pages, | 176 const std::vector<PP_PrintPageNumberRange_Dev>& pages, |
177 HostResource* result) { | 177 HostResource* result) { |
178 if (!ppp_printing_impl_ || pages.empty()) | 178 if (!ppp_printing_impl_ || pages.empty()) |
179 return; | 179 return; |
180 | 180 |
181 PP_Resource plugin_resource = CallWhileUnlocked( | 181 PP_Resource plugin_resource = CallWhileUnlocked( |
182 ppp_printing_impl_->PrintPages, | 182 ppp_printing_impl_->PrintPages, |
183 instance, &pages[0], pages.size()); | 183 instance, &pages[0], static_cast<uint32_t>(pages.size())); |
184 ResourceTracker* resource_tracker = PpapiGlobals::Get()->GetResourceTracker(); | 184 ResourceTracker* resource_tracker = PpapiGlobals::Get()->GetResourceTracker(); |
185 Resource* resource_object = resource_tracker->GetResource(plugin_resource); | 185 Resource* resource_object = resource_tracker->GetResource(plugin_resource); |
186 if (!resource_object) | 186 if (!resource_object) |
187 return; | 187 return; |
188 | 188 |
189 *result = resource_object->host_resource(); | 189 *result = resource_object->host_resource(); |
190 | 190 |
191 // See PrintPages above for how refcounting works. | 191 // See PrintPages above for how refcounting works. |
192 resource_tracker->ReleaseResourceSoon(plugin_resource); | 192 resource_tracker->ReleaseResourceSoon(plugin_resource); |
193 } | 193 } |
194 | 194 |
195 void PPP_Printing_Proxy::OnPluginMsgEnd(PP_Instance instance) { | 195 void PPP_Printing_Proxy::OnPluginMsgEnd(PP_Instance instance) { |
196 if (ppp_printing_impl_) | 196 if (ppp_printing_impl_) |
197 CallWhileUnlocked(ppp_printing_impl_->End, instance); | 197 CallWhileUnlocked(ppp_printing_impl_->End, instance); |
198 } | 198 } |
199 | 199 |
200 void PPP_Printing_Proxy::OnPluginMsgIsScalingDisabled(PP_Instance instance, | 200 void PPP_Printing_Proxy::OnPluginMsgIsScalingDisabled(PP_Instance instance, |
201 bool* result) { | 201 bool* result) { |
202 if (ppp_printing_impl_) { | 202 if (ppp_printing_impl_) { |
203 *result = PP_ToBool(CallWhileUnlocked(ppp_printing_impl_->IsScalingDisabled, | 203 *result = PP_ToBool(CallWhileUnlocked(ppp_printing_impl_->IsScalingDisabled, |
204 instance)); | 204 instance)); |
205 } else { | 205 } else { |
206 *result = false; | 206 *result = false; |
207 } | 207 } |
208 } | 208 } |
209 | 209 |
210 } // namespace proxy | 210 } // namespace proxy |
211 } // namespace ppapi | 211 } // namespace ppapi |
OLD | NEW |