| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "native_client/src/shared/ppapi_proxy/plugin_ppb_pdf.h" | 5 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_pdf.h" |
| 6 | 6 |
| 7 #include <stdio.h> | 7 #include <stdio.h> |
| 8 #include <stdlib.h> | 8 #include <stdlib.h> |
| 9 #include <string.h> | 9 #include <string.h> |
| 10 #include <sys/mman.h> | 10 #include <sys/mman.h> |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 nacl::scoped_array<char> string_bytes(new char[kMaxVarSize]); | 42 nacl::scoped_array<char> string_bytes(new char[kMaxVarSize]); |
| 43 NaClSrpcError srpc_result = | 43 NaClSrpcError srpc_result = |
| 44 PpbPdfRpcClient::PPB_PDF_GetLocalizedString( | 44 PpbPdfRpcClient::PPB_PDF_GetLocalizedString( |
| 45 channel, | 45 channel, |
| 46 instance, | 46 instance, |
| 47 static_cast<int32_t>(string_id), | 47 static_cast<int32_t>(string_id), |
| 48 &string_size, string_bytes.get()); | 48 &string_size, string_bytes.get()); |
| 49 | 49 |
| 50 PP_Var string = PP_MakeUndefined(); | 50 PP_Var string = PP_MakeUndefined(); |
| 51 if (srpc_result == NACL_SRPC_RESULT_OK) { | 51 if (srpc_result == NACL_SRPC_RESULT_OK) { |
| 52 (void) DeserializeTo( | 52 (void) DeserializeTo(string_bytes.get(), string_size, 1, &string); |
| 53 channel, string_bytes.get(), string_size, 1, &string); | |
| 54 } | 53 } |
| 55 | 54 |
| 56 DebugPrintf("PPB_PDF::GetLocalizedString: %s\n", | 55 DebugPrintf("PPB_PDF::GetLocalizedString: %s\n", |
| 57 NaClSrpcErrorString(srpc_result)); | 56 NaClSrpcErrorString(srpc_result)); |
| 58 return string; | 57 return string; |
| 59 } | 58 } |
| 60 | 59 |
| 61 PP_Resource GetResourceImage(PP_Instance instance, | 60 PP_Resource GetResourceImage(PP_Instance instance, |
| 62 PP_ResourceImage image_id) { | 61 PP_ResourceImage image_id) { |
| 63 DebugPrintf("PPB_PDF::GetResourceImage: " | 62 DebugPrintf("PPB_PDF::GetResourceImage: " |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 HistogramPDFPageCount, | 245 HistogramPDFPageCount, |
| 247 UserMetricsRecordAction, | 246 UserMetricsRecordAction, |
| 248 HasUnsupportedFeature, | 247 HasUnsupportedFeature, |
| 249 SaveAs | 248 SaveAs |
| 250 }; | 249 }; |
| 251 return &pdf_interface; | 250 return &pdf_interface; |
| 252 } | 251 } |
| 253 | 252 |
| 254 } // namespace ppapi_proxy | 253 } // namespace ppapi_proxy |
| 255 | 254 |
| OLD | NEW |