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

Side by Side Diff: webkit/plugins/ppapi/resource_creation_impl.cc

Issue 7706021: Convert FileRefImpl and URLRequestInfo to shared_impl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Tests fixed Created 9 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "webkit/plugins/ppapi/resource_creation_impl.h" 5 #include "webkit/plugins/ppapi/resource_creation_impl.h"
6 6
7 #include "ppapi/c/pp_size.h" 7 #include "ppapi/c/pp_size.h"
8 #include "ppapi/shared_impl/audio_config_impl.h" 8 #include "ppapi/shared_impl/audio_config_impl.h"
9 #include "ppapi/shared_impl/input_event_impl.h" 9 #include "ppapi/shared_impl/input_event_impl.h"
10 #include "ppapi/shared_impl/var.h" 10 #include "ppapi/shared_impl/var.h"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 const PP_Var& accept_mime_types) { 111 const PP_Var& accept_mime_types) {
112 return PPB_FileChooser_Impl::Create(instance, mode, accept_mime_types); 112 return PPB_FileChooser_Impl::Create(instance, mode, accept_mime_types);
113 } 113 }
114 114
115 PP_Resource ResourceCreationImpl::CreateFileIO(PP_Instance instance) { 115 PP_Resource ResourceCreationImpl::CreateFileIO(PP_Instance instance) {
116 return (new PPB_FileIO_Impl(instance))->GetReference(); 116 return (new PPB_FileIO_Impl(instance))->GetReference();
117 } 117 }
118 118
119 PP_Resource ResourceCreationImpl::CreateFileRef(PP_Resource file_system, 119 PP_Resource ResourceCreationImpl::CreateFileRef(PP_Resource file_system,
120 const char* path) { 120 const char* path) {
121 return PPB_FileRef_Impl::Create(file_system, path); 121 PPB_FileRef_Impl* res = PPB_FileRef_Impl::CreateInternal(file_system, path);
122 return res ? res->GetReference() : 0;
122 } 123 }
123 124
124 PP_Resource ResourceCreationImpl::CreateFileSystem( 125 PP_Resource ResourceCreationImpl::CreateFileSystem(
125 PP_Instance instance, 126 PP_Instance instance,
126 PP_FileSystemType type) { 127 PP_FileSystemType type) {
127 return PPB_FileSystem_Impl::Create(instance, type); 128 return PPB_FileSystem_Impl::Create(instance, type);
128 } 129 }
129 130
130 PP_Resource ResourceCreationImpl::CreateFlashMenu( 131 PP_Resource ResourceCreationImpl::CreateFlashMenu(
131 PP_Instance instance, 132 PP_Instance instance,
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 PP_Resource ResourceCreationImpl::CreateTransport(PP_Instance instance, 250 PP_Resource ResourceCreationImpl::CreateTransport(PP_Instance instance,
250 const char* name, 251 const char* name,
251 const char* proto) { 252 const char* proto) {
252 return PPB_Transport_Impl::Create(instance, name, proto); 253 return PPB_Transport_Impl::Create(instance, name, proto);
253 } 254 }
254 255
255 PP_Resource ResourceCreationImpl::CreateURLLoader(PP_Instance instance) { 256 PP_Resource ResourceCreationImpl::CreateURLLoader(PP_Instance instance) {
256 return (new PPB_URLLoader_Impl(instance, false))->GetReference(); 257 return (new PPB_URLLoader_Impl(instance, false))->GetReference();
257 } 258 }
258 259
259 PP_Resource ResourceCreationImpl::CreateURLRequestInfo(PP_Instance instance) { 260 PP_Resource ResourceCreationImpl::CreateURLRequestInfo(
260 return (new PPB_URLRequestInfo_Impl(instance))->GetReference(); 261 PP_Instance instance,
262 const ::ppapi::PPB_URLRequestInfo_Data& data) {
263 return (new PPB_URLRequestInfo_Impl(instance, data))->GetReference();
261 } 264 }
262 265
263 PP_Resource ResourceCreationImpl::CreateVideoCapture(PP_Instance instance) { 266 PP_Resource ResourceCreationImpl::CreateVideoCapture(PP_Instance instance) {
264 scoped_refptr<PPB_VideoCapture_Impl> video_capture = 267 scoped_refptr<PPB_VideoCapture_Impl> video_capture =
265 new PPB_VideoCapture_Impl(instance); 268 new PPB_VideoCapture_Impl(instance);
266 if (!video_capture->Init()) 269 if (!video_capture->Init())
267 return 0; 270 return 0;
268 return video_capture->GetReference(); 271 return video_capture->GetReference();
269 } 272 }
270 273
(...skipping 23 matching lines...) Expand all
294 data.wheel_delta = *wheel_delta; 297 data.wheel_delta = *wheel_delta;
295 data.wheel_ticks = *wheel_ticks; 298 data.wheel_ticks = *wheel_ticks;
296 data.wheel_scroll_by_page = PP_ToBool(scroll_by_page); 299 data.wheel_scroll_by_page = PP_ToBool(scroll_by_page);
297 300
298 return (new InputEventImpl(InputEventImpl::InitAsImpl(), 301 return (new InputEventImpl(InputEventImpl::InitAsImpl(),
299 instance, data))->GetReference(); 302 instance, data))->GetReference();
300 } 303 }
301 304
302 } // namespace ppapi 305 } // namespace ppapi
303 } // namespace webkit 306 } // namespace webkit
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698