$OpenBSD: patch-chrome_renderer_webplugin_delegate_pepper_cc,v 1.2 2011/02/08 09:43:02 espie Exp $
--- chrome/renderer/webplugin_delegate_pepper.cc.orig	Fri Jan 21 10:20:27 2011
+++ chrome/renderer/webplugin_delegate_pepper.cc	Sun Jan 23 23:27:34 2011
@@ -9,7 +9,7 @@
 #include <string>
 #include <vector>
 
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_OPENBSD)
 #include <unistd.h>
 #endif
 
@@ -39,7 +39,7 @@
 #include "chrome/renderer/pepper_widget.h"
 #include "chrome/renderer/render_thread.h"
 #include "chrome/renderer/render_view.h"
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_OPENBSD)
 #include "chrome/renderer/renderer_sandbox_support_linux.h"
 #endif
 #include "chrome/renderer/webplugin_delegate_proxy.h"
@@ -463,7 +463,7 @@ bool WebPluginDelegatePepper::SetCursor(NPCursorType t
 NPError NPMatchFontWithFallback(NPP instance,
                                 const NPFontDescription* description,
                                 NPFontID* id) {
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_OPENBSD)
   int fd = renderer_sandbox_support::MatchFontWithFallback(
       description->face, description->weight >= 700, description->italic,
       description->charset);
@@ -482,7 +482,7 @@ NPError GetFontTable(NPP instance,
                      uint32_t table,
                      void* output,
                      size_t* output_length) {
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_OPENBSD)
   bool rv = renderer_sandbox_support::GetFontTable(
       id, table, static_cast<uint8_t*>(output), output_length);
   return rv ? NPERR_NO_ERROR : NPERR_GENERIC_ERROR;
@@ -493,7 +493,7 @@ NPError GetFontTable(NPP instance,
 }
 
 NPError NPDestroyFont(NPP instance, NPFontID id) {
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_OPENBSD)
   close(id);
   return NPERR_NO_ERROR;
 #else
@@ -1169,10 +1169,10 @@ int WebPluginDelegatePepper::PrintBegin(const gfx::Rec
       current_printer_dpi_ = printer_dpi;
     }
   }
-#if defined (OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_OPENBSD)
   num_pages_ = num_pages;
   pdf_output_done_ = false;
-#endif  // (OS_LINUX)
+#endif  // OS_LINUX || OS_OPENBSD
   return num_pages;
 }
 
@@ -1198,7 +1198,7 @@ bool WebPluginDelegatePepper::VectorPrintPage(int page
   unsigned char* pdf_output = NULL;
   int32 output_size = 0;
   NPPrintPageNumberRange page_range;
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_OPENBSD)
   // On Linux we will try and output all pages as PDF in the first call to
   // PrintPage. This is a temporary hack.
   // TODO(sanjeevr): Remove this hack and fix this by changing the print
@@ -1207,9 +1207,9 @@ bool WebPluginDelegatePepper::VectorPrintPage(int page
     return pdf_output_done_;
   page_range.firstPageNumber = 0;
   page_range.lastPageNumber = num_pages_ - 1;
-#else  // defined(OS_LINUX)
+#else  // defined(OS_LINUX) || defined(OS_OPENBSD)
   page_range.firstPageNumber = page_range.lastPageNumber = page_number;
-#endif  // defined(OS_LINUX)
+#endif  // defined(OS_LINUX) || defined(OS_OPENBSD)
   NPError err = print_extensions->printPagesAsPDF(instance()->npp(),
                                                   &page_range, 1,
                                                   &pdf_output, &output_size);
@@ -1217,7 +1217,7 @@ bool WebPluginDelegatePepper::VectorPrintPage(int page
     return false;
 
   bool ret = false;
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_OPENBSD)
   // On Linux we need to get the backing PdfPsMetafile and write the bits
   // directly.
   cairo_t* context = canvas->beginPlatformPaint();
@@ -1370,10 +1370,10 @@ void WebPluginDelegatePepper::PrintEnd() {
   current_printer_dpi_ = -1;
 #if defined(OS_MACOSX)
   last_printed_page_ = SkBitmap();
-#elif defined(OS_LINUX)
+#elif defined(OS_LINUX) || defined(OS_OPENBSD)
   num_pages_ = 0;
   pdf_output_done_ = false;
-#endif  // defined(OS_LINUX)
+#endif  // defined(OS_LINUX) || defined(OS_OPENBSD)
 }
 
 WebPluginDelegatePepper::WebPluginDelegatePepper(
@@ -1384,10 +1384,10 @@ WebPluginDelegatePepper::WebPluginDelegatePepper(
       instance_(instance),
       nested_delegate_(NULL),
       current_printer_dpi_(-1),
-#if defined (OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_OPENBSD)
       num_pages_(0),
       pdf_output_done_(false),
-#endif  // (OS_LINUX)
+#endif  // OS_LINUX || OS_OPENBSD
 #if defined(ENABLE_GPU)
       command_buffer_(NULL),
       method_factory3d_(ALLOW_THIS_IN_INITIALIZER_LIST(this)),
