Index: content/renderer/pepper/content_renderer_pepper_host_factory.cc |
diff --git a/content/renderer/pepper/content_renderer_pepper_host_factory.cc b/content/renderer/pepper/content_renderer_pepper_host_factory.cc |
index 8cffc73d0f37cc3db164a5e2f0c9026eb3a07790..fa1ec5fe92038cf510df72e0fe87bc6794aea6e8 100644 |
--- a/content/renderer/pepper/content_renderer_pepper_host_factory.cc |
+++ b/content/renderer/pepper/content_renderer_pepper_host_factory.cc |
@@ -41,8 +41,7 @@ namespace content { |
#if defined(ENABLE_WEBRTC) |
namespace { |
-bool CanUseMediaStreamAPI(const RendererPpapiHost* host, |
- PP_Instance instance) { |
+bool CanUseMediaStreamAPI(const RendererPpapiHost* host, PP_Instance instance) { |
blink::WebPluginContainer* container = |
host->GetContainerForInstance(instance); |
if (!container) |
@@ -59,11 +58,9 @@ bool CanUseMediaStreamAPI(const RendererPpapiHost* host, |
ContentRendererPepperHostFactory::ContentRendererPepperHostFactory( |
RendererPpapiHostImpl* host) |
- : host_(host) { |
-} |
+ : host_(host) {} |
-ContentRendererPepperHostFactory::~ContentRendererPepperHostFactory() { |
-} |
+ContentRendererPepperHostFactory::~ContentRendererPepperHostFactory() {} |
scoped_ptr<ResourceHost> ContentRendererPepperHostFactory::CreateResourceHost( |
ppapi::host::PpapiHost* host, |
@@ -86,9 +83,8 @@ scoped_ptr<ResourceHost> ContentRendererPepperHostFactory::CreateResourceHost( |
case PpapiHostMsg_FileRef_CreateInternal::ID: { |
PP_Resource file_system; |
std::string internal_path; |
- if (!UnpackMessage<PpapiHostMsg_FileRef_CreateInternal>(message, |
- &file_system, |
- &internal_path)) { |
+ if (!UnpackMessage<PpapiHostMsg_FileRef_CreateInternal>( |
+ message, &file_system, &internal_path)) { |
NOTREACHED(); |
return scoped_ptr<ResourceHost>(); |
} |
@@ -108,23 +104,27 @@ scoped_ptr<ResourceHost> ContentRendererPepperHostFactory::CreateResourceHost( |
case PpapiHostMsg_Graphics2D_Create::ID: { |
PP_Size size; |
PP_Bool is_always_opaque; |
- if (!UnpackMessage<PpapiHostMsg_Graphics2D_Create>(message, &size, |
- &is_always_opaque)) { |
+ if (!UnpackMessage<PpapiHostMsg_Graphics2D_Create>( |
+ message, &size, &is_always_opaque)) { |
NOTREACHED(); |
return scoped_ptr<ResourceHost>(); |
} |
scoped_refptr<PPB_ImageData_Impl> image_data(new PPB_ImageData_Impl( |
instance, ppapi::PPB_ImageData_Shared::PLATFORM)); |
return scoped_ptr<ResourceHost>( |
- PepperGraphics2DHost::Create(host_, instance, params.pp_resource(), |
- size, is_always_opaque, image_data)); |
+ PepperGraphics2DHost::Create(host_, |
+ instance, |
+ params.pp_resource(), |
+ size, |
+ is_always_opaque, |
+ image_data)); |
} |
case PpapiHostMsg_URLLoader_Create::ID: |
return scoped_ptr<ResourceHost>(new PepperURLLoaderHost( |
host_, false, instance, params.pp_resource())); |
case PpapiHostMsg_WebSocket_Create::ID: |
- return scoped_ptr<ResourceHost>(new PepperWebSocketHost( |
- host_, instance, params.pp_resource())); |
+ return scoped_ptr<ResourceHost>( |
+ new PepperWebSocketHost(host_, instance, params.pp_resource())); |
#if defined(ENABLE_WEBRTC) |
// These private MediaStream interfaces are exposed as if they were public |
// so they can be used by NaCl plugins. However, they are available only |
@@ -135,8 +135,8 @@ scoped_ptr<ResourceHost> ContentRendererPepperHostFactory::CreateResourceHost( |
host_, instance, params.pp_resource())); |
case PpapiHostMsg_VideoSource_Create::ID: |
if (CanUseMediaStreamAPI(host_, instance)) |
- return scoped_ptr<ResourceHost>(new PepperVideoSourceHost( |
- host_, instance, params.pp_resource())); |
+ return scoped_ptr<ResourceHost>( |
+ new PepperVideoSourceHost(host_, instance, params.pp_resource())); |
#endif // defined(ENABLE_WEBRTC) |
} |
@@ -144,15 +144,14 @@ scoped_ptr<ResourceHost> ContentRendererPepperHostFactory::CreateResourceHost( |
if (GetPermissions().HasPermission(ppapi::PERMISSION_DEV)) { |
switch (message.type()) { |
case PpapiHostMsg_AudioInput_Create::ID: |
- return scoped_ptr<ResourceHost>(new PepperAudioInputHost( |
- host_, instance, params.pp_resource())); |
+ return scoped_ptr<ResourceHost>( |
+ new PepperAudioInputHost(host_, instance, params.pp_resource())); |
case PpapiHostMsg_FileChooser_Create::ID: |
- return scoped_ptr<ResourceHost>(new PepperFileChooserHost( |
- host_, instance, params.pp_resource())); |
+ return scoped_ptr<ResourceHost>( |
+ new PepperFileChooserHost(host_, instance, params.pp_resource())); |
case PpapiHostMsg_TrueTypeFont_Create::ID: { |
SerializedTrueTypeFontDesc desc; |
- if (!UnpackMessage<PpapiHostMsg_TrueTypeFont_Create>(message, |
- &desc)) { |
+ if (!UnpackMessage<PpapiHostMsg_TrueTypeFont_Create>(message, &desc)) { |
NOTREACHED(); |
return scoped_ptr<ResourceHost>(); |
} |
@@ -165,8 +164,8 @@ scoped_ptr<ResourceHost> ContentRendererPepperHostFactory::CreateResourceHost( |
break; // Drop through and return null host. |
} |
case PpapiHostMsg_VideoCapture_Create::ID: { |
- PepperVideoCaptureHost* host = new PepperVideoCaptureHost( |
- host_, instance, params.pp_resource()); |
+ PepperVideoCaptureHost* host = |
+ new PepperVideoCaptureHost(host_, instance, params.pp_resource()); |
if (!host->Init()) { |
delete host; |
return scoped_ptr<ResourceHost>(); |