| 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/browser_ppp_selection.h" | 5 #include "native_client/src/shared/ppapi_proxy/browser_ppp_selection.h" |
| 6 | 6 |
| 7 // Include file order cannot be observed because ppp_instance declares a | 7 // Include file order cannot be observed because ppp_instance declares a |
| 8 // structure return type that causes an error on Windows. | 8 // structure return type that causes an error on Windows. |
| 9 // TODO(sehr, brettw): fix the return types and include order in PPAPI. | 9 // TODO(sehr, brettw): fix the return types and include order in PPAPI. |
| 10 #include "ppapi/c/pp_instance.h" | 10 #include "ppapi/c/pp_instance.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 instance, | 34 instance, |
| 35 static_cast<int32_t>(html), | 35 static_cast<int32_t>(html), |
| 36 &text_size, | 36 &text_size, |
| 37 text_bytes.get()); | 37 text_bytes.get()); |
| 38 | 38 |
| 39 DebugPrintf("PPP_Selection_Dev::GetSelectedText: %s\n", | 39 DebugPrintf("PPP_Selection_Dev::GetSelectedText: %s\n", |
| 40 NaClSrpcErrorString(srpc_result)); | 40 NaClSrpcErrorString(srpc_result)); |
| 41 | 41 |
| 42 PP_Var selected_text = PP_MakeUndefined(); | 42 PP_Var selected_text = PP_MakeUndefined(); |
| 43 if (srpc_result == NACL_SRPC_RESULT_OK) { | 43 if (srpc_result == NACL_SRPC_RESULT_OK) { |
| 44 (void) DeserializeTo( | 44 (void) DeserializeTo(text_bytes.get(), text_size, 1, &selected_text); |
| 45 channel, text_bytes.get(), text_size, 1, &selected_text); | |
| 46 } | 45 } |
| 47 return selected_text; | 46 return selected_text; |
| 48 } | 47 } |
| 49 | 48 |
| 50 } // namespace | 49 } // namespace |
| 51 | 50 |
| 52 const PPP_Selection_Dev* BrowserSelection::GetInterface() { | 51 const PPP_Selection_Dev* BrowserSelection::GetInterface() { |
| 53 static const PPP_Selection_Dev selection_interface = { | 52 static const PPP_Selection_Dev selection_interface = { |
| 54 GetSelectedText | 53 GetSelectedText |
| 55 }; | 54 }; |
| 56 return &selection_interface; | 55 return &selection_interface; |
| 57 } | 56 } |
| 58 | 57 |
| 59 } // namespace ppapi_proxy | 58 } // namespace ppapi_proxy |
| 60 | 59 |
| OLD | NEW |