Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/renderer/pepper/content_renderer_pepper_host_factory.h" | 5 #include "content/renderer/pepper/content_renderer_pepper_host_factory.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "content/renderer/pepper/pepper_file_chooser_host.h" | 8 #include "content/renderer/pepper/pepper_file_chooser_host.h" |
| 9 #include "content/renderer/pepper/pepper_flash_host.h" | 9 #include "content/renderer/pepper/pepper_flash_host.h" |
| 10 #include "content/renderer/pepper/pepper_video_capture_host.h" | |
| 10 #include "content/renderer/pepper/pepper_websocket_host.h" | 11 #include "content/renderer/pepper/pepper_websocket_host.h" |
| 11 #include "content/renderer/pepper/renderer_ppapi_host_impl.h" | 12 #include "content/renderer/pepper/renderer_ppapi_host_impl.h" |
| 12 #include "ppapi/host/resource_host.h" | 13 #include "ppapi/host/resource_host.h" |
| 13 #include "ppapi/proxy/ppapi_messages.h" | 14 #include "ppapi/proxy/ppapi_messages.h" |
| 14 | 15 |
| 15 using ppapi::host::ResourceHost; | 16 using ppapi::host::ResourceHost; |
| 16 | 17 |
| 17 namespace content { | 18 namespace content { |
| 18 | 19 |
| 19 ContentRendererPepperHostFactory::ContentRendererPepperHostFactory( | 20 ContentRendererPepperHostFactory::ContentRendererPepperHostFactory( |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 33 | 34 |
| 34 // Make sure the plugin is giving us a valid instance for this resource. | 35 // Make sure the plugin is giving us a valid instance for this resource. |
| 35 if (!host_->IsValidInstance(instance)) | 36 if (!host_->IsValidInstance(instance)) |
| 36 return scoped_ptr<ResourceHost>(); | 37 return scoped_ptr<ResourceHost>(); |
| 37 | 38 |
| 38 // Stable interfaces. | 39 // Stable interfaces. |
| 39 switch (message.type()) { | 40 switch (message.type()) { |
| 40 case PpapiHostMsg_WebSocket_Create::ID: | 41 case PpapiHostMsg_WebSocket_Create::ID: |
| 41 return scoped_ptr<ResourceHost>(new PepperWebSocketHost( | 42 return scoped_ptr<ResourceHost>(new PepperWebSocketHost( |
| 42 host_, instance, params.pp_resource())); | 43 host_, instance, params.pp_resource())); |
| 44 case PpapiHostMsg_VideoCapture_Create::ID: { | |
| 45 PepperVideoCaptureHost* host = new PepperVideoCaptureHost( | |
|
yzshen1
2012/10/29 18:34:23
This is not a stable interface. Add it to the dev
victorhsieh
2012/10/30 09:43:28
Done. BTW, there is TODO before the dev section m
yzshen1
2012/11/06 06:51:40
I haven't looked into the relevant code. (Brett mi
victorhsieh
2012/11/08 09:20:18
I see. Will leave it untouched here.
On 2012/11/
| |
| 46 host_, instance, params.pp_resource()); | |
| 47 if (!host->Init()) { | |
| 48 delete host; | |
| 49 return scoped_ptr<ResourceHost>(); | |
| 50 } | |
| 51 return scoped_ptr<ResourceHost>(host); | |
| 52 } | |
| 43 } | 53 } |
| 44 | 54 |
| 45 // Resources for dev interfaces. | 55 // Resources for dev interfaces. |
| 46 // TODO(brettw) when we support any public or private interfaces, put them in | 56 // TODO(brettw) when we support any public or private interfaces, put them in |
| 47 // a separate switch above. | 57 // a separate switch above. |
| 48 | 58 |
| 49 // TODO(brettw) put back this dev check! This was removed to fix issue 138902 | 59 // TODO(brettw) put back this dev check! This was removed to fix issue 138902 |
| 50 // where the permissions for bundled Flash (but not Flash that you specify | 60 // where the permissions for bundled Flash (but not Flash that you specify |
| 51 // on the command line, making it difficult to test) are incorrect. | 61 // on the command line, making it difficult to test) are incorrect. |
| 52 /*if (GetPermissions().HasPermission(ppapi::PERMISSION_DEV))*/ { | 62 /*if (GetPermissions().HasPermission(ppapi::PERMISSION_DEV))*/ { |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 68 | 78 |
| 69 return scoped_ptr<ResourceHost>(); | 79 return scoped_ptr<ResourceHost>(); |
| 70 } | 80 } |
| 71 | 81 |
| 72 const ppapi::PpapiPermissions& | 82 const ppapi::PpapiPermissions& |
| 73 ContentRendererPepperHostFactory::GetPermissions() const { | 83 ContentRendererPepperHostFactory::GetPermissions() const { |
| 74 return host_->GetPpapiHost()->permissions(); | 84 return host_->GetPpapiHost()->permissions(); |
| 75 } | 85 } |
| 76 | 86 |
| 77 } // namespace content | 87 } // namespace content |
| OLD | NEW |