| Index: ppapi/shared_impl/char_set_impl.cc
|
| diff --git a/ppapi/shared_impl/char_set_impl.cc b/ppapi/shared_impl/char_set_impl.cc
|
| index cad314206da820e36c0883c313580c983133dc40..06b98938507d0e8497ca330285d4d4e8d13cb92c 100644
|
| --- a/ppapi/shared_impl/char_set_impl.cc
|
| +++ b/ppapi/shared_impl/char_set_impl.cc
|
| @@ -5,7 +5,7 @@
|
| #include "ppapi/shared_impl/char_set_impl.h"
|
|
|
| #include "base/i18n/icu_string_conversions.h"
|
| -#include "ppapi/c/ppb_core.h"
|
| +#include "ppapi/c/dev/ppb_memory_dev.h"
|
| #include "unicode/ucnv.h"
|
| #include "unicode/ucnv_cb.h"
|
| #include "unicode/ucnv_err.h"
|
| @@ -42,13 +42,13 @@ bool PPToBaseConversionError(PP_CharSet_ConversionError on_error,
|
| // implementation in base, so we partially duplicate the code from
|
| // icu_string_conversions.cc with the correct error handling setup required
|
| // by the PPAPI interface.
|
| -char* CharSetImpl::UTF16ToCharSet(const PPB_Core* core,
|
| +char* CharSetImpl::UTF16ToCharSet(const PPB_Memory_Dev* memory,
|
| const uint16_t* utf16,
|
| uint32_t utf16_len,
|
| const char* output_char_set,
|
| PP_CharSet_ConversionError on_error,
|
| uint32_t* output_length) {
|
| - if (!core || !utf16 || !output_char_set || !output_length)
|
| + if (!memory || !utf16 || !output_char_set || !output_length)
|
| return NULL;
|
|
|
| *output_length = 0;
|
| @@ -101,13 +101,13 @@ char* CharSetImpl::UTF16ToCharSet(const PPB_Core* core,
|
| }
|
|
|
| // ucnv_fromUChars returns size not including terminating null.
|
| - char* encoded = static_cast<char*>(core->MemAlloc(encoded_max_length + 1));
|
| + char* encoded = static_cast<char*>(memory->MemAlloc(encoded_max_length + 1));
|
| int actual_size = ucnv_fromUChars(converter, encoded,
|
| encoded_max_length, reinterpret_cast<const UChar*>(utf16), utf16_len,
|
| &status);
|
| ucnv_close(converter);
|
| if (!U_SUCCESS(status)) {
|
| - core->MemFree(encoded);
|
| + memory->MemFree(encoded);
|
| return NULL;
|
| }
|
| encoded[actual_size] = 0;
|
| @@ -116,13 +116,13 @@ char* CharSetImpl::UTF16ToCharSet(const PPB_Core* core,
|
| }
|
|
|
| // static
|
| -uint16_t* CharSetImpl::CharSetToUTF16(const PPB_Core* core,
|
| +uint16_t* CharSetImpl::CharSetToUTF16(const PPB_Memory_Dev* memory,
|
| const char* input,
|
| uint32_t input_len,
|
| const char* input_char_set,
|
| PP_CharSet_ConversionError on_error,
|
| uint32_t* output_length) {
|
| - if (!core || !input || !input_char_set || !output_length)
|
| + if (!memory || !input || !input_char_set || !output_length)
|
| return NULL;
|
|
|
| *output_length = 0;
|
| @@ -139,7 +139,7 @@ uint16_t* CharSetImpl::CharSetToUTF16(const PPB_Core* core,
|
| return NULL;
|
|
|
| uint16_t* ret_buf = static_cast<uint16_t*>(
|
| - core->MemAlloc((output.size() + 1) * sizeof(uint16_t)));
|
| + memory->MemAlloc((output.size() + 1) * sizeof(uint16_t)));
|
| if (!ret_buf)
|
| return NULL;
|
|
|
|
|