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 "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "content/public/common/content_client.h" | 9 #include "content/public/common/content_client.h" |
10 #include "content/public/renderer/content_renderer_client.h" | 10 #include "content/public/renderer/content_renderer_client.h" |
11 #include "content/renderer/pepper/pepper_audio_input_host.h" | 11 #include "content/renderer/pepper/pepper_audio_input_host.h" |
12 #include "content/renderer/pepper/pepper_file_chooser_host.h" | 12 #include "content/renderer/pepper/pepper_file_chooser_host.h" |
13 #include "content/renderer/pepper/pepper_file_io_host.h" | 13 #include "content/renderer/pepper/pepper_file_io_host.h" |
14 #include "content/renderer/pepper/pepper_file_ref_renderer_host.h" | |
14 #include "content/renderer/pepper/pepper_file_system_host.h" | 15 #include "content/renderer/pepper/pepper_file_system_host.h" |
15 #include "content/renderer/pepper/pepper_graphics_2d_host.h" | 16 #include "content/renderer/pepper/pepper_graphics_2d_host.h" |
16 #include "content/renderer/pepper/pepper_truetype_font_host.h" | 17 #include "content/renderer/pepper/pepper_truetype_font_host.h" |
17 #include "content/renderer/pepper/pepper_url_loader_host.h" | 18 #include "content/renderer/pepper/pepper_url_loader_host.h" |
18 #include "content/renderer/pepper/pepper_video_capture_host.h" | 19 #include "content/renderer/pepper/pepper_video_capture_host.h" |
19 #include "content/renderer/pepper/pepper_video_destination_host.h" | 20 #include "content/renderer/pepper/pepper_video_destination_host.h" |
20 #include "content/renderer/pepper/pepper_video_source_host.h" | 21 #include "content/renderer/pepper/pepper_video_source_host.h" |
21 #include "content/renderer/pepper/pepper_websocket_host.h" | 22 #include "content/renderer/pepper/pepper_websocket_host.h" |
22 #include "content/renderer/pepper/renderer_ppapi_host_impl.h" | 23 #include "content/renderer/pepper/renderer_ppapi_host_impl.h" |
23 #include "ppapi/host/resource_host.h" | 24 #include "ppapi/host/resource_host.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
68 | 69 |
69 // Make sure the plugin is giving us a valid instance for this resource. | 70 // Make sure the plugin is giving us a valid instance for this resource. |
70 if (!host_->IsValidInstance(instance)) | 71 if (!host_->IsValidInstance(instance)) |
71 return scoped_ptr<ResourceHost>(); | 72 return scoped_ptr<ResourceHost>(); |
72 | 73 |
73 // Public interfaces. | 74 // Public interfaces. |
74 switch (message.type()) { | 75 switch (message.type()) { |
75 case PpapiHostMsg_FileIO_Create::ID: | 76 case PpapiHostMsg_FileIO_Create::ID: |
76 return scoped_ptr<ResourceHost>(new PepperFileIOHost( | 77 return scoped_ptr<ResourceHost>(new PepperFileIOHost( |
77 host_, instance, params.pp_resource())); | 78 host_, instance, params.pp_resource())); |
79 case PpapiHostMsg_FileRef_CreateInternal::ID: { | |
80 PP_Resource file_system; | |
81 std::string internal_path; | |
82 if (!UnpackMessage<PpapiHostMsg_FileRef_CreateInternal>( | |
83 message, &file_system, &internal_path)) { | |
dmichael (off chromium)
2013/09/03 22:34:50
nit: should this be indented another 4?
teravest
2013/09/04 14:46:25
I don't think so.
However, I'm able to barely fit
dmichael (off chromium)
2013/09/04 17:23:54
That works for me. (But if that hadn't worked, I t
| |
84 NOTREACHED(); | |
85 return scoped_ptr<ResourceHost>(); | |
86 } | |
87 return scoped_ptr<ResourceHost>(new PepperFileRefRendererHost( | |
88 host_, instance, params.pp_resource(), file_system, internal_path)); | |
89 } | |
78 case PpapiHostMsg_FileSystem_Create::ID: { | 90 case PpapiHostMsg_FileSystem_Create::ID: { |
79 PP_FileSystemType file_system_type; | 91 PP_FileSystemType file_system_type; |
80 if (!UnpackMessage<PpapiHostMsg_FileSystem_Create>(message, | 92 if (!UnpackMessage<PpapiHostMsg_FileSystem_Create>(message, |
81 &file_system_type)) { | 93 &file_system_type)) { |
82 NOTREACHED(); | 94 NOTREACHED(); |
83 return scoped_ptr<ResourceHost>(); | 95 return scoped_ptr<ResourceHost>(); |
84 } | 96 } |
85 return scoped_ptr<ResourceHost>(new PepperFileSystemHost( | 97 return scoped_ptr<ResourceHost>(new PepperFileSystemHost( |
86 host_, instance, params.pp_resource(), file_system_type)); | 98 host_, instance, params.pp_resource(), file_system_type)); |
87 } | 99 } |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
156 | 168 |
157 return scoped_ptr<ResourceHost>(); | 169 return scoped_ptr<ResourceHost>(); |
158 } | 170 } |
159 | 171 |
160 const ppapi::PpapiPermissions& | 172 const ppapi::PpapiPermissions& |
161 ContentRendererPepperHostFactory::GetPermissions() const { | 173 ContentRendererPepperHostFactory::GetPermissions() const { |
162 return host_->GetPpapiHost()->permissions(); | 174 return host_->GetPpapiHost()->permissions(); |
163 } | 175 } |
164 | 176 |
165 } // namespace content | 177 } // namespace content |
OLD | NEW |