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

Side by Side Diff: content/renderer/pepper/pepper_plugin_instance_impl.cc

Issue 61813003: Allow PPB_ImageData_Impl to be created in a way that is compatible with unittests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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) 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_plugin_instance_impl.h" 5 #include "content/renderer/pepper/pepper_plugin_instance_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback_helpers.h" 8 #include "base/callback_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 2738 matching lines...) Expand 10 before | Expand all | Expand 10 after
2749 2749
2750 PP_Resource PepperPluginInstanceImpl::CreateImage(gfx::ImageSkia* source_image, 2750 PP_Resource PepperPluginInstanceImpl::CreateImage(gfx::ImageSkia* source_image,
2751 float scale) { 2751 float scale) {
2752 gfx::ImageSkiaRep image_skia_rep = source_image->GetRepresentation(scale); 2752 gfx::ImageSkiaRep image_skia_rep = source_image->GetRepresentation(scale);
2753 2753
2754 if (image_skia_rep.is_null() || image_skia_rep.scale() != scale) 2754 if (image_skia_rep.is_null() || image_skia_rep.scale() != scale)
2755 return 0; 2755 return 0;
2756 2756
2757 scoped_refptr<PPB_ImageData_Impl> image_data(new PPB_ImageData_Impl( 2757 scoped_refptr<PPB_ImageData_Impl> image_data(new PPB_ImageData_Impl(
2758 pp_instance(), 2758 pp_instance(),
2759 PPB_ImageData_Impl::PLATFORM)); 2759 PPB_ImageData_Impl::PLATFORM,
2760 PPB_ImageData_Impl::IsBrowserAllocated(PPB_ImageData_Impl::PLATFORM)));
2760 if (!image_data->Init( 2761 if (!image_data->Init(
2761 PPB_ImageData_Impl::GetNativeImageDataFormat(), 2762 PPB_ImageData_Impl::GetNativeImageDataFormat(),
2762 image_skia_rep.pixel_width(), 2763 image_skia_rep.pixel_width(),
2763 image_skia_rep.pixel_height(), 2764 image_skia_rep.pixel_height(),
2764 false)) { 2765 false)) {
2765 return 0; 2766 return 0;
2766 } 2767 }
2767 2768
2768 ImageDataAutoMapper mapper(image_data.get()); 2769 ImageDataAutoMapper mapper(image_data.get());
2769 if (!mapper.is_valid()) 2770 if (!mapper.is_valid())
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
3049 // Running out-of-process. Initiate an IPC call to notify the plugin 3050 // Running out-of-process. Initiate an IPC call to notify the plugin
3050 // process. 3051 // process.
3051 ppapi::proxy::HostDispatcher* dispatcher = 3052 ppapi::proxy::HostDispatcher* dispatcher =
3052 ppapi::proxy::HostDispatcher::GetForInstance(pp_instance()); 3053 ppapi::proxy::HostDispatcher::GetForInstance(pp_instance());
3053 dispatcher->Send(new PpapiMsg_PPPInstance_HandleDocumentLoad( 3054 dispatcher->Send(new PpapiMsg_PPPInstance_HandleDocumentLoad(
3054 ppapi::API_ID_PPP_INSTANCE, pp_instance(), pending_host_id, data)); 3055 ppapi::API_ID_PPP_INSTANCE, pp_instance(), pending_host_id, data));
3055 } 3056 }
3056 } 3057 }
3057 3058
3058 } // namespace content 3059 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698