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

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

Issue 13529027: Switch Linux Auru ports over to POSIX SHM instead of legacy SYSV SHM. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 7 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 | content/browser/renderer_host/render_message_filter.cc » ('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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/pepper_pdf_host.h" 5 #include "chrome/renderer/pepper/pepper_pdf_host.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/common/render_messages.h" 8 #include "chrome/common/render_messages.h"
9 #include "chrome/renderer/printing/print_web_view_helper.h" 9 #include "chrome/renderer/printing/print_web_view_helper.h"
10 #include "content/public/renderer/render_thread.h" 10 #include "content/public/renderer/render_thread.h"
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 &image_data_desc, 311 &image_data_desc,
312 &image_handle, 312 &image_handle,
313 &byte_count); 313 &byte_count);
314 ppapi::ScopedPPResource image_data_resource( 314 ppapi::ScopedPPResource image_data_resource(
315 ppapi::ScopedPPResource::PassRef(), host_resource.host_resource()); 315 ppapi::ScopedPPResource::PassRef(), host_resource.host_resource());
316 if (!success) 316 if (!success)
317 return PP_ERROR_FAILED; 317 return PP_ERROR_FAILED;
318 318
319 ppapi::host::ReplyMessageContext reply_context = 319 ppapi::host::ReplyMessageContext reply_context =
320 context->MakeReplyMessageContext(); 320 context->MakeReplyMessageContext();
321 #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_ANDROID) 321 #if defined(TOOLKIT_GTK)
322 // For GTK, we pass the SysV shared memory key in the message.
323 PpapiPluginMsg_PDF_GetResourceImageReply reply_msg(host_resource,
324 image_data_desc,
325 image_handle.fd);
326 #elif defined(OS_POSIX) || defined(OS_WIN)
322 ppapi::proxy::SerializedHandle serialized_handle; 327 ppapi::proxy::SerializedHandle serialized_handle;
323 PpapiPluginMsg_PDF_GetResourceImageReply reply_msg(host_resource, 328 PpapiPluginMsg_PDF_GetResourceImageReply reply_msg(host_resource,
324 image_data_desc, 329 image_data_desc,
325 0); 330 0);
326 serialized_handle.set_shmem(image_handle, byte_count); 331 serialized_handle.set_shmem(image_handle, byte_count);
327 reply_context.params.AppendHandle(serialized_handle); 332 reply_context.params.AppendHandle(serialized_handle);
328 #elif defined(OS_LINUX)
329 // For Linux, we pass the SysV shared memory key in the message.
330 PpapiPluginMsg_PDF_GetResourceImageReply reply_msg(host_resource,
331 image_data_desc,
332 image_handle.fd);
333 #else 333 #else
334 // Not supported on the other platforms. 334 // Not supported on the other platforms.
335 // This is a stub reply_msg not to break the build. 335 // This is a stub reply_msg not to break the build.
336 PpapiPluginMsg_PDF_GetResourceImageReply reply_msg(host_resource, 336 PpapiPluginMsg_PDF_GetResourceImageReply reply_msg(host_resource,
337 image_data_desc, 337 image_data_desc,
338 0); 338 0);
339 NOTIMPLEMENTED(); 339 NOTIMPLEMENTED();
340 return PP_ERROR_NOTSUPPORTED; 340 return PP_ERROR_NOTSUPPORTED;
341 #endif 341 #endif
342 342
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 386
387 skia::PlatformCanvas* canvas = image_data->GetPlatformCanvas(); 387 skia::PlatformCanvas* canvas = image_data->GetPlatformCanvas();
388 // Note: Do not skBitmap::copyTo the canvas bitmap directly because it will 388 // Note: Do not skBitmap::copyTo the canvas bitmap directly because it will
389 // ignore the allocated pixels in shared memory and re-allocate a new buffer. 389 // ignore the allocated pixels in shared memory and re-allocate a new buffer.
390 canvas->writePixels(pixels_to_write, 0, 0); 390 canvas->writePixels(pixels_to_write, 0, 0);
391 391
392 return true; 392 return true;
393 } 393 }
394 394
395 } // namespace chrome 395 } // namespace chrome
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/render_message_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698