format previously missed chromium_src .cc files

This commit is contained in:
Shelley Vohr 2018-04-17 21:57:05 -04:00
parent 8cc81509d7
commit f7d4437b3f
No known key found for this signature in database
GPG key ID: F13993A75599653C
58 changed files with 688 additions and 898 deletions

View file

@ -28,7 +28,8 @@ ChromeRendererPepperHostFactory::ChromeRendererPepperHostFactory(
ChromeRendererPepperHostFactory::~ChromeRendererPepperHostFactory() {}
std::unique_ptr<ResourceHost> ChromeRendererPepperHostFactory::CreateResourceHost(
std::unique_ptr<ResourceHost>
ChromeRendererPepperHostFactory::CreateResourceHost(
ppapi::host::PpapiHost* host,
PP_Resource resource,
PP_Instance instance,

View file

@ -32,10 +32,8 @@ PepperFlashFontFileHost::PepperFlashFontFileHost(
fd_.reset(content::MatchFontWithFallback(
description.face.c_str(),
description.weight >= PP_BROWSERFONT_TRUSTED_WEIGHT_BOLD,
description.italic,
charset,
PP_BROWSERFONT_TRUSTED_FAMILY_DEFAULT));
#elif defined(OS_WIN) // defined(OS_LINUX) || defined(OS_OPENBSD)
description.italic, charset, PP_BROWSERFONT_TRUSTED_FAMILY_DEFAULT));
#elif defined(OS_WIN) // defined(OS_LINUX) || defined(OS_OPENBSD)
int weight = description.weight;
if (weight == FW_DONTCARE)
weight = SkFontStyle::kNormal_Weight;
@ -45,7 +43,7 @@ PepperFlashFontFileHost::PepperFlashFontFileHost(
sk_sp<SkFontMgr> font_mgr(SkFontMgr::RefDefault());
typeface_ = sk_sp<SkTypeface>(
font_mgr->matchFamilyStyle(description.face.c_str(), style));
#endif // defined(OS_WIN)
#endif // defined(OS_WIN)
}
PepperFlashFontFileHost::~PepperFlashFontFileHost() {}
@ -67,7 +65,7 @@ bool PepperFlashFontFileHost::GetFontData(uint32_t table,
int fd = fd_.get();
if (fd != -1)
result = content::GetFontTable(fd, table, 0 /* offset */,
reinterpret_cast<uint8_t*>(buffer), length);
reinterpret_cast<uint8_t*>(buffer), length);
#elif defined(OS_WIN)
if (typeface_) {
table = base::ByteSwap(table);
@ -92,14 +90,14 @@ int32_t PepperFlashFontFileHost::OnGetFontTable(
int32_t result = PP_ERROR_FAILED;
size_t length = 0;
if (GetFontData(table, NULL, &length)) {
contents.resize(length);
uint8_t* contents_ptr =
reinterpret_cast<uint8_t*>(const_cast<char*>(contents.c_str()));
if (GetFontData(table, contents_ptr, &length)) {
result = PP_OK;
} else {
contents.clear();
}
contents.resize(length);
uint8_t* contents_ptr =
reinterpret_cast<uint8_t*>(const_cast<char*>(contents.c_str()));
if (GetFontData(table, contents_ptr, &length)) {
result = PP_OK;
} else {
contents.clear();
}
}
context->reply_msg = PpapiPluginMsg_FlashFontFile_GetFontTableReply(contents);

View file

@ -26,8 +26,7 @@ int32_t PepperFlashFullscreenHost::OnResourceMessageReceived(
ppapi::host::HostMessageContext* context) {
PPAPI_BEGIN_MESSAGE_MAP(PepperFlashFullscreenHost, msg)
PPAPI_DISPATCH_HOST_RESOURCE_CALL(
PpapiHostMsg_FlashFullscreen_SetFullscreen,
OnSetFullscreen)
PpapiHostMsg_FlashFullscreen_SetFullscreen, OnSetFullscreen)
PPAPI_END_MESSAGE_MAP()
return PP_ERROR_FAILED;
}

View file

@ -79,8 +79,8 @@ bool ConvertMenuData(const PP_Flash_Menu* in_menu,
item.enabled = PP_ToBool(in_menu->items[i].enabled);
item.checked = PP_ToBool(in_menu->items[i].checked);
if (type == PP_FLASH_MENUITEM_TYPE_SUBMENU) {
if (!ConvertMenuData(
in_menu->items[i].submenu, depth + 1, &item.submenu, menu_id_map))
if (!ConvertMenuData(in_menu->items[i].submenu, depth + 1, &item.submenu,
menu_id_map))
return false;
}
@ -194,8 +194,7 @@ void PepperFlashMenuHost::OnMenuClosed(int request_id) {
void PepperFlashMenuHost::SendMenuReply(int32_t result, int action) {
ppapi::host::ReplyMessageContext reply_context(
ppapi::proxy::ResourceMessageReplyParams(pp_resource(), 0),
NULL,
ppapi::proxy::ResourceMessageReplyParams(pp_resource(), 0), NULL,
MSG_ROUTING_NONE);
reply_context.params.set_result(result);
host()->SendReply(reply_context, PpapiPluginMsg_FlashMenu_ShowReply(action));

View file

@ -97,7 +97,7 @@ enum FlashNavigateUsage {
FLASH_NAVIGATE_USAGE_ENUM_COUNT
};
static base::LazyInstance<std::map<std::string, FlashNavigateUsage> >::
static base::LazyInstance<std::map<std::string, FlashNavigateUsage>>::
DestructorAtExit g_rejected_headers = LAZY_INSTANCE_INITIALIZER;
bool IsSimpleHeader(const std::string& lower_case_header_name,
@ -112,11 +112,8 @@ bool IsSimpleHeader(const std::string& lower_case_header_name,
std::string lower_case_mime_type;
std::string lower_case_charset;
bool had_charset = false;
net::HttpUtil::ParseContentType(header_value,
&lower_case_mime_type,
&lower_case_charset,
&had_charset,
NULL);
net::HttpUtil::ParseContentType(header_value, &lower_case_mime_type,
&lower_case_charset, &had_charset, NULL);
return lower_case_mime_type == "application/x-www-form-urlencoded" ||
lower_case_mime_type == "multipart/form-data" ||
lower_case_mime_type == "text/plain";
@ -127,8 +124,8 @@ bool IsSimpleHeader(const std::string& lower_case_header_name,
void RecordFlashNavigateUsage(FlashNavigateUsage usage) {
DCHECK_NE(FLASH_NAVIGATE_USAGE_ENUM_COUNT, usage);
UMA_HISTOGRAM_ENUMERATION(
"Plugin.FlashNavigateUsage", usage, FLASH_NAVIGATE_USAGE_ENUM_COUNT);
UMA_HISTOGRAM_ENUMERATION("Plugin.FlashNavigateUsage", usage,
FLASH_NAVIGATE_USAGE_ENUM_COUNT);
}
} // namespace
@ -277,8 +274,8 @@ int32_t PepperFlashRendererHost::OnDrawGlyphs(
y += SkFloatToScalar(params.glyph_advances[i].y);
}
canvas->drawPosText(
&params.glyph_indices[0], glyph_count * 2, sk_positions, paint);
canvas->drawPosText(&params.glyph_indices[0], glyph_count * 2, sk_positions,
paint);
}
if (needs_unmapping)
@ -310,12 +307,11 @@ int32_t PepperFlashRendererHost::OnNavigate(
static_cast<FlashNavigateUsage>(i);
}
net::HttpUtil::HeadersIterator header_iter(
data.headers.begin(), data.headers.end(), "\n\r");
net::HttpUtil::HeadersIterator header_iter(data.headers.begin(),
data.headers.end(), "\n\r");
bool rejected = false;
while (header_iter.GetNext()) {
std::string lower_case_header_name =
base::ToLowerASCII(header_iter.name());
std::string lower_case_header_name = base::ToLowerASCII(header_iter.name());
if (!IsSimpleHeader(lower_case_header_name, header_iter.values())) {
rejected = true;