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/pepper_in_process_resource_creation.h" | 5 #include "content/renderer/pepper/pepper_in_process_resource_creation.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
11 #include "content/renderer/pepper/pepper_in_process_router.h" | 11 #include "content/renderer/pepper/pepper_in_process_router.h" |
12 #include "content/renderer/pepper/renderer_ppapi_host_impl.h" | 12 #include "content/renderer/pepper/renderer_ppapi_host_impl.h" |
13 #include "content/renderer/render_view_impl.h" | 13 #include "content/renderer/render_view_impl.h" |
14 #include "ipc/ipc_message.h" | 14 #include "ipc/ipc_message.h" |
15 #include "ipc/ipc_message_macros.h" | 15 #include "ipc/ipc_message_macros.h" |
16 #include "ppapi/host/ppapi_host.h" | 16 #include "ppapi/host/ppapi_host.h" |
17 #include "ppapi/proxy/browser_font_resource_trusted.h" | 17 #include "ppapi/proxy/browser_font_resource_trusted.h" |
| 18 #include "ppapi/proxy/ext_crx_file_system_private_resource.h" |
18 #include "ppapi/proxy/file_chooser_resource.h" | 19 #include "ppapi/proxy/file_chooser_resource.h" |
19 #include "ppapi/proxy/file_io_resource.h" | 20 #include "ppapi/proxy/file_io_resource.h" |
20 #include "ppapi/proxy/file_system_resource.h" | 21 #include "ppapi/proxy/file_system_resource.h" |
21 #include "ppapi/proxy/graphics_2d_resource.h" | 22 #include "ppapi/proxy/graphics_2d_resource.h" |
22 #include "ppapi/proxy/ppapi_messages.h" | 23 #include "ppapi/proxy/ppapi_messages.h" |
23 #include "ppapi/proxy/printing_resource.h" | 24 #include "ppapi/proxy/printing_resource.h" |
24 #include "ppapi/proxy/url_request_info_resource.h" | 25 #include "ppapi/proxy/url_request_info_resource.h" |
25 #include "ppapi/proxy/url_response_info_resource.h" | 26 #include "ppapi/proxy/url_response_info_resource.h" |
26 #include "ppapi/proxy/websocket_resource.h" | 27 #include "ppapi/proxy/websocket_resource.h" |
27 #include "ppapi/shared_impl/ppapi_globals.h" | 28 #include "ppapi/shared_impl/ppapi_globals.h" |
(...skipping 28 matching lines...) Expand all Loading... |
56 return 0; | 57 return 0; |
57 ppapi::Preferences prefs( | 58 ppapi::Preferences prefs( |
58 host_impl_->GetRenderViewForInstance(instance)->GetWebkitPreferences()); | 59 host_impl_->GetRenderViewForInstance(instance)->GetWebkitPreferences()); |
59 return (new ppapi::proxy::BrowserFontResource_Trusted( | 60 return (new ppapi::proxy::BrowserFontResource_Trusted( |
60 host_impl_->in_process_router()->GetPluginConnection(), | 61 host_impl_->in_process_router()->GetPluginConnection(), |
61 instance, | 62 instance, |
62 *description, | 63 *description, |
63 prefs))->GetReference(); | 64 prefs))->GetReference(); |
64 } | 65 } |
65 | 66 |
| 67 PP_Resource PepperInProcessResourceCreation::CreateExtCrxFileSystemPrivate( |
| 68 PP_Instance instance) { |
| 69 NOTIMPLEMENTED(); // no need to support in-process |
| 70 return 0; |
| 71 } |
| 72 |
66 PP_Resource PepperInProcessResourceCreation::CreateFileChooser( | 73 PP_Resource PepperInProcessResourceCreation::CreateFileChooser( |
67 PP_Instance instance, | 74 PP_Instance instance, |
68 PP_FileChooserMode_Dev mode, | 75 PP_FileChooserMode_Dev mode, |
69 const PP_Var& accept_types) { | 76 const PP_Var& accept_types) { |
70 scoped_refptr<ppapi::StringVar> string_var = | 77 scoped_refptr<ppapi::StringVar> string_var = |
71 ppapi::StringVar::FromPPVar(accept_types); | 78 ppapi::StringVar::FromPPVar(accept_types); |
72 std::string str = string_var ? string_var->value() : std::string(); | 79 std::string str = string_var ? string_var->value() : std::string(); |
73 return (new ppapi::proxy::FileChooserResource( | 80 return (new ppapi::proxy::FileChooserResource( |
74 host_impl_->in_process_router()->GetPluginConnection(), | 81 host_impl_->in_process_router()->GetPluginConnection(), |
75 instance, mode, str.c_str()))->GetReference(); | 82 instance, mode, str.c_str()))->GetReference(); |
76 } | 83 } |
77 | 84 |
78 PP_Resource PepperInProcessResourceCreation::CreateFileIO( | 85 PP_Resource PepperInProcessResourceCreation::CreateFileIO( |
79 PP_Instance instance) { | 86 PP_Instance instance) { |
80 return (new ppapi::proxy::FileIOResource( | 87 return (new ppapi::proxy::FileIOResource( |
81 host_impl_->in_process_router()->GetPluginConnection(), | 88 host_impl_->in_process_router()->GetPluginConnection(), |
82 instance))->GetReference(); | 89 instance))->GetReference(); |
83 } | 90 } |
84 | 91 |
85 PP_Resource PepperInProcessResourceCreation::CreateFileSystem( | 92 PP_Resource PepperInProcessResourceCreation::CreateFileSystem( |
86 PP_Instance instance, | 93 PP_Instance instance, |
87 PP_FileSystemType type) { | 94 PP_FileSystemType type) { |
88 return (new ppapi::proxy::FileSystemResource( | 95 return (new ppapi::proxy::FileSystemResource( |
89 host_impl_->in_process_router()->GetPluginConnection(), | 96 host_impl_->in_process_router()->GetPluginConnection(), |
90 instance, type))->GetReference(); | 97 instance, type))->GetReference(); |
91 } | 98 } |
92 | 99 |
| 100 PP_Resource PepperInProcessResourceCreation::CreateIsolatedFileSystem( |
| 101 PP_Instance instance, |
| 102 const char* fsid) { |
| 103 NOTIMPLEMENTED(); // no need to support in-process |
| 104 return 0; |
| 105 } |
| 106 |
93 PP_Resource PepperInProcessResourceCreation::CreateGraphics2D( | 107 PP_Resource PepperInProcessResourceCreation::CreateGraphics2D( |
94 PP_Instance instance, | 108 PP_Instance instance, |
95 const PP_Size& size, | 109 const PP_Size& size, |
96 PP_Bool is_always_opaque) { | 110 PP_Bool is_always_opaque) { |
97 return (new ppapi::proxy::Graphics2DResource( | 111 return (new ppapi::proxy::Graphics2DResource( |
98 host_impl_->in_process_router()->GetPluginConnection(), | 112 host_impl_->in_process_router()->GetPluginConnection(), |
99 instance, size, is_always_opaque))->GetReference(); | 113 instance, size, is_always_opaque))->GetReference(); |
100 } | 114 } |
101 | 115 |
102 PP_Resource PepperInProcessResourceCreation::CreatePrinting( | 116 PP_Resource PepperInProcessResourceCreation::CreatePrinting( |
(...skipping 27 matching lines...) Expand all Loading... |
130 } | 144 } |
131 | 145 |
132 PP_Resource PepperInProcessResourceCreation::CreateWebSocket( | 146 PP_Resource PepperInProcessResourceCreation::CreateWebSocket( |
133 PP_Instance instance) { | 147 PP_Instance instance) { |
134 return (new ppapi::proxy::WebSocketResource( | 148 return (new ppapi::proxy::WebSocketResource( |
135 host_impl_->in_process_router()->GetPluginConnection(), | 149 host_impl_->in_process_router()->GetPluginConnection(), |
136 instance))->GetReference(); | 150 instance))->GetReference(); |
137 } | 151 } |
138 | 152 |
139 } // namespace content | 153 } // namespace content |
OLD | NEW |