Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(322)

Unified Diff: content/renderer/pepper/content_renderer_pepper_host_factory.cc

Issue 848863002: PPAPI: implement GetSupportedPreviewSizes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update histogram.xml with pepper_hash_for_uma Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 9d7fae63416eac0a78a9103e428f67e4b6c1ca13..1336be2b1d54aef0cf635e6ca161a91c322e68a0 100644
--- a/content/renderer/pepper/content_renderer_pepper_host_factory.cc
+++ b/content/renderer/pepper/content_renderer_pepper_host_factory.cc
@@ -15,6 +15,7 @@
#include "content/renderer/pepper/pepper_file_ref_renderer_host.h"
#include "content/renderer/pepper/pepper_file_system_host.h"
#include "content/renderer/pepper/pepper_graphics_2d_host.h"
+#include "content/renderer/pepper/pepper_image_capture_host.h"
#include "content/renderer/pepper/pepper_media_stream_video_track_host.h"
#include "content/renderer/pepper/pepper_plugin_instance_impl.h"
#include "content/renderer/pepper/pepper_url_loader_host.h"
@@ -200,6 +201,18 @@ scoped_ptr<ResourceHost> ContentRendererPepperHostFactory::CreateResourceHost(
}
}
+ // Private interfaces.
+ if (GetPermissions().HasPermission(ppapi::PERMISSION_PRIVATE)) {
+ switch (message.type()) {
+ case PpapiHostMsg_ImageCapture_Create::ID: {
+ scoped_ptr<PepperImageCaptureHost> host(
+ new PepperImageCaptureHost(host_, instance, resource));
+ return host->Init() ? scoped_ptr<ResourceHost>(host.Pass())
dcheng 2015/02/12 21:47:20 return host->Init() ? host : nullptr; should work
Justin Chuang 2015/02/16 19:15:23 Actually no, it needs to upcast to ResourceHost in
dcheng 2015/02/16 19:24:22 return host->Init() ? host.Pass() : nullptr; shou
Justin Chuang 2015/02/16 19:54:22 You're right. Pass() properly handles upcast. cl u
+ : scoped_ptr<ResourceHost>();
+ }
+ }
+ }
+
return scoped_ptr<ResourceHost>();
}

Powered by Google App Engine
This is Rietveld 408576698