Index: ppapi/proxy/serialized_handle.cc |
diff --git a/ppapi/proxy/serialized_structs.cc b/ppapi/proxy/serialized_handle.cc |
similarity index 53% |
copy from ppapi/proxy/serialized_structs.cc |
copy to ppapi/proxy/serialized_handle.cc |
index fcd41a7b2122711f66e3967c9a653423e4bbff8e..0159e6fd7261cbd668e6de3e5f4d0ff648e1816d 100644 |
--- a/ppapi/proxy/serialized_structs.cc |
+++ b/ppapi/proxy/serialized_handle.cc |
@@ -1,19 +1,14 @@ |
-// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#include "ppapi/proxy/serialized_structs.h" |
+#include "ppapi/proxy/serialized_handle.h" |
#include "base/pickle.h" |
#include "base/platform_file.h" |
#include "base/shared_memory.h" |
#include "build/build_config.h" |
#include "ipc/ipc_platform_file.h" |
-#include "ppapi/c/dev/ppb_font_dev.h" |
-#include "ppapi/c/pp_file_info.h" |
-#include "ppapi/c/pp_rect.h" |
-#include "ppapi/c/trusted/ppb_browser_font_trusted.h" |
-#include "ppapi/shared_impl/var.h" |
#if defined(OS_NACL) |
#include <unistd.h> |
@@ -22,86 +17,6 @@ |
namespace ppapi { |
namespace proxy { |
-SerializedFontDescription::SerializedFontDescription() |
- : face(), |
- family(0), |
- size(0), |
- weight(0), |
- italic(PP_FALSE), |
- small_caps(PP_FALSE), |
- letter_spacing(0), |
- word_spacing(0) { |
-} |
- |
-SerializedFontDescription::~SerializedFontDescription() {} |
- |
-void SerializedFontDescription::SetFromPPFontDescription( |
- const PP_FontDescription_Dev& desc) { |
- StringVar* string_var = StringVar::FromPPVar(desc.face); |
- face = string_var ? string_var->value() : std::string(); |
- |
- family = desc.family; |
- size = desc.size; |
- weight = desc.weight; |
- italic = desc.italic; |
- small_caps = desc.small_caps; |
- letter_spacing = desc.letter_spacing; |
- word_spacing = desc.word_spacing; |
-} |
- |
-void SerializedFontDescription::SetFromPPBrowserFontDescription( |
- const PP_BrowserFont_Trusted_Description& desc) { |
- StringVar* string_var = StringVar::FromPPVar(desc.face); |
- face = string_var ? string_var->value() : std::string(); |
- |
- family = desc.family; |
- size = desc.size; |
- weight = desc.weight; |
- italic = desc.italic; |
- small_caps = desc.small_caps; |
- letter_spacing = desc.letter_spacing; |
- word_spacing = desc.word_spacing; |
-} |
- |
-void SerializedFontDescription::SetToPPFontDescription( |
- PP_FontDescription_Dev* desc) const { |
- desc->face = StringVar::StringToPPVar(face); |
- desc->family = static_cast<PP_FontFamily_Dev>(family); |
- desc->size = size; |
- desc->weight = static_cast<PP_FontWeight_Dev>(weight); |
- desc->italic = italic; |
- desc->small_caps = small_caps; |
- desc->letter_spacing = letter_spacing; |
- desc->word_spacing = word_spacing; |
-} |
- |
-void SerializedFontDescription::SetToPPBrowserFontDescription( |
- PP_BrowserFont_Trusted_Description* desc) const { |
- desc->face = StringVar::StringToPPVar(face); |
- desc->family = static_cast<PP_BrowserFont_Trusted_Family>(family); |
- desc->size = size; |
- desc->weight = static_cast<PP_BrowserFont_Trusted_Weight>(weight); |
- desc->italic = italic; |
- desc->small_caps = small_caps; |
- desc->letter_spacing = letter_spacing; |
- desc->word_spacing = word_spacing; |
-} |
- |
-PPBFlash_DrawGlyphs_Params::PPBFlash_DrawGlyphs_Params() |
- : instance(0), |
- font_desc(), |
- color(0) { |
- clip.point.x = 0; |
- clip.point.y = 0; |
- clip.size.height = 0; |
- clip.size.width = 0; |
- position.x = 0; |
- position.y = 0; |
- allow_subpixel_aa = PP_FALSE; |
-} |
- |
-PPBFlash_DrawGlyphs_Params::~PPBFlash_DrawGlyphs_Params() {} |
- |
SerializedHandle::SerializedHandle() |
: type_(INVALID), |
shm_handle_(base::SharedMemory::NULLHandle()), |
@@ -117,7 +32,7 @@ SerializedHandle::SerializedHandle(Type type_param) |
} |
SerializedHandle::SerializedHandle(const base::SharedMemoryHandle& handle, |
- uint32_t size) |
+ uint32 size) |
: type_(SHARED_MEMORY), |
shm_handle_(handle), |
size_(size), |
@@ -194,7 +109,7 @@ bool SerializedHandle::ReadHeader(PickleIterator* iter, Header* hdr) { |
bool valid_type = false; |
switch (type) { |
case SHARED_MEMORY: { |
- uint32_t size = 0; |
+ uint32 size = 0; |
if (!iter->ReadUInt32(&size)) |
return false; |
hdr->size = size; |