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

Side by Side Diff: chrome/renderer/pepper/ppb_pdf_impl.cc

Issue 10790063: PPAPI/NaCl: Make ImageData for NaCl just use shared memory (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: make PPB_ImageData_API base non-exported Created 8 years, 4 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
« no previous file with comments | « no previous file | ppapi/proxy/ppapi_messages.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "chrome/renderer/pepper/ppb_pdf_impl.h" 5 #include "chrome/renderer/pepper/ppb_pdf_impl.h"
6 6
7 #include "base/metrics/histogram.h" 7 #include "base/metrics/histogram.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "chrome/common/render_messages.h" 10 #include "chrome/common/render_messages.h"
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 if (res_id == 0) 163 if (res_id == 0)
164 return 0; 164 return 0;
165 165
166 SkBitmap* res_bitmap = 166 SkBitmap* res_bitmap =
167 ResourceBundle::GetSharedInstance().GetBitmapNamed(res_id); 167 ResourceBundle::GetSharedInstance().GetBitmapNamed(res_id);
168 168
169 // Validate the instance. 169 // Validate the instance.
170 if (!content::GetHostGlobals()->GetInstance(instance_id)) 170 if (!content::GetHostGlobals()->GetInstance(instance_id))
171 return 0; 171 return 0;
172 scoped_refptr<webkit::ppapi::PPB_ImageData_Impl> image_data( 172 scoped_refptr<webkit::ppapi::PPB_ImageData_Impl> image_data(
173 new webkit::ppapi::PPB_ImageData_Impl(instance_id)); 173 new webkit::ppapi::PPB_ImageData_Impl(
174 instance_id,
175 webkit::ppapi::PPB_ImageData_Impl::PLATFORM));
174 if (!image_data->Init( 176 if (!image_data->Init(
175 webkit::ppapi::PPB_ImageData_Impl::GetNativeImageDataFormat(), 177 webkit::ppapi::PPB_ImageData_Impl::GetNativeImageDataFormat(),
176 res_bitmap->width(), res_bitmap->height(), false)) { 178 res_bitmap->width(), res_bitmap->height(), false)) {
177 return 0; 179 return 0;
178 } 180 }
179 181
180 webkit::ppapi::ImageDataAutoMapper mapper(image_data); 182 webkit::ppapi::ImageDataAutoMapper mapper(image_data);
181 if (!mapper.is_valid()) 183 if (!mapper.is_valid())
182 return 0; 184 return 0;
183 185
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 381
380 WebKit::WebElement element = instance->container()->element(); 382 WebKit::WebElement element = instance->container()->element();
381 WebKit::WebView* view = element.document().frame()->view(); 383 WebKit::WebView* view = element.document().frame()->view();
382 content::RenderView* render_view = content::RenderView::FromWebView(view); 384 content::RenderView* render_view = content::RenderView::FromWebView(view);
383 385
384 PrintWebViewHelper* print_view_helper = PrintWebViewHelper::Get(render_view); 386 PrintWebViewHelper* print_view_helper = PrintWebViewHelper::Get(render_view);
385 if (print_view_helper) 387 if (print_view_helper)
386 print_view_helper->PrintNode(element); 388 print_view_helper->PrintNode(element);
387 #endif 389 #endif
388 } 390 }
OLDNEW
« no previous file with comments | « no previous file | ppapi/proxy/ppapi_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698