Index: src/media/base/yuv_row.h
===================================================================
--- media/base/yuv_row.h	(revision 42139)
+++ media/base/yuv_row.h	(working copy)
@@ -64,7 +64,7 @@
 
 #if !defined(USE_MMX)
 // Windows, Mac and Linux use MMX
-#if defined(ARCH_CPU_X86) || (defined(ARCH_CPU_X86_64) && defined(OS_LINUX))
+#if defined(ARCH_CPU_X86) || (defined(ARCH_CPU_X86_64) && defined(OS_NIX))
 #define USE_MMX 1
 #else
 #define USE_MMX 0
Index: src/media/base/media_switches.h
===================================================================
--- media/base/media_switches.h	(revision 42139)
+++ media/base/media_switches.h	(working copy)
@@ -11,7 +11,7 @@
 
 namespace switches {
 
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
 extern const char kAlsaDevice[];
 #endif
 
Index: src/media/base/media_switches.cc
===================================================================
--- media/base/media_switches.cc	(revision 42139)
+++ media/base/media_switches.cc	(working copy)
@@ -6,7 +6,7 @@
 
 namespace switches {
 
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
 // The Alsa device to use when opening an audio stream.
 const char kAlsaDevice[] = "alsa-device";
 #endif
Index: src/media/media.gyp
===================================================================
--- media/media.gyp	(revision 42139)
+++ media/media.gyp	(working copy)
@@ -32,6 +32,8 @@
         'audio/linux/alsa_output.h',
         'audio/linux/alsa_wrapper.cc',
         'audio/linux/alsa_wrapper.h',
+        'audio/openbsd/audio_manager_openbsd.cc',
+        'audio/openbsd/audio_manager_openbsd.h',
         'audio/mac/audio_manager_mac.cc',
         'audio/mac/audio_manager_mac.h',
         'audio/mac/audio_output_mac.cc',
@@ -131,13 +133,22 @@
         ],
       },
       'conditions': [
-        ['OS =="linux"', {
+        ['OS =="linux" or OS=="freebsd"', {
           'link_settings': {
             'libraries': [
               '-lasound',
             ],
           },
         }],
+        ['OS =="openbsd"', {
+          'sources/': [ ['exclude', 'alsa_' ],
+                        ['exclude', 'audio_manager_linux' ],
+                        ['exclude', '\\.mm?$' ] ],
+          'link_settings': {
+            'libraries': [
+            ],
+          },
+        }],
         ['OS =="mac"', {
           'link_settings': {
             'libraries': [
@@ -166,7 +177,7 @@
       ],
       'sources': [
         'audio/audio_util_unittest.cc',
-        'audio/linux/alsa_output_unittest.cc',
+        'audio/linux/alsa_output_unittest.cc'
         'audio/mac/audio_output_mac_unittest.cc',
         'audio/simple_sources_unittest.cc',
         'audio/win/audio_output_win_unittest.cc',
@@ -203,7 +214,7 @@
         'omx/omx_input_buffer_unittest.cc',
       ],
       'conditions': [
-        ['OS=="linux" or OS=="freebsd" or OS=="solaris"', {
+        ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"', {
           'dependencies': [
             # Needed for the following #include chain:
             #   base/run_all_unittests.cc
@@ -292,7 +303,7 @@
         '../testing/gtest.gyp:gtest',
       ],
       'conditions': [
-        ['OS=="linux" or OS=="freebsd" or OS=="solaris"', {
+        ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"', {
           'dependencies': [
             '../build/linux/system.gyp:gtk',
           ],
@@ -362,7 +373,7 @@
         },
       ],
     }],
-    ['OS=="linux"', {
+    ['OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
       'targets': [
         {
           'target_name': 'player_x11',
Index: src/app/surface/transport_dib_linux.cc
===================================================================
--- app/surface/transport_dib_linux.cc	(revision 42139)
+++ app/surface/transport_dib_linux.cc	(working copy)
@@ -27,6 +27,9 @@
 TransportDIB::~TransportDIB() {
   if (address_ != kInvalidAddress) {
     shmdt(address_);
+#if defined(OS_OPENBSD)
+    shmctl(key_, IPC_RMID, 0);
+#endif
     address_ = kInvalidAddress;
   }
 
@@ -52,7 +55,13 @@
   // Here we mark the shared memory for deletion. Since we attached it in the
   // line above, it doesn't actually get deleted but, if we crash, this means
   // that the kernel will automatically clean it up for us.
+#if !defined(OS_OPENBSD)
+// BSD: A shmctl IPC_RMID call here renders all future shared memory calls for
+// BSD: a particular key to fail on FreeBSD, so I moved this call to the
+// BSD: destructor.  Of course, this means chromium crashes on FreeBSD don't
+// BSD: clean up shared memory.
   shmctl(shmkey, IPC_RMID, 0);
+#endif
   if (address == kInvalidAddress)
     return NULL;
 
Index: src/webkit/extensions/v8/heap_profiler_extension.cc
===================================================================
--- webkit/extensions/v8/heap_profiler_extension.cc	(revision 42139)
+++ webkit/extensions/v8/heap_profiler_extension.cc	(working copy)
@@ -6,7 +6,7 @@
 
 #include "base/basictypes.h"
 
-#if defined(OS_LINUX) && defined(USE_TCMALLOC)
+#if defined(OS_NIX) && defined(USE_TCMALLOC)
 #include "third_party/tcmalloc/chromium/src/google/heap-profiler.h"
 #endif
 
@@ -60,7 +60,7 @@
     return v8::Handle<v8::FunctionTemplate>();
   }
 
-#if defined(OS_LINUX) && defined(USE_TCMALLOC)
+#if defined(OS_NIX) && defined(USE_TCMALLOC)
   static v8::Handle<v8::Value> HeapProfilerStart(const v8::Arguments& args) {
     if (args.Length() >= 1 && args[0]->IsString()) {
       v8::Local<v8::String> js_prefix = args[0]->ToString();
Index: src/webkit/tools/test_shell/test_shell.gypi
===================================================================
--- webkit/tools/test_shell/test_shell.gypi	(revision 42139)
+++ webkit/tools/test_shell/test_shell.gypi	(working copy)
@@ -503,6 +503,7 @@
       ],
       'include_dirs': [
         '../../..',
+        '/usr/local/include',
       ],
       'dependencies': [
         '<(DEPTH)/third_party/npapi/npapi.gyp:npapi',
@@ -660,7 +661,7 @@
                 ],
               },
             }],
-            ['OS=="linux"', {
+            ['OS=="linux" or OS=="openbsd"', {
               'sources!': [
                 # Needs simple event record type porting
                 '../../glue/plugins/test/plugin_windowless_test.cc',
Index: src/webkit/tools/test_shell/event_sending_controller.cc
===================================================================
--- webkit/tools/test_shell/event_sending_controller.cc	(revision 42139)
+++ webkit/tools/test_shell/event_sending_controller.cc	(working copy)
@@ -159,7 +159,7 @@
     event->modifiers |= WebInputEvent::ShiftKey;
   } else if (!wcscmp(arg_string, L"altKey")) {
     event->modifiers |= WebInputEvent::AltKey;
-#if defined(OS_WIN) || defined(OS_LINUX)
+#if !defined(OS_MACOSX)
     // On Windows all keys with Alt modifier will be marked as system key.
     // We keep the same behavior on Linux, see:
     // third_party/WebKit/WebKit/chromium/src/gtk/WebInputEventFactory.cpp
Index: src/webkit/tools/test_shell/layout_test_controller.cc
===================================================================
--- webkit/tools/test_shell/layout_test_controller.cc	(revision 42139)
+++ webkit/tools/test_shell/layout_test_controller.cc	(working copy)
@@ -448,12 +448,12 @@
   if (shell_) {
     shell_->webView()->setZoomLevel(false, 0);
     shell_->webView()->setTabKeyCyclesThroughElements(true);
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
     // (Constants copied because we can't depend on the header that defined
     // them from this file.)
     shell_->webView()->setSelectionColors(
         0xff1e90ff, 0xff000000, 0xffc8c8c8, 0xff323232);
-#endif  // defined(OS_LINUX)
+#endif  // defined(OS_NIX)
     shell_->webView()->removeAllUserContent();
   }
   dump_as_text_ = false;
Index: src/webkit/tools/pepper_test_plugin/pepper_test_plugin.gyp
===================================================================
--- webkit/tools/pepper_test_plugin/pepper_test_plugin.gyp	(revision 42139)
+++ webkit/tools/pepper_test_plugin/pepper_test_plugin.gyp	(working copy)
@@ -54,7 +54,7 @@
           # it.
           'cflags!': ['-gstabs'],
         }],
-        ['OS=="linux" and (target_arch=="x64" or target_arch=="arm") and linux_fpic!=1', {
+        ['(OS=="linux" or OS=="openbsd") and (target_arch=="x64" or target_arch=="arm") and linux_fpic!=1', {
           'product_name': 'pepper_test_plugin',
           # Shared libraries need -fPIC on x86-64
           'cflags': ['-fPIC'],
Index: src/webkit/tools/pepper_test_plugin/main.cc
===================================================================
--- webkit/tools/pepper_test_plugin/main.cc	(revision 42139)
+++ webkit/tools/pepper_test_plugin/main.cc	(working copy)
@@ -113,7 +113,7 @@
 extern "C" {
 
 EXPORT NPError API_CALL NP_Initialize(NPNetscapeFuncs* browser_funcs
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
                             , NPPluginFuncs* plugin_funcs
 #endif
                             );
@@ -125,7 +125,7 @@
 #endif
 }
 
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
 EXPORT NPError API_CALL NP_GetValue(NPP instance,
                                     NPPVariable variable,
                                     void* value);
@@ -136,7 +136,7 @@
 
 // Plugin entry points
 EXPORT NPError API_CALL NP_Initialize(NPNetscapeFuncs* browser_funcs
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
                             , NPPluginFuncs* plugin_funcs
 #endif
                             ) {
@@ -144,7 +144,7 @@
 #if !defined(INDEPENDENT_PLUGIN)
   pglInitialize();
 #endif
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
   return NP_GetEntryPoints(plugin_funcs);
 #else
   return NPERR_NO_ERROR;
@@ -250,7 +250,7 @@
   NPError err = NPERR_NO_ERROR;
 
   switch (variable) {
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
     case NPPVpluginNameString:
       *((const char**)value) = "Pepper Test PlugIn";
       break;
@@ -282,7 +282,7 @@
   return NPERR_GENERIC_ERROR;
 }
 
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
 NPError API_CALL NP_GetValue(NPP instance, NPPVariable variable, void* value) {
   return NPP_GetValue(instance, variable, value);
 }
Index: src/webkit/glue/webkitclient_impl.cc
===================================================================
--- webkit/glue/webkitclient_impl.cc	(revision 42139)
+++ webkit/glue/webkitclient_impl.cc	(working copy)
@@ -40,7 +40,7 @@
 #include "webkit/glue/websocketstreamhandle_impl.h"
 #include "webkit/glue/weburlloader_impl.h"
 
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
 #include "v8/include/v8.h"
 #endif
 
Index: src/webkit/glue/webkit_resources.grd
===================================================================
--- webkit/glue/webkit_resources.grd	(revision 42139)
+++ webkit/glue/webkit_resources.grd	(working copy)
@@ -27,7 +27,7 @@
       <include name="IDR_MEDIA_SLIDER_THUMB" file="resources\media_slider_thumb.png" type="BINDATA" />
       <include name="IDR_MEDIA_VOLUME_SLIDER_THUMB" file="resources\media_volume_slider_thumb.png" type="BINDATA" />
 
-      <if expr="os == 'linux2' or os == 'freebsd7' or os == 'openbsd4' or os == 'sunos5'">
+      <if expr="os == 'linux2' or os.find('bsd') != -1 or os == 'sunos5'">
         <include name="IDR_LINUX_CHECKBOX_OFF" file="resources\linux-checkbox-off.png" type="BINDATA" />
         <include name="IDR_LINUX_CHECKBOX_ON" file="resources\linux-checkbox-on.png" type="BINDATA" />
         <include name="IDR_LINUX_CHECKBOX_DISABLED_OFF" file="resources\linux-checkbox-disabled-off.png" type="BINDATA" />
Index: src/printing/printing.gyp
===================================================================
--- printing/printing.gyp	(revision 42139)
+++ printing/printing.gyp	(working copy)
@@ -112,16 +112,14 @@
         ['OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
             'dependencies': [
               '../build/linux/system.gyp:gtk',
-           ],
-        }],
-        ['OS=="linux"', {
-          'conditions': [
-            ['linux_use_tcmalloc==1', {
+            ],
+            'conditions': [
+              ['linux_use_tcmalloc==1', {
               'dependencies': [
                 '../base/allocator/allocator.gyp:allocator',
-              ],
-            }],
-          ],
+                ],
+              }],
+            ],
         }],
       ],
     },
Index: src/gpu/gpu.gyp
===================================================================
--- gpu/gpu.gyp	(revision 42139)
+++ gpu/gpu.gyp	(working copy)
@@ -53,7 +53,7 @@
         '../third_party/glew/src/glew.c',
       ],
       'conditions': [
-        [ 'OS=="linux"',
+        [ 'OS=="linux" or OS=="freebsd" or OS=="openbsd"',
           {
             'all_dependent_settings': {
               'defines': [
@@ -260,7 +260,7 @@
         'command_buffer/service/precompile.h',
       ],
       'conditions': [
-        ['OS == "linux"',
+        ['OS == "linux" or OS == "freebsd" or OS == "openbsd"',
           {
             'sources': [
               'command_buffer/service/gpu_processor_linux.cc',
Index: src/net/net.gyp
===================================================================
--- net/net.gyp	(revision 42139)
+++ net/net.gyp	(working copy)
@@ -109,11 +109,9 @@
         'base/net_util_win.cc',
         'base/network_change_notifier.cc',
         'base/network_change_notifier.h',
-        'base/network_change_notifier_linux.cc',
         'base/network_change_notifier_linux.h',
         'base/network_change_notifier_mac.cc',
         'base/network_change_notifier_mac.h',
-        'base/network_change_notifier_netlink_linux.cc',
         'base/network_change_notifier_netlink_linux.h',
         'base/network_change_notifier_win.cc',
         'base/network_change_notifier_win.h',
@@ -526,6 +524,7 @@
             '../build/linux/system.gyp:gdk',
             '../build/linux/system.gyp:nss',
           ],
+          'sources!': [ 'proxy/proxy_config_service_linux.cc', ],
         }],
         [ 'OS == "win"', {
             'sources!': [
@@ -553,7 +552,7 @@
         ],
         [ 'OS == "linux" or OS == "freebsd" or OS == "openbsd"', {
           },
-          {  # else: OS != "linux"
+          {  # else: OS != "linux" and OS != "freebsd"
             'sources!': [
               'ocsp/nss_ocsp.cc',
               'ocsp/nss_ocsp.h',
@@ -668,7 +667,6 @@
         'proxy/init_proxy_resolver_unittest.cc',
         'proxy/mock_proxy_resolver.h',
         'proxy/proxy_bypass_rules_unittest.cc',
-        'proxy/proxy_config_service_linux_unittest.cc',
         'proxy/proxy_config_service_win_unittest.cc',
         'proxy/proxy_config_unittest.cc',
         'proxy/proxy_list_unittest.cc',
@@ -709,7 +707,7 @@
             ],
           },
         ],
-        ['OS == "linux"', {
+        ['OS == "linux" or OS == "freebsd"', {
           'conditions': [
             ['linux_use_tcmalloc==1', {
               'dependencies': [
Index: src/net/socket/tcp_client_socket_libevent.cc
===================================================================
--- net/socket/tcp_client_socket_libevent.cc	(revision 42139)
+++ net/socket/tcp_client_socket_libevent.cc	(working copy)
@@ -9,6 +9,9 @@
 #include <netdb.h>
 #include <sys/socket.h>
 #include <netinet/tcp.h>
+#if defined(OS_OPENBSD)
+#include <netinet/in.h>
+#endif
 
 #include "base/eintr_wrapper.h"
 #include "base/message_loop.h"
Index: src/net/socket/ssl_client_socket_nss.cc
===================================================================
--- net/socket/ssl_client_socket_nss.cc	(revision 42139)
+++ net/socket/ssl_client_socket_nss.cc	(working copy)
@@ -320,7 +320,19 @@
   if (err != OK)
     return err;
   const struct addrinfo* ai = peer_address.head();
+#if defined(OS_OPENBSD)
+//BSD ai_addr is implicitly cast to a PRNetAddr later on in nss_memio.c
+//BSD but it doesn't work on BSD cuz sockaddr is defined differently than on
+//BSD linux.  As a result, I hand unroll the data structure below.
+  PRNetAddr peername;
+  sockaddr_in* sockaccess = (struct sockaddr_in *) ai->ai_addr;
+  peername.inet.family = sockaccess->sin_family;
+  peername.inet.ip     = sockaccess->sin_addr.s_addr;
+  peername.inet.port   = sockaccess->sin_port;
+  memio_SetPeerName(nss_fd_, &peername, ai->ai_addrlen);
+#else
   memio_SetPeerName(nss_fd_, ai->ai_addr, ai->ai_addrlen);
+#endif
 
   // Grab pointer to buffers
   nss_bufs_ = memio_GetSecret(nss_fd_);
Index: src/net/third_party/nss/nss.gyp
===================================================================
--- net/third_party/nss/nss.gyp	(revision 42139)
+++ net/third_party/nss/nss.gyp	(working copy)
@@ -4,7 +4,7 @@
 
 {
   'conditions': [
-    [ 'OS == "linux"', {
+    [ 'OS == "linux" or OS == "freebsd" or OS == "openbsd"', {
       'conditions': [
         ['sysroot!=""', {
           'variables': {
@@ -77,7 +77,7 @@
         'NO_NSPR_10_SUPPORT',
       ],
       'conditions': [
-        [ 'OS == "linux"', {
+        [ 'OS == "linux" or OS == "freebsd" or OS == "openbsd"', {
           'sources!': [
             'ssl/os2_err.c',
             'ssl/os2_err.h',
Index: src/net/tools/hresolv/hresolv.cc
===================================================================
--- net/tools/hresolv/hresolv.cc	(revision 42139)
+++ net/tools/hresolv/hresolv.cc	(working copy)
@@ -50,7 +50,7 @@
   {AI_V4MAPPED, "AI_V4MAPPED"},
   {AI_ALL, "AI_ALL"},
   {AI_ADDRCONFIG, "AI_ADDRCONFIG"},
-#if defined(OS_LINUX) || defined(OS_WIN)
+#if !defined(OS_MACOSX)
   {AI_NUMERICSERV, "AI_NUMERICSERV"},
 #endif
 };
Index: src/net/base/network_change_notifier.cc
===================================================================
--- net/base/network_change_notifier.cc	(revision 42139)
+++ net/base/network_change_notifier.cc	(working copy)
@@ -24,7 +24,6 @@
 #elif defined(OS_MACOSX)
   return new NetworkChangeNotifierMac();
 #else
-  NOTIMPLEMENTED();
   return NULL;
 #endif
 }
Index: src/net/base/sys_addrinfo.h
===================================================================
--- net/base/sys_addrinfo.h	(revision 42139)
+++ net/base/sys_addrinfo.h	(working copy)
@@ -22,3 +22,7 @@
 #include <netdb.h>
 #endif
 
+#if defined(OS_OPENBSD)
+#include <netinet/in.h>
+#include <sys/socket.h>
+#endif
Index: src/net/base/x509_certificate_unittest.cc
===================================================================
--- net/base/x509_certificate_unittest.cc	(revision 42139)
+++ net/base/x509_certificate_unittest.cc	(working copy)
@@ -294,7 +294,7 @@
   // Either the system crypto library should correctly report a certificate
   // name mismatch, or our certificate blacklist should cause us to report an
   // invalid certificate.
-#if defined(OS_LINUX) || defined(OS_WIN)
+#if !defined(OS_MACOSX)
   EXPECT_NE(0, verify_result.cert_status &
             (CERT_STATUS_COMMON_NAME_INVALID | CERT_STATUS_INVALID));
 #endif
Index: src/net/base/nss_memio.c
===================================================================
--- net/base/nss_memio.c	(revision 42139)
+++ net/base/nss_memio.c	(working copy)
@@ -359,7 +359,7 @@
     return fd;
 }
 
-void memio_SetPeerName(PRFileDesc *fd, const struct sockaddr *peername,
+void memio_SetPeerName(PRFileDesc *fd, const PRNetAddr *peername,
                        size_t peername_len)
 {
     PRFileDesc *memiofd = PR_GetIdentitiesLayer(fd, memio_identity);
Index: src/net/base/nss_memio.h
===================================================================
--- net/base/nss_memio.h	(revision 42139)
+++ net/base/nss_memio.h	(working copy)
@@ -42,7 +42,7 @@
 PRFileDesc *memio_CreateIOLayer(int bufsize);
 
 /* Must call before trying to make an ssl connection */
-void memio_SetPeerName(PRFileDesc *fd, const struct sockaddr *peername,
+void memio_SetPeerName(PRFileDesc *fd, const PRNetAddr *peername,
                        size_t peername_len);
 
 /* Return a private pointer needed by the following
Index: src/net/base/net_util.cc
===================================================================
--- net/base/net_util.cc	(revision 42139)
+++ net/base/net_util.cc	(working copy)
@@ -24,8 +24,9 @@
 #include <fcntl.h>
 #include <ifaddrs.h>
 #include <netdb.h>
+#include <sys/socket.h>
 #include <net/if.h>
-#include <sys/socket.h>
+#include <netinet/in.h>
 #endif
 
 #include "base/base64.h"
Index: src/net/base/mime_util.cc
===================================================================
--- net/base/mime_util.cc	(revision 42139)
+++ net/base/mime_util.cc	(working copy)
@@ -189,7 +189,7 @@
   "audio/ogg",
   "application/ogg",
 
-#if defined(GOOGLE_CHROME_BUILD)
+//#if defined(GOOGLE_CHROME_BUILD)
   // MPEG-4.
   "video/mp4",
   "video/x-m4v",
@@ -200,7 +200,7 @@
   "audio/mp3",
   "audio/x-mp3",
   "audio/mpeg",
-#endif
+//#endif
 };
 
 // List of supported codecs when passed in with <source type="...">.
@@ -208,10 +208,10 @@
 // Refer to http://wiki.whatwg.org/wiki/Video_type_parameters#Browser_Support
 // for more information.
 static const char* const supported_media_codecs[] = {
-#if defined(GOOGLE_CHROME_BUILD)
+//#if defined(GOOGLE_CHROME_BUILD)
   "avc1",
   "mp4a",
-#endif
+//#endif
   "theora",
   "vorbis",
 };
Index: src/net/base/host_resolver_proc.cc
===================================================================
--- net/base/host_resolver_proc.cc	(revision 42139)
+++ net/base/host_resolver_proc.cc	(working copy)
@@ -6,10 +6,6 @@
 
 #include "build/build_config.h"
 
-#if defined(OS_POSIX) && !defined(OS_MACOSX)
-#include <resolv.h>
-#endif
-
 #include "base/logging.h"
 #include "base/time.h"
 #include "net/base/address_list.h"
@@ -17,6 +13,7 @@
 #include "net/base/sys_addrinfo.h"
 
 #if defined(OS_POSIX) && !defined(OS_MACOSX)
+#include <resolv.h>
 #include "base/singleton.h"
 #include "base/thread_local_storage.h"
 #endif
Index: src/net/base/listen_socket_unittest.cc
===================================================================
--- net/base/listen_socket_unittest.cc	(revision 42139)
+++ net/base/listen_socket_unittest.cc	(working copy)
@@ -5,6 +5,7 @@
 #include "net/base/listen_socket_unittest.h"
 
 #include <fcntl.h>
+#include <netinet/in.h>
 
 #include "base/eintr_wrapper.h"
 #include "net/base/net_util.h"
Index: src/net/base/listen_socket.cc
===================================================================
--- net/base/listen_socket.cc	(revision 42139)
+++ net/base/listen_socket.cc	(working copy)
@@ -10,7 +10,9 @@
 #include <winsock2.h>
 #elif defined(OS_POSIX)
 #include <errno.h>
+#include <sys/types.h>
 #include <sys/socket.h>
+#include <netinet/in.h>
 #include <arpa/inet.h>
 #include "net/base/net_errors.h"
 #if defined(USE_SYSTEM_LIBEVENT)
Index: src/skia/ext/image_operations.cc
===================================================================
--- skia/ext/image_operations.cc	(revision 42139)
+++ skia/ext/image_operations.cc	(working copy)
@@ -271,7 +271,7 @@
                                          const SkIRect& dest_subset) {
   // Currently only works on Linux because this is the only platform where
   // SkFontHost::GetSubpixelOrder is defined.
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
   // Understand the display.
   const SkFontHost::LCDOrder order = SkFontHost::GetSubpixelOrder();
   const SkFontHost::LCDOrientation orientation =
@@ -361,7 +361,7 @@
   return result;
 #else
   return SkBitmap();
-#endif  // OS_LINUX
+#endif  // OS_NIX
 }
 
 // static
Index: src/skia/skia.gyp
===================================================================
--- skia/skia.gyp	(revision 42139)
+++ skia/skia.gyp	(working copy)
@@ -692,7 +692,7 @@
         '../third_party/skia/src/core',
       ],
       'conditions': [
-        [ 'OS == "linux" and target_arch != "arm"', {
+        [ '(OS == "linux" or OS == "freebsd" or OS == "openbsd") and target_arch != "arm"', {
           'cflags': [
             '-msse2',
           ],
Index: src/third_party/expat/expat.gyp
===================================================================
--- third_party/expat/expat.gyp	(revision 42139)
+++ third_party/expat/expat.gyp	(working copy)
@@ -15,7 +15,7 @@
     ]
   },
   'conditions': [
-    ['OS=="linux"', {
+    ['OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
       # On Linux, we implicitly already depend on expat via fontconfig;
       # let's not pull it in twice.
       'targets': [
@@ -59,7 +59,7 @@
                 'COMPILED_FROM_DSP',
               ],
             }],
-            ['OS=="mac"', {
+            ['OS=="mac" or OS=="freebsd" or OS=="openbsd"', {
               'defines': [
                 'HAVE_EXPAT_CONFIG_H',
               ],
Index: src/third_party/tcmalloc/chromium/src/config.h
===================================================================
--- third_party/tcmalloc/chromium/src/config.h	(revision 42139)
+++ third_party/tcmalloc/chromium/src/config.h	(working copy)
@@ -15,6 +15,8 @@
 #include "third_party/tcmalloc/chromium/src/config_win.h"
 #elif defined(OS_LINUX)
 #include "third_party/tcmalloc/chromium/src/config_linux.h"
+#elif defined(OS_FREEBSD)
+#include "third_party/tcmalloc/chromium/src/config_freebsd.h"
 #endif
 
 #endif // CONFIG_H_
Index: src/third_party/libjingle/files/talk/base/httpcommon.cc
===================================================================
--- third_party/libjingle/files/talk/base/httpcommon.cc	(revision 42139)
+++ third_party/libjingle/files/talk/base/httpcommon.cc	(working copy)
@@ -369,7 +369,7 @@
     }
     gmt = non_gmt + kTimeZoneOffsets[zindex] * 60 * 60;
   }
-#ifdef OSX
+#if defined(OSX) || defined(BSD)
   tm *tm_for_timezone = localtime((time_t *)&gmt);
   *seconds = gmt + tm_for_timezone->tm_gmtoff;
 #else
Index: src/third_party/libjingle/libjingle.gyp
===================================================================
--- third_party/libjingle/libjingle.gyp	(revision 42139)
+++ third_party/libjingle/libjingle.gyp	(working copy)
@@ -46,6 +46,11 @@
           'POSIX',
         ],
       }],
+      ['OS=="openbsd" or OS=="freebsd"', {
+        'defines': [
+          'BSD',
+        ],
+      }],
     ],
   },
   'targets': [
Index: src/third_party/zlib/zlib.gyp
===================================================================
--- third_party/zlib/zlib.gyp	(revision 42139)
+++ third_party/zlib/zlib.gyp	(working copy)
@@ -5,10 +5,10 @@
 {
   'variables': {
     'conditions': [
-      [ 'OS=="linux"', {
+      [ 'OS=="linux" or OS=="freebsd" or OS=="XXXXbsd"', {
         # Link to system .so since we already use it due to GTK.
         'use_system_zlib%': 1,
-      }, {  # OS!="linux"
+      }, {  # OS!="linux" and OS!="freebsd" and OS!="openbsd"
         'use_system_zlib%': 0,
       }],
     ],
Index: src/third_party/npapi/npapi.gyp
===================================================================
--- third_party/npapi/npapi.gyp	(revision 42139)
+++ third_party/npapi/npapi.gyp	(working copy)
@@ -24,7 +24,7 @@
         'bindings/npruntime.h',
       ],
       'conditions': [
-        ['OS=="linux"', {
+        ['OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
           'sources': [
             'bindings/npapi_x11.h',
           ],
Index: src/third_party/libevent/select.c
===================================================================
--- third_party/libevent/select.c	(revision 42139)
+++ third_party/libevent/select.c	(working copy)
@@ -64,7 +64,7 @@
 /* This type is mandatory, but Android doesn't define it. */
 #undef NFDBITS
 #define NFDBITS (sizeof(long)*8)
-typedef unsigned long fd_mask;
+//typedef unsigned long fd_mask;
 #endif
 
 struct selectop {
Index: src/third_party/libevent/event-config.h
===================================================================
--- third_party/libevent/event-config.h	(revision 42139)
+++ third_party/libevent/event-config.h	(working copy)
@@ -9,6 +9,8 @@
 #include "mac/event-config.h"
 #elif defined(__linux__)
 #include "linux/event-config.h"
+#elif defined(__OpenBSD__)
+#include "openbsd/event-config.h"
 #else
 #error generate event-config.h for your platform
 #endif
Index: src/third_party/libjpeg/libjpeg.gyp
===================================================================
--- third_party/libjpeg/libjpeg.gyp	(revision 42139)
+++ third_party/libjpeg/libjpeg.gyp	(working copy)
@@ -5,10 +5,10 @@
 {
   'variables': {
     'conditions': [
-      [ 'OS=="linux"', {
+      [ 'OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
         # Link to system .so since we already use it due to GTK.
         'use_system_libjpeg%': 1,
-      }, {  # OS!="linux"
+      }, {  # OS!="linux" and OS!="freebsd" and OS!="openbsd"
         'use_system_libjpeg%': 0,
       }],
     ],
Index: src/third_party/libxslt/libxslt.gyp
===================================================================
--- third_party/libxslt/libxslt.gyp	(revision 42139)
+++ third_party/libxslt/libxslt.gyp	(working copy)
@@ -17,7 +17,7 @@
     {
       'target_name': 'libxslt',
       'conditions': [
-        ['OS=="linux" and use_system_libxslt', {
+        ['(OS=="linux" or OS=="freebsd" or OS=="openbsd") and use_system_libxslt', {
           'type': 'settings',
           'direct_dependent_settings': {
             'cflags': [
Index: src/third_party/bzip2/bzip2.gyp
===================================================================
--- third_party/bzip2/bzip2.gyp	(revision 42139)
+++ third_party/bzip2/bzip2.gyp	(working copy)
@@ -5,7 +5,7 @@
 {
   'variables': {
     'conditions': [
-      [ 'OS=="linux"', {
+      [ 'OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
         # Link to system .so since we already use it due to GTK.
         'use_system_bzip2%': 1,
       }, {  # OS!="linux"
Index: src/third_party/glew/src/glew.c
===================================================================
--- third_party/glew/src/glew.c	(revision 42139)
+++ third_party/glew/src/glew.c	(working copy)
@@ -103,7 +103,7 @@
 }
 #endif /* __APPLE__ */
 
-#if defined(__sgi) || defined (__sun) || defined(__linux__)
+#if defined(__sgi) || defined (__sun) || defined(__linux__) || defined(__OpenBSD__)
 #include <dlfcn.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -139,7 +139,7 @@
 #  if defined(__APPLE__)
 #    define glewGetProcAddress(name) NSGLGetProcAddress(name)
 #  else
-#    if defined(__sgi) || defined(__sun) || defined(__linux__)
+#    if defined(__sgi) || defined(__sun) || defined(__linux__) || defined(__OpenBSD__)
 #      define glewGetProcAddress(name) dlGetProcAddress(name)
 #    else /* Used to use this for Linux, but no longer */
 #      define glewGetProcAddress(name) (*glXGetProcAddressARB)(name)
Index: src/third_party/sqlite/sqlite.gyp
===================================================================
--- third_party/sqlite/sqlite.gyp	(revision 42139)
+++ third_party/sqlite/sqlite.gyp	(working copy)
@@ -29,7 +29,7 @@
             ],
           },
         }],
-        ['OS=="linux" and use_system_sqlite', {
+        ['(OS=="linux" or OS=="freebsd" or OS=="openbsd") and use_system_sqlite', {
           'type': 'settings',
           'direct_dependent_settings': {
             'cflags': [
@@ -226,7 +226,7 @@
     },
   ],
   'conditions': [
-    ['OS=="linux" and not use_system_sqlite', {
+    ['(OS=="linux" or OS=="freebsd" or OS=="openbsd") and not use_system_sqlite', {
       'targets': [
         {
           'target_name': 'sqlite_shell',
Index: src/third_party/ffmpeg/source/config/Chromium/linux/x64/config.h
===================================================================
--- third_party/ffmpeg/source/config/Chromium/linux/x64/config.h	(revision 42139)
+++ third_party/ffmpeg/source/config/Chromium/linux/x64/config.h	(working copy)
@@ -45,7 +45,7 @@
 #define HAVE_NEON 0
 #define HAVE_PPC4XX 0
 #define HAVE_SSE 1
-#define HAVE_SSSE3 1
+#define HAVE_SSSE3 0
 #define HAVE_VIS 0
 #define HAVE_BIGENDIAN 0
 #define HAVE_BEOSTHREADS 0
@@ -102,8 +102,8 @@
 #define HAVE_LZO1X_999_COMPRESS 0
 #define HAVE_MACHINE_IOCTL_BT848_H 0
 #define HAVE_MACHINE_IOCTL_METEOR_H 0
-#define HAVE_MALLOC_H 1
-#define HAVE_MEMALIGN 1
+#define HAVE_MALLOC_H 0
+#define HAVE_MEMALIGN 0
 #define HAVE_MKSTEMP 1
 #define HAVE_PLD 0
 #define HAVE_POSIX_MEMALIGN 1
Index: src/third_party/ffmpeg/source/config/Chromium/linux/ia32/config.h
===================================================================
--- third_party/ffmpeg/source/config/Chromium/linux/ia32/config.h	(revision 42139)
+++ third_party/ffmpeg/source/config/Chromium/linux/ia32/config.h	(working copy)
@@ -45,7 +45,7 @@
 #define HAVE_NEON 0
 #define HAVE_PPC4XX 0
 #define HAVE_SSE 1
-#define HAVE_SSSE3 1
+#define HAVE_SSSE3 0
 #define HAVE_VIS 0
 #define HAVE_BIGENDIAN 0
 #define HAVE_BEOSTHREADS 0
@@ -102,8 +102,8 @@
 #define HAVE_LZO1X_999_COMPRESS 0
 #define HAVE_MACHINE_IOCTL_BT848_H 0
 #define HAVE_MACHINE_IOCTL_METEOR_H 0
-#define HAVE_MALLOC_H 1
-#define HAVE_MEMALIGN 1
+#define HAVE_MALLOC_H 0
+#define HAVE_MEMALIGN 0
 #define HAVE_MKSTEMP 1
 #define HAVE_PLD 0
 #define HAVE_POSIX_MEMALIGN 1
Index: src/third_party/ffmpeg/ffmpeg.gyp
===================================================================
--- third_party/ffmpeg/ffmpeg.gyp	(revision 42139)
+++ third_party/ffmpeg/ffmpeg.gyp	(working copy)
@@ -43,7 +43,7 @@
     'ffmpeg_variant%': '<(target_arch)',
 
     'use_system_ffmpeg%': 0,
-    'use_system_yasm%': 0,
+    'use_system_yasm%': 1,
 
     # Locations for generated artifacts.
     'shared_generated_dir': '<(SHARED_INTERMEDIATE_DIR)/third_party/ffmpeg',
@@ -56,7 +56,7 @@
     #
     # TODO(ajwong): Per the comment above, reduce this conditional's size and
     # determine if in-tree build in Windows is tractable.
-    ['(OS!="linux" and OS!="freebsd" and OS!="openbsd" and OS!="solaris" and OS!="mac") or use_system_ffmpeg!=0', {
+    ['(OS!="linux" and OS!="freebsd" and OS!="solaris" and OS!="mac") or use_system_ffmpeg!=0', {
       'variables': {
         'target_for_binaries': 'ffmpeg_binaries',
         'ffmpeg_include_root': 'include',
@@ -129,11 +129,11 @@
             'source/patched-ffmpeg-mt/libavutil/pixdesc.c', # TODO(fbarchard): Review this file.
             'source/patched-ffmpeg-mt/libavutil/rational.c',
             # Config file for the OS and architecture.
-            'source/config/<(ffmpeg_branding)/<(OS)/<(ffmpeg_config)/config.h',
+            'source/config/<(ffmpeg_branding)/linux/<(ffmpeg_config)/config.h',
             'source/config/libavutil/avconfig.h',
           ],
           'include_dirs': [
-            'source/config/<(ffmpeg_branding)/<(OS)/<(ffmpeg_config)',
+            'source/config/<(ffmpeg_branding)/linux/<(ffmpeg_config)',
             'source/patched-ffmpeg-mt',
 	    'source/config',
           ],
@@ -751,7 +751,7 @@
             ],
           },
         ],
-        ['OS=="linux" or OS=="freebsd" or OS=="solaris"', {
+        ['OS=="linux" or OS=="solaris"', {
           'link_settings': {
             'libraries': [
               # We need dl for dlopen() and friends.
Index: src/third_party/libpng/libpng.gyp
===================================================================
--- third_party/libpng/libpng.gyp	(revision 42139)
+++ third_party/libpng/libpng.gyp	(working copy)
@@ -5,10 +5,10 @@
 {
   'variables': {
     'conditions': [
-      [ 'OS=="linux"', {
+      [ 'OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
         # Link to system .so since we already use it due to GTK.
         'use_system_libpng%': 1,
-      }, {  # OS!="linux"
+      }, {  # OS!="linux" and OS!="freebsd" and OS!="openbsd"
         'use_system_libpng%': 0,
       }],
     ],
Index: src/sandbox/sandbox.gyp
===================================================================
--- sandbox/sandbox.gyp	(revision 42139)
+++ sandbox/sandbox.gyp	(working copy)
@@ -126,6 +126,15 @@
     ],
   },
   'conditions': [
+    [ 'OS=="freebsd" or OS=="openbsd"', {
+      # GYP requires that each file have at least one target defined.
+      'targets': [
+        {
+          'target_name': 'sandbox',
+          'type': 'settings',
+        },
+      ],
+    }],
     [ 'OS=="linux" and selinux==0', {
       'targets': [
         {
Index: src/build/common.gypi
===================================================================
--- build/common.gypi	(revision 42139)
+++ build/common.gypi	(working copy)
@@ -84,7 +84,7 @@
       'linux_fpic%': 0,
 
       # Python version.
-      'python_ver%': '2.5',
+      'python_ver%': '2.6',
 
       # Set ARM-v7 compilation flags
       'armv7%': 0,
@@ -203,14 +203,14 @@
     'linux_strip_binary%': 0,
 
     # Enable TCMalloc.
-    'linux_use_tcmalloc%': 1,
+    'linux_use_tcmalloc%': 0,
 
     # Set to select the Title Case versions of strings in GRD files.
     'use_titlecase_in_grd_files%': 0,
 
     # Used to disable Native Client at compile time, for platforms where it
     # isn't supported
-    'disable_nacl%': 0,
+    'disable_nacl%': 1,
 
     # Set Thumb compilation flags.
     'arm_thumb%': 0,
@@ -225,7 +225,7 @@
         # This is used to tweak build flags for gcc 4.4.
         'gcc_version%': '<!(python <(DEPTH)/build/compiler_version.py)',
         # Figure out the python architecture to decide if we build pyauto.
-        'python_arch%': '<!(<(DEPTH)/build/linux/python_arch.sh <(sysroot)/usr/lib/libpython<(python_ver).so.1.0)',
+        'python_arch%': '<!(<(DEPTH)/build/linux/python_arch.sh <(sysroot)/usr/local/lib/libpython<(python_ver).so.1)',
         'conditions': [
           ['branding=="Chrome" or linux_chromium_breakpad==1', {
             'linux_breakpad%': 1,
@@ -486,7 +486,7 @@
               ['exclude', '/(gtk|x11)_[^/]*\\.cc$'],
             ],
           }],
-          ['OS!="linux"', {
+          ['OS!="linux" and OS!="freebsd" and OS!="openbsd"', {
             'sources/': [
               ['exclude', '_linux(_unittest)?\\.cc$'],
               ['exclude', '/linux/'],
Index: src/build/linux/system.gyp
===================================================================
--- build/linux/system.gyp	(revision 42139)
+++ build/linux/system.gyp	(working copy)
@@ -13,7 +13,7 @@
         'pkg-config': 'pkg-config'
       },
     }],
-    [ 'OS=="linux"', {
+    [ 'OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
       'variables': {
         # We use our own copy of libssl, although we still need to link against
         # the rest of NSS.
Index: src/build/linux/python_arch.sh
===================================================================
--- build/linux/python_arch.sh	(revision 42139)
+++ build/linux/python_arch.sh	(working copy)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/local/bin/bash
 # Copyright (c) 2010 The Chromium Authors. All rights reserved.
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file.
@@ -10,12 +10,10 @@
 #  python_arch.sh /path/to/sysroot/usr/lib/libpython2.4.so.1.0
 #
 
-python=$(readlink -f "$1")
-if [ ! -r "$python" ]; then
-  echo unknown
-  exit 0;
-fi
-file_out=$(file "$python")
+echo ia32
+exit 0
+
+file_out=$(file "$1")
 if [ $? -ne 0 ]; then
   echo unknown
   exit 0;
Index: src/build/gyp_chromium
===================================================================
--- build/gyp_chromium	(revision 42139)
+++ build/gyp_chromium	(working copy)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/local/bin/python2.6
 
 # Copyright (c) 2009 The Chromium Authors. All rights reserved.
 # Use of this source code is governed by a BSD-style license that can be
Index: src/build/all.gyp
===================================================================
--- build/all.gyp	(revision 42139)
+++ build/all.gyp	(working copy)
@@ -48,7 +48,7 @@
             '../v8/tools/gyp/v8.gyp:*',
           ],
         }],
-        ['OS=="mac" or OS=="linux" or OS=="freebsd"', {
+        ['OS=="mac" or OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
           'dependencies': [
             '../third_party/yasm/yasm.gyp:*#host',
            ],
Index: src/build/build_config.h
===================================================================
--- build/build_config.h	(revision 42139)
+++ build/build_config.h	(working copy)
@@ -47,6 +47,7 @@
 
 #if defined(OS_LINUX) || defined(OS_FREEBSD) || defined(OS_OPENBSD) || \
     defined(OS_SOLARIS)
+#define OS_NIX 1
 #define USE_NSS 1  // Use NSS for crypto.
 #define USE_X11 1  // Use X for graphics.
 #endif
@@ -61,7 +62,7 @@
 #endif
 
 // Use tcmalloc
-#if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(NO_TCMALLOC)
+#if (defined(OS_WIN) || defined(OS_NIX)) && !defined(NO_TCMALLOC)
 #define USE_TCMALLOC 1
 #endif
 
Index: src/base/base.gyp
===================================================================
--- base/base.gyp	(revision 42139)
+++ base/base.gyp	(working copy)
@@ -216,6 +216,13 @@
         'test/test_file_util_posix.cc',
         'test/test_file_util_win.cc',
       ],
+      'conditions': [
+        [ 'OS == "freebsd" or OS == "openbsd"', {
+            # fdatasync is not implemented on BSD
+            'sources/': [ ['exclude', '^test/test_file_util_linux.cc$'] ],
+          },
+        ],
+      ],
     },
     {
       'target_name': 'test_support_perf',
Index: src/base/leak_annotations.h
===================================================================
--- base/leak_annotations.h	(revision 42139)
+++ base/leak_annotations.h	(working copy)
@@ -7,7 +7,7 @@
 
 #include "build/build_config.h"
 
-#if defined(OS_LINUX) && defined(USE_TCMALLOC)
+#if defined(OS_NIX) && defined(USE_TCMALLOC)
 
 #include "third_party/tcmalloc/chromium/src/google/heap-checker.h"
 
Index: src/base/profiler.cc
===================================================================
--- base/profiler.cc	(revision 42139)
+++ base/profiler.cc	(working copy)
@@ -5,7 +5,7 @@
 #include "base/profiler.h"
 #include "base/string_util.h"
 
-#if defined(USE_TCMALLOC) && defined(OS_LINUX)
+#if defined(USE_TCMALLOC) && defined(OS_NIX)
 #include "third_party/tcmalloc/chromium/src/google/profiler.h"
 #endif
 
@@ -24,7 +24,7 @@
 void Profiler::StartRecording() {
 #ifdef QUANTIFY
   QuantifyStartRecordingData();
-#elif defined(USE_TCMALLOC) && defined(OS_LINUX)
+#elif defined(USE_TCMALLOC) && defined(OS_NIX)
   ProfilerStart("chrome-profile");
 #endif
 }
@@ -32,13 +32,13 @@
 void Profiler::StopRecording() {
 #ifdef QUANTIFY
   QuantifyStopRecordingData();
-#elif defined(USE_TCMALLOC) && defined(OS_LINUX)
+#elif defined(USE_TCMALLOC) && defined(OS_NIX)
   ProfilerStop();
 #endif
 }
 
 void Profiler::Flush() {
-#if defined(USE_TCMALLOC) && defined(OS_LINUX)
+#if defined(USE_TCMALLOC) && defined(OS_NIX)
   ProfilerFlush();
 #endif
 }
Index: src/base/debug_util_posix.cc
===================================================================
--- base/debug_util_posix.cc	(revision 42139)
+++ base/debug_util_posix.cc	(working copy)
@@ -8,7 +8,9 @@
 #include <fcntl.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <limits.h>
 #include <sys/stat.h>
+#include <sys/param.h>
 #include <sys/sysctl.h>
 #include <sys/types.h>
 #include <unistd.h>
@@ -221,12 +223,12 @@
   return pid_index < status.size() && status[pid_index] != '0';
 }
 
-#elif defined(OS_FREEBSD)
+#elif defined(OS_OPENBSD)
 
 bool DebugUtil::BeingDebugged() {
   // TODO(benl): can we determine this under FreeBSD?
-  NOTIMPLEMENTED();
-  return false;
+  LOG(WARNING) << "Don't know how to do this";
+  return true;
 }
 
 #endif  // defined(OS_FREEBSD)
Index: src/base/process_util_linux.cc
===================================================================
--- base/process_util_linux.cc	(revision 42139)
+++ base/process_util_linux.cc	(working copy)
@@ -515,6 +515,7 @@
 extern "C" {
 #if !defined(USE_TCMALLOC)
 
+#if 0
 extern "C" {
 void* __libc_malloc(size_t size);
 void* __libc_realloc(void* ptr, size_t size);
@@ -523,6 +524,16 @@
 void* __libc_pvalloc(size_t size);
 void* __libc_memalign(size_t alignment, size_t size);
 }  // extern "C"
+#else
+extern "C" {
+void* malloc(size_t size);
+void* realloc(void* ptr, size_t size);
+void* calloc(size_t nmemb, size_t size);
+void* valloc(size_t size);
+void* pvalloc(size_t size);
+void* memalign(size_t alignment, size_t size);
+}  // extern "C"
+#endif
 
 // Overriding the system memory allocation functions:
 //
@@ -554,7 +565,7 @@
   void* function_name(size_t) __attribute__ ((visibility("default"))); \
   \
   void* function_name(size_t size) { \
-    void* ret = __libc_##function_name(size); \
+    void* ret = ##function_name(size); \
     if (ret == NULL && size != 0) \
       OnNoMemorySize(size); \
     return ret; \
@@ -565,12 +576,13 @@
       __attribute__ ((visibility("default"))); \
   \
   void* function_name(arg1_type arg1, size_t size) { \
-    void* ret = __libc_##function_name(arg1, size); \
+    void* ret = ##function_name(arg1, size); \
     if (ret == NULL && size != 0) \
       OnNoMemorySize(size); \
     return ret; \
   }
 
+#if 0
 DIE_ON_OOM_1(malloc)
 DIE_ON_OOM_1(valloc)
 DIE_ON_OOM_1(pvalloc)
@@ -578,6 +590,7 @@
 DIE_ON_OOM_2(calloc, size_t)
 DIE_ON_OOM_2(realloc, void*)
 DIE_ON_OOM_2(memalign, size_t)
+#endif
 
 // posix_memalign has a unique signature and doesn't have a __libc_ variant.
 int posix_memalign(void** ptr, size_t alignment, size_t size)
@@ -585,7 +598,7 @@
 
 int posix_memalign(void** ptr, size_t alignment, size_t size) {
   // This will use the safe version of memalign, above.
-  *ptr = memalign(alignment, size);
+//  *ptr = memalign(alignment, size);
   return 0;
 }
 
Index: src/base/test/test_suite.h
===================================================================
--- base/test/test_suite.h	(revision 42139)
+++ base/test/test_suite.h	(working copy)
@@ -59,7 +59,7 @@
 #if defined(OS_POSIX) && !defined(OS_MACOSX)
     g_thread_init(NULL);
     gtk_init_check(&argc, &argv);
-#endif  // defined(OS_LINUX)
+#endif  // defined(OS_POSIX) && !defined(OS_MACOSX)
     // Don't add additional code to this constructor.  Instead add it to
     // Initialize().  See bug 6436.
   }
Index: src/base/message_pump_glib.cc
===================================================================
--- base/message_pump_glib.cc	(revision 42139)
+++ base/message_pump_glib.cc	(working copy)
@@ -158,6 +158,7 @@
 
 void MessagePumpForUI::RunWithDispatcher(Delegate* delegate,
                                          Dispatcher* dispatcher) {
+#if 0
 #ifndef NDEBUG
   // Make sure we only run this on one thread.  GTK only has one message pump
   // so we can only have one UI loop per process.
@@ -166,6 +167,7 @@
       "Running MessagePumpForUI on two different threads; "
       "this is unsupported by GLib!";
 #endif
+#endif
 
   RunState state;
   state.delegate = delegate;
Index: src/base/atomicops.h
===================================================================
--- base/atomicops.h	(revision 42139)
+++ base/atomicops.h	(working copy)
@@ -47,7 +47,11 @@
 
 // Use AtomicWord for a machine-sized pointer.  It will use the Atomic32 or
 // Atomic64 routines below, depending on your architecture.
+#if defined(OS_OPENBSD) && defined(__i386__)
+typedef Atomic32 AtomicWord;
+#else
 typedef intptr_t AtomicWord;
+#endif
 
 // Atomically execute:
 //      result = *ptr;
Index: src/base/third_party/symbolize/symbolize.h
===================================================================
--- base/third_party/symbolize/symbolize.h	(revision 42139)
+++ base/third_party/symbolize/symbolize.h	(working copy)
@@ -60,10 +60,23 @@
 
 #ifdef HAVE_SYMBOLIZE
 
-#if defined(__ELF__)  // defined by gcc on Linux
+#if defined(__ELF__)  // defined by gcc
+#if defined(__OpenBSD__)
+#include <sys/exec_elf.h>
+#else
 #include <elf.h>
+#endif
 #include <link.h>  // For ElfW() macro.
 
+// For systems where SIZEOF_VOID_P is not defined, determine it
+// based on __LP64__ (defined by gcc on 64-bit systems)
+#if !defined(SIZEOF_VOID_P)
+# if defined(__LP64__)
+#  define SIZEOF_VOID_P 8
+# else
+#  define SIZEOF_VOID_P 4
+# endif
+#endif                                                                                            
 // If there is no ElfW macro, let's define it by ourself.
 #ifndef ElfW
 # if SIZEOF_VOID_P == 4
Index: src/base/worker_pool_linux.cc
===================================================================
--- base/worker_pool_linux.cc	(revision 42139)
+++ base/worker_pool_linux.cc	(working copy)
@@ -17,7 +17,7 @@
 const int kIdleSecondsBeforeExit = 10 * 60;
 // A stack size of 64 KB is too small for the CERT_PKIXVerifyCert
 // function of NSS because of NSS bug 439169.
-const int kWorkerThreadStackSize = 128 * 1024;
+const int kWorkerThreadStackSize = 256 * 1024;
 
 class WorkerPoolImpl {
  public:
Index: src/base/string_util_posix.h
===================================================================
--- base/string_util_posix.h	(revision 42139)
+++ base/string_util_posix.h	(working copy)
@@ -44,7 +44,12 @@
 inline int vswprintf(wchar_t* buffer, size_t size,
                      const wchar_t* format, va_list arguments) {
   DCHECK(IsWprintfFormatPortable(format));
+#if defined(OS_OPENBSD)
+  // OpenBSD does not have a wide-char equivalent
+  return ::vsnprintf((char *)buffer, size, (const char *)format, arguments);
+#else
   return ::vswprintf(buffer, size, format, arguments);
+#endif
 }
 
 }  // namespace base
Index: src/base/base.gypi
===================================================================
--- base/base.gypi	(revision 42139)
+++ base/base.gypi	(working copy)
@@ -409,6 +409,9 @@
           ],
         },],
         [ 'OS == "freebsd" or OS == "openbsd"', {
+             'sources!': [
+             'process_linux.cc',
+             ],
             'link_settings': {
               'libraries': [
                 '-L/usr/local/lib -lexecinfo',
Index: src/base/base_paths_posix.cc
===================================================================
--- base/base_paths_posix.cc	(revision 42139)
+++ base/base_paths_posix.cc	(working copy)
@@ -16,13 +16,15 @@
 #include "base/scoped_ptr.h"
 #include "base/sys_string_conversions.h"
 
+extern char *__progname;
+
 namespace base {
 
 #if defined(OS_LINUX)
 const char kSelfExe[] = "/proc/self/exe";
 #elif defined(OS_SOLARIS)
 const char kSelfExe[] = getexecname();
-#elif defined(OS_FREEBSD)
+#elif defined(OS_FREEBSD) || defined(OS_OPENBSD)
 const char kSelfExe[] = "/proc/curproc/file";
 #endif
 
@@ -31,6 +33,7 @@
   switch (key) {
     case base::FILE_EXE:
     case base::FILE_MODULE: {  // TODO(evanm): is this correct?
+#if !defined(OS_OPENBSD)
       char bin_dir[PATH_MAX + 1];
       int bin_dir_size = readlink(kSelfExe, bin_dir, PATH_MAX);
       if (bin_dir_size < 0 || bin_dir_size > PATH_MAX) {
@@ -39,6 +42,11 @@
       }
       bin_dir[bin_dir_size] = 0;
       *result = FilePath(bin_dir);
+#else
+      //*result = FilePath("/p/chrome-2/src/out/Release/chrome");
+      *result = FilePath("/usr/local/chrome/chrome");
+      fprintf(stderr, "Called PathProviderLinux once");
+#endif
       return true;
     }
     case base::DIR_SOURCE_ROOT:
Index: src/base/file_util_linux.cc
===================================================================
--- base/file_util_linux.cc	(revision 42139)
+++ base/file_util_linux.cc	(working copy)
@@ -25,7 +25,12 @@
 }
 
 bool GetShmemTempDir(FilePath* path) {
+#if defined(OS_LINUX)
   *path = FilePath("/dev/shm");
+#else
+//BSD not sure this is the best way to do this but it works for now
+  *path = FilePath("/tmp");
+#endif
   return true;
 }
 
Index: src/ipc/ipc.gyp
===================================================================
--- ipc/ipc.gyp	(revision 42139)
+++ ipc/ipc.gyp	(working copy)
@@ -63,7 +63,7 @@
             '../views/views.gyp:views',
           ],
         }],
-        ['OS=="linux"', {
+        ['OS=="linux" or OS=="freebsd"', {
           'conditions': [
             ['linux_use_tcmalloc==1', {
               'dependencies': [
Index: src/ipc/sync_socket_unittest.cc
===================================================================
--- ipc/sync_socket_unittest.cc	(revision 42139)
+++ ipc/sync_socket_unittest.cc	(working copy)
@@ -8,9 +8,9 @@
 #include <sstream>
 
 #include "base/message_loop.h"
-#if defined(OS_LINUX) || defined(OS_MACOSX)
+#if defined(OS_POSIX)
 #include "base/file_descriptor_posix.h"
-#endif  // defined(OS_LINUX) || defined(OS_MACOSX)
+#endif  // defined(OS_POSIX)
 #include "base/platform_thread.h"
 #include "base/process_util.h"
 #include "base/sync_socket.h"
Index: src/ipc/ipc_channel_posix.cc
===================================================================
--- ipc/ipc_channel_posix.cc	(revision 42139)
+++ ipc/ipc_channel_posix.cc	(working copy)
@@ -11,6 +11,7 @@
 #include <sys/socket.h>
 #include <sys/stat.h>
 #include <sys/un.h>
+#include <sys/uio.h>
 
 #include <string>
 #include <map>
@@ -273,7 +274,7 @@
       server_listen_pipe_(-1),
       pipe_(-1),
       client_pipe_(-1),
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
       fd_pipe_(-1),
       remote_fd_pipe_(-1),
 #endif
@@ -384,7 +385,7 @@
   scoped_ptr<Message> msg(new Message(MSG_ROUTING_NONE,
                                       HELLO_MESSAGE_TYPE,
                                       IPC::Message::PRIORITY_NORMAL));
-  #if defined(OS_LINUX)
+  #if defined(OS_NIX)
   if (!uses_fifo_) {
     // On Linux, the seccomp sandbox makes it very expensive to call
     // recvmsg() and sendmsg(). Often, we are perfectly OK with resorting to
@@ -460,7 +461,7 @@
       // Read from pipe.
       // recvmsg() returns 0 if the connection has closed or EAGAIN if no data
       // is waiting on the pipe.
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
       if (fd_pipe_ >= 0) {
         bytes_read = HANDLE_EINTR(read(pipe_, input_buf_,
                                        Channel::kReadBufferSize));
@@ -592,7 +593,7 @@
           if (m.header()->num_fds > num_fds - fds_i) {
             // the message has been completely received, but we didn't get
             // enough file descriptors.
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
             if (!uses_fifo_) {
               char dummy;
               struct iovec fd_pipe_iov = { &dummy, 1 };
@@ -677,7 +678,7 @@
           if (!m.ReadInt(&iter, &pid)) {
             NOTREACHED();
           }
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
           if (mode_ == MODE_SERVER && !uses_fifo_) {
             // On Linux, the Hello message from the client to the server
             // also contains the fd_pipe_, which  will be used for all
@@ -740,7 +741,7 @@
   while (!output_queue_.empty()) {
     Message* msg = output_queue_.front();
 
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
     scoped_ptr<Message> hello;
     if (remote_fd_pipe_ != -1 &&
         msg->routing_id() == MSG_ROUTING_NONE &&
@@ -801,7 +802,7 @@
       // num_fds < MAX_DESCRIPTORS_PER_MESSAGE so no danger of overflow.
       msg->header()->num_fds = static_cast<uint16>(num_fds);
 
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
       if (!uses_fifo_ &&
           (msg->routing_id() != MSG_ROUTING_NONE ||
            msg->type() != HELLO_MESSAGE_TYPE)) {
@@ -823,7 +824,7 @@
 
     if (bytes_written == 1) {
       fd_written = pipe_;
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
       if (mode_ != MODE_SERVER && !uses_fifo_ &&
           msg->routing_id() == MSG_ROUTING_NONE &&
           msg->type() == HELLO_MESSAGE_TYPE) {
@@ -994,7 +995,7 @@
     Singleton<PipeMap>()->RemoveAndClose(pipe_name_);
     client_pipe_ = -1;
   }
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
   if (fd_pipe_ != -1) {
     HANDLE_EINTR(close(fd_pipe_));
     fd_pipe_ = -1;
Index: src/ipc/ipc_channel_posix.h
===================================================================
--- ipc/ipc_channel_posix.h	(revision 42139)
+++ ipc/ipc_channel_posix.h	(working copy)
@@ -86,7 +86,7 @@
   // pipe_ that is passed to the client.
   int client_pipe_;
 
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
   // Linux uses a dedicated socketpair() for passing file descriptors.
   int fd_pipe_;
   int remote_fd_pipe_;
Index: src/chrome/test/chrome_process_util.cc
===================================================================
--- chrome/test/chrome_process_util.cc	(revision 42139)
+++ chrome/test/chrome_process_util.cc	(working copy)
@@ -86,7 +86,7 @@
 #endif
   }
 
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
   // On Linux we might be running with a zygote process for the renderers.
   // Because of that we sweep the list of processes again and pick those which
   // are children of one of the processes that we've already seen.
@@ -97,9 +97,9 @@
     while ((process_entry = it.NextProcessEntry()))
       result.push_back(process_entry->pid);
   }
-#endif  // defined(OS_LINUX)
+#endif  // defined(OS_NIX)
 
-#if defined(OS_LINUX) || defined(OS_MACOSX)
+#if defined(OS_POSIX)
   // On Mac OS X we run the subprocesses with a different bundle, and
   // on Linux via /proc/self/exe, so they end up with a different
   // name.  We must collect them in a second pass.
Index: src/chrome/test/reliability/page_load_test.cc
===================================================================
--- chrome/test/reliability/page_load_test.cc	(revision 42139)
+++ chrome/test/reliability/page_load_test.cc	(working copy)
@@ -159,7 +159,7 @@
     scoped_ptr<FileVersionInfo> file_info;
 #if defined(OS_WIN)
     file_info.reset(FileVersionInfo::CreateFileVersionInfo(kChromeDll));
-#elif defined(OS_LINUX) || defined(OS_MACOSX)
+#elif defined(OS_POSIX)
     // TODO(fmeawad): the version retrieved here belongs to the test module and
     // not the chrome binary, need to be changed to chrome binary instead.
     file_info.reset(FileVersionInfo::CreateFileVersionInfoForCurrentModule());
Index: src/chrome/test/url_fetch_test/url_fetch_test.cc
===================================================================
--- chrome/test/url_fetch_test/url_fetch_test.cc	(revision 42139)
+++ chrome/test/url_fetch_test/url_fetch_test.cc	(working copy)
@@ -33,7 +33,7 @@
       dir = dir.AppendASCII("reference_build");
 #if defined(OS_WIN)
       dir = dir.AppendASCII("chrome");
-#elif defined(OS_LINUX)
+#elif defined(OS_NIX)
       dir = dir.AppendASCII("chrome_linux");
 #elif defined(OS_MACOSX)
       dir = dir.AppendASCII("chrome_mac");
Index: src/chrome/test/page_cycler/page_cycler_test.cc
===================================================================
--- chrome/test/page_cycler/page_cycler_test.cc	(revision 42139)
+++ chrome/test/page_cycler/page_cycler_test.cc	(working copy)
@@ -282,7 +282,7 @@
     dir = dir.AppendASCII("reference_build");
 #if defined(OS_WIN)
     dir = dir.AppendASCII("chrome");
-#elif defined(OS_LINUX)
+#elif defined(OS_NIX)
     dir = dir.AppendASCII("chrome_linux");
 #elif defined(OS_MACOSX)
     dir = dir.AppendASCII("chrome_mac");
Index: src/chrome/test/automation/automation_proxy_uitest.cc
===================================================================
--- chrome/test/automation/automation_proxy_uitest.cc	(revision 42139)
+++ chrome/test/automation/automation_proxy_uitest.cc	(working copy)
@@ -1351,7 +1351,7 @@
 #endif  // defined(OS_WIN)
 
 // TODO(port): Need to port autocomplete_edit_proxy.* first.
-#if defined(OS_WIN) || defined(OS_LINUX)
+#if defined(OS_WIN) || defined(OS_NIX)
 TEST_F(AutomationProxyTest, AutocompleteGetSetText) {
   scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0));
   ASSERT_TRUE(browser.get());
@@ -1395,7 +1395,7 @@
   EXPECT_EQ(text_to_set2, actual_text2);
 }
 
-#endif  // defined(OS_WIN) || defined(OS_LINUX)
+#endif  // defined(OS_WIN) || defined(OS_NIX)
 
 // So flaky, http://crbug.com/19876. Consult phajdan.jr before re-enabling.
 TEST_F(AutomationProxyVisibleTest, DISABLED_AutocompleteMatchesTest) {
Index: src/chrome/test/ui_test_utils.cc
===================================================================
--- chrome/test/ui_test_utils.cc	(revision 42139)
+++ chrome/test/ui_test_utils.cc	(working copy)
@@ -386,7 +386,7 @@
 #if defined(TOOLKIT_VIEWS)
   views::AcceleratorHandler handler;
   loop->Run(&handler);
-#elif defined(OS_LINUX)
+#elif defined(OS_NIX)
   loop->Run(NULL);
 #else
   loop->Run();
Index: src/chrome/test/testing_profile.cc
===================================================================
--- chrome/test/testing_profile.cc	(revision 42139)
+++ chrome/test/testing_profile.cc	(working copy)
@@ -19,7 +19,7 @@
 #include "net/url_request/url_request_context.h"
 #include "webkit/database/database_tracker.h"
 
-#if defined(OS_LINUX) && !defined(TOOLKIT_VIEWS)
+#if defined(TOOLKIT_GTK) && !defined(TOOLKIT_VIEWS)
 #include "chrome/browser/gtk/gtk_theme_provider.h"
 #endif
 
@@ -258,7 +258,7 @@
 
 void TestingProfile::InitThemes() {
   if (!created_theme_provider_) {
-#if defined(OS_LINUX) && !defined(TOOLKIT_VIEWS)
+#if defined(TOOLKIT_GTK) && !defined(TOOLKIT_VIEWS)
     theme_provider_.reset(new GtkThemeProvider);
 #else
     theme_provider_.reset(new BrowserThemeProvider);
Index: src/chrome/test/in_process_browser_test.cc
===================================================================
--- chrome/test/in_process_browser_test.cc	(revision 42139)
+++ chrome/test/in_process_browser_test.cc	(working copy)
@@ -37,7 +37,7 @@
 #include "net/base/mock_host_resolver.h"
 #include "sandbox/src/dep.h"
 
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
 #include "base/singleton.h"
 #include "chrome/browser/renderer_host/render_sandbox_host_linux.h"
 #include "chrome/browser/zygote_host_linux.h"
@@ -189,7 +189,7 @@
 #endif
   CHECK(PathService::Override(base::FILE_EXE, chrome_path));
 
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
   // Initialize the RenderSandbox and Zygote hosts. Apparently they get used
   // for InProcessBrowserTest, and this is not the normal browser startup path.
   Singleton<LinuxHostInit>::get();
Index: src/chrome/test/startup/feature_startup_test.cc
===================================================================
--- chrome/test/startup/feature_startup_test.cc	(revision 42139)
+++ chrome/test/startup/feature_startup_test.cc	(working copy)
@@ -192,7 +192,7 @@
   RunNewTabTimingTest();
 }
 
-#if defined(OS_LINUX)
+#if defined(TOOLKIT_GTK)
 TEST_F(NewTabUIStartupTest, GtkThemeCold) {
   RunStartupTest("tab_gtk_theme_cold", false /* cold */,
                  false /* not important */,
Index: src/chrome/test/startup/startup_test.cc
===================================================================
--- chrome/test/startup/startup_test.cc	(revision 42139)
+++ chrome/test/startup/startup_test.cc	(working copy)
@@ -205,7 +205,7 @@
                  false /* not important */, UITest::COMPLEX_THEME);
 }
 
-#if defined(OS_LINUX)
+#if defined(TOOLKIT_GTK)
 TEST_F(StartupTest, PerfColdGtkTheme) {
   RunStartupTest("warm", "gtk-theme", false /* warm */,
                  false /* not important */, UITest::NATIVE_THEME);
Index: src/chrome/test/testing_browser_process.h
===================================================================
--- chrome/test/testing_browser_process.h	(revision 42139)
+++ chrome/test/testing_browser_process.h	(working copy)
@@ -47,7 +47,7 @@
     return NULL;
   }
 
-#if defined(OS_LINUX)
+#if defined(USE_X11)
   virtual base::Thread* background_x11_thread() {
     return NULL;
   }
Index: src/chrome/test/interactive_ui/interactive_ui_tests.gypi
===================================================================
--- chrome/test/interactive_ui/interactive_ui_tests.gypi	(revision 42139)
+++ chrome/test/interactive_ui/interactive_ui_tests.gypi	(working copy)
@@ -49,7 +49,7 @@
     '<(DEPTH)/chrome/test/unit/chrome_test_suite.h',
   ],
   'conditions': [
-    ['OS=="linux"', {
+    ['OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
       'dependencies': [
         '<(DEPTH)/build/linux/system.gyp:gtk',
         '<(DEPTH)/tools/xdisplaycheck/xdisplaycheck.gyp:xdisplaycheck',
@@ -63,7 +63,7 @@
         '<(DEPTH)/chrome/test/interactive_ui/view_event_test_base.cc',
         '<(DEPTH)/chrome/test/interactive_ui/view_event_test_base.h',
       ],
-    }],  # OS=="linux"
+    }],  # OS=="linux or OS=="freebsd" or OS=="openbsd""
     ['target_arch!="x64" and target_arch!="arm"', {
       'dependencies': [
         # run time dependency
Index: src/chrome/test/ui/history_uitest.cc
===================================================================
--- chrome/test/ui/history_uitest.cc	(revision 42139)
+++ chrome/test/ui/history_uitest.cc	(working copy)
@@ -68,7 +68,7 @@
                 kTestCompleteSuccess, action_max_timeout_ms());
 }
 
-#if defined(OS_WIN) || defined(OS_LINUX)
+#if defined(OS_WIN) || defined(OS_NIX)
 TEST_F(HistoryTester, DISABLED_ConsiderRedirectAfterGestureAsUserInitiated) {
   // Test the history length for the following page transition.
   //
@@ -98,7 +98,7 @@
   WaitForFinish("History_Length_Test_12", "1", url, kTestCompleteCookie,
                 kTestCompleteSuccess, action_max_timeout_ms());
 }
-#endif  // defined(OS_WIN) || defined(OS_LINUX)
+#endif  // defined(OS_WIN) || defined(OS_NIX)
 
 TEST_F(HistoryTester, DISABLED_ConsiderSlowRedirectAsUserInitiated) {
   // Test the history length for the following page transition.
Index: src/chrome/test/ui/v8_benchmark_uitest.cc
===================================================================
--- chrome/test/ui/v8_benchmark_uitest.cc	(revision 42139)
+++ chrome/test/ui/v8_benchmark_uitest.cc	(working copy)
@@ -129,7 +129,7 @@
     dir = dir.AppendASCII("reference_build");
 #if defined(OS_WIN)
     dir = dir.AppendASCII("chrome");
-#elif defined(OS_LINUX)
+#elif defined(OS_NIX)
     dir = dir.AppendASCII("chrome_linux");
 #elif defined(OS_MACOSX)
     dir = dir.AppendASCII("chrome_mac");
Index: src/chrome/test/ui/npapi_test_helper.cc
===================================================================
--- chrome/test/ui/npapi_test_helper.cc	(revision 42139)
+++ chrome/test/ui/npapi_test_helper.cc	(working copy)
@@ -22,7 +22,7 @@
 static const char kNpapiTestPluginName[] = "npapi_test_plugin.plugin";
 static const char kPepperTestPluginName[] = "PepperTestPlugin.plugin";
 static const char kLayoutPluginName[] = "TestNetscapePlugIn.plugin";
-#elif defined(OS_LINUX)
+#elif defined(OS_NIX)
 static const char kNpapiTestPluginName[] = "libnpapi_test_plugin.so";
 static const char kPepperTestPluginName[] = "libpepper_test_plugin.so";
 #endif
Index: src/chrome/test/ui/sunspider_uitest.cc
===================================================================
--- chrome/test/ui/sunspider_uitest.cc	(revision 42139)
+++ chrome/test/ui/sunspider_uitest.cc	(working copy)
@@ -128,7 +128,7 @@
     dir = dir.AppendASCII("reference_build");
 #if defined(OS_WIN)
     dir = dir.AppendASCII("chrome");
-#elif defined(OS_LINUX)
+#elif defined(OS_NIX)
     dir = dir.AppendASCII("chrome_linux");
 #elif defined(OS_MACOSX)
     dir = dir.AppendASCII("chrome_mac");
Index: src/chrome/test/ui/ui_layout_test.cc
===================================================================
--- chrome/test/ui/ui_layout_test.cc	(revision 42139)
+++ chrome/test/ui/ui_layout_test.cc	(working copy)
@@ -17,7 +17,7 @@
 static const char kPlatformName[] = "chromium-win";
 #elif defined(OS_MACOSX)
 static const char kPlatformName[] = "chromium-mac";
-#elif defined(OS_LINUX)
+#elif defined(OS_NIX)
 static const char kPlatformName[] = "chromium-linux";
 #else
 #error No known OS defined
Index: src/chrome/test/ui/ui_test.cc
===================================================================
--- chrome/test/ui/ui_test.cc	(revision 42139)
+++ chrome/test/ui/ui_test.cc	(working copy)
@@ -55,7 +55,7 @@
     L"NOTE: This test is expected to fail if crash_service.exe is not "
     L"running. Start it manually before running this test (see the build "
     L"output directory).";
-#elif defined(OS_LINUX)
+#elif defined(OS_NIX)
     L"NOTE: This test is expected to fail if breakpad is not built in "
     L"or if chromium is not running headless (try CHROME_HEADLESS=1).";
 #else
@@ -1444,7 +1444,7 @@
   PrintResult("ws_final_t", "", "ws_f_t" + trace_name,
               total_working_set_size, "bytes",
               false /* not important */);
-#elif defined(OS_LINUX) || defined(OS_MACOSX)
+#elif defined(OS_POSIX)
   PrintResult("vm_size_final_b", "", "vm_size_f_b" + trace_name,
               browser_virtual_size, "bytes",
               true /* important */);
Index: src/chrome/app/chrome_dll_main.cc
===================================================================
--- chrome/app/chrome_dll_main.cc	(revision 42139)
+++ chrome/app/chrome_dll_main.cc	(working copy)
@@ -62,7 +62,7 @@
 #include "base/nss_util.h"
 #endif
 
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
 #include "chrome/browser/renderer_host/render_sandbox_host_linux.h"
 #include "chrome/browser/zygote_host_linux.h"
 #endif
@@ -253,6 +253,7 @@
   }
 }
 
+#if defined(OS_LINUX)
 static void AdjustLinuxOOMScore(const std::string& process_type) {
   const int kMiscScore = 7;
   const int kPluginScore = 10;
@@ -285,6 +286,7 @@
   if (score > -1)
     base::AdjustOOMScore(base::GetCurrentProcId(), score);
 }
+#endif  // defined(OS_LINUX)
 #endif  // defined(OS_POSIX) && !defined(OS_MACOSX)
 
 // Register the invalid param handler and pure call handler to be able to
@@ -764,7 +766,7 @@
     NOTIMPLEMENTED();
 #endif
   } else if (process_type.empty()) {
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
     const char* sandbox_binary = NULL;
     struct stat st;
 
@@ -802,7 +804,7 @@
     // gtk_init() can change |argc| and |argv|.
     gtk_init(&argc, &argv);
     SetUpGLibLogHandler();
-#endif  // defined(OS_LINUX)
+#endif  // defined(OS_NIX)
 
     rv = BrowserMain(main_params);
   } else {
Index: src/chrome/app/chrome_main_uitest.cc
===================================================================
--- chrome/app/chrome_main_uitest.cc	(revision 42139)
+++ chrome/app/chrome_main_uitest.cc	(working copy)
@@ -18,7 +18,7 @@
   if (UITest::in_process_renderer()) {
     EXPECT_EQ(1, UITest::GetBrowserProcessCount());
   } else {
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
     // On Linux we'll have four processes: browser, renderer, zygote and
     // sandbox helper.
     EXPECT_EQ(4, UITest::GetBrowserProcessCount());
Index: src/chrome/app/chrome_exe_main_gtk.cc
===================================================================
--- chrome/app/chrome_exe_main_gtk.cc	(revision 42139)
+++ chrome/app/chrome_exe_main_gtk.cc	(working copy)
@@ -17,11 +17,11 @@
 extern "C" {
 int ChromeMain(int argc, const char** argv);
 
-#if defined(OS_LINUX) && defined(USE_TCMALLOC)
+#if defined(OS_NIX) && defined(USE_TCMALLOC)
 
 int tc_set_new_mode(int mode);
 
-#endif  // defined(OS_LINUX) && defined(USE_TCMALLOC)
+#endif  // defined(OS_NIX) && defined(USE_TCMALLOC)
 }
 
 int main(int argc, const char** argv) {
@@ -34,7 +34,7 @@
   // dependency on TCMalloc.  Really, we ought to have our allocator shim code
   // implement this EnableTerminationOnOutOfMemory() function.  Whateverz.  This
   // works for now.
-#if defined(OS_LINUX) && defined(USE_TCMALLOC)
+#if defined(OS_NIX) && defined(USE_TCMALLOC)
   // For tcmalloc, we need to tell it to behave like new.
   tc_set_new_mode(1);
 #endif
Index: src/chrome/browser/child_process_launcher.cc
===================================================================
--- chrome/browser/child_process_launcher.cc	(revision 42139)
+++ chrome/browser/child_process_launcher.cc	(working copy)
@@ -16,7 +16,7 @@
 
 #if defined(OS_WIN)
 #include "chrome/common/sandbox_policy.h"
-#elif defined(OS_LINUX)
+#elif defined(OS_NIX)
 #include "base/singleton.h"
 #include "chrome/browser/crash_handler_host_linux.h"
 #include "chrome/browser/zygote_host_linux.h"
@@ -39,7 +39,7 @@
  public:
   Context()
       : starting_(true)
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
         , zygote_(false)
 #endif
         {
@@ -104,7 +104,7 @@
     handle = sandbox::StartProcessWithAccess(cmd_line, exposed_dir);
 #elif defined(OS_POSIX)
 
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
     if (use_zygote) {
       base::GlobalDescriptors::Mapping mapping;
       mapping.push_back(std::pair<uint32_t, int>(kPrimaryIPCChannel, ipcfd));
@@ -124,7 +124,7 @@
           ipcfd,
           kPrimaryIPCChannel + base::GlobalDescriptors::kBaseDescriptor));
 
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
       // On Linux, we need to add some extra file descriptors for crash handling
       // and the sandbox.
       bool is_renderer =
@@ -156,7 +156,7 @@
             sandbox_fd,
             kSandboxIPCChannel + base::GlobalDescriptors::kBaseDescriptor));
       }
-#endif  // defined(OS_LINUX)
+#endif  // defined(OS_NIX)
 
       // Actually launch the app.
       bool launched;
@@ -183,20 +183,20 @@
         NewRunnableMethod(
             this,
             &ChildProcessLauncher::Context::Notify,
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
             use_zygote,
 #endif
             handle));
   }
 
   void Notify(
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
       bool zygote,
 #endif
       base::ProcessHandle handle) {
     starting_ = false;
     process_.set_handle(handle);
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
     zygote_ = zygote;
 #endif
     if (client_) {
@@ -216,7 +216,7 @@
         ChromeThread::PROCESS_LAUNCHER, FROM_HERE,
         NewRunnableFunction(
             &ChildProcessLauncher::Context::TerminateInternal,
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
             zygote_,
 #endif
             process_.handle()));
@@ -224,7 +224,7 @@
   }
 
   static void TerminateInternal(
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
       bool zygote,
 #endif
       base::ProcessHandle handle) {
@@ -234,13 +234,13 @@
     process.Terminate(ResultCodes::NORMAL_EXIT);
     // On POSIX, we must additionally reap the child.
 #if defined(OS_POSIX)
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
     if (zygote) {
       // If the renderer was created via a zygote, we have to proxy the reaping
       // through the zygote process.
       Singleton<ZygoteHost>()->EnsureProcessTerminated(handle);
     } else
-#endif  // OS_LINUX
+#endif  // OS_NIX
     {
       ProcessWatcher::EnsureProcessTerminated(handle);
     }
@@ -253,7 +253,7 @@
   base::Process process_;
   bool starting_;
 
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
   bool zygote_;
 #endif
 };
@@ -298,7 +298,7 @@
 bool ChildProcessLauncher::DidProcessCrash() {
   bool did_crash, child_exited;
   base::ProcessHandle handle = context_->process_.handle();
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
   if (context_->zygote_) {
     did_crash = Singleton<ZygoteHost>()->DidProcessCrash(handle, &child_exited);
   } else
Index: src/chrome/browser/extensions/extension_process_manager.cc
===================================================================
--- chrome/browser/extensions/extension_process_manager.cc	(revision 42139)
+++ chrome/browser/extensions/extension_process_manager.cc	(working copy)
@@ -49,10 +49,10 @@
                  NotificationService::AllSources());
   registrar_.Add(this, NotificationType::RENDERER_PROCESS_CLOSED,
                  NotificationService::AllSources());
-#if defined(OS_WIN) || defined(OS_LINUX)
+#if !defined(OS_MACOSX)
   registrar_.Add(this, NotificationType::BROWSER_CLOSED,
                  NotificationService::AllSources());
-#elif defined(OS_MACOSX)
+#else
   registrar_.Add(this, NotificationType::APP_TERMINATING,
                  NotificationService::AllSources());
 #endif
@@ -271,7 +271,7 @@
       UnregisterExtensionProcess(host->id());
       break;
     }
-#if defined(OS_WIN) || defined(OS_LINUX)
+#if !defined(OS_MACOSX)
     case NotificationType::BROWSER_CLOSED: {
       // Close background hosts when the last browser is closed so that they
       // have time to shutdown various objects on different threads. Our
@@ -281,7 +281,7 @@
         CloseBackgroundHosts();
       break;
     }
-#elif defined(OS_MACOSX)
+#else
     case NotificationType::APP_TERMINATING: {
       // Don't follow the behavior of having the last browser window closed
       // being an indication that the app should close.
Index: src/chrome/browser/app_modal_dialog.cc
===================================================================
--- chrome/browser/app_modal_dialog.cc	(revision 42139)
+++ chrome/browser/app_modal_dialog.cc	(working copy)
@@ -11,7 +11,7 @@
 
 AppModalDialog::AppModalDialog(TabContents* tab_contents,
                                const std::wstring& title)
-#if defined(OS_WIN) || defined(OS_LINUX)
+#if defined(OS_WIN) || defined(OS_NIX)
     : dialog_(NULL),
 #elif defined(OS_MACOSX)
     :
Index: src/chrome/browser/app_modal_dialog.h
===================================================================
--- chrome/browser/app_modal_dialog.h	(revision 42139)
+++ chrome/browser/app_modal_dialog.h	(working copy)
@@ -92,7 +92,7 @@
   virtual NativeDialog CreateNativeDialog() = 0;
 
   // A reference to the platform native dialog box.
-#if defined(OS_LINUX) || defined(OS_WIN)
+#if defined(OS_NIX) || defined(OS_WIN)
   NativeDialog dialog_;
 #endif
 
Index: src/chrome/browser/shell_integration_unittest.cc
===================================================================
--- chrome/browser/shell_integration_unittest.cc	(revision 42139)
+++ chrome/browser/shell_integration_unittest.cc	(working copy)
@@ -18,13 +18,13 @@
 #include "googleurl/src/gurl.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
 #include "base/linux_util.h"
-#endif  // defined(OS_LINUX)
+#endif  // defined(OS_NIX)
 
 #define FPL FILE_PATH_LITERAL
 
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
 namespace {
 
 // Provides mock environment variables values based on a stored map.
Index: src/chrome/browser/options_util.cc
===================================================================
--- chrome/browser/options_util.cc	(revision 42139)
+++ chrome/browser/options_util.cc	(working copy)
@@ -27,7 +27,7 @@
     prefs::kCookieBehavior,
     prefs::kDefaultCharset,
     prefs::kDnsPrefetchingEnabled,
-#if defined(OS_LINUX) || defined(OS_FREEBSD) || defined(OS_OPENBSD)
+#if defined(OS_NIX)
     prefs::kCertRevocationCheckingEnabled,
     prefs::kSSL2Enabled,
     prefs::kSSL3Enabled,
Index: src/chrome/browser/renderer_preferences_util.cc
===================================================================
--- chrome/browser/renderer_preferences_util.cc	(revision 42139)
+++ chrome/browser/renderer_preferences_util.cc	(working copy)
@@ -6,7 +6,7 @@
 
 #include "chrome/browser/profile.h"
 
-#if defined(OS_LINUX)
+#if defined(TOOLKIT_GTK)
 #include "chrome/browser/gtk/gtk_theme_provider.h"
 #include "chrome/browser/gtk/gtk_util.h"
 #endif
@@ -14,7 +14,7 @@
 namespace renderer_preferences_util {
 
 void UpdateFromSystemSettings(RendererPreferences* prefs, Profile* profile) {
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
   gtk_util::UpdateGtkFontSettings(prefs);
 
 #if !defined(TOOLKIT_VIEWS)
@@ -31,7 +31,7 @@
   prefs->inactive_selection_fg_color =
       provider->get_inactive_selection_fg_color();
 #endif  // !defined(TOOLKIT_VIEWS)
-#endif  // defined(OS_LINUX)
+#endif  // defined(OS_NIX)
 }
 
 }  // renderer_preferences_util
Index: src/chrome/browser/views/fullscreen_exit_bubble.h
===================================================================
--- chrome/browser/views/fullscreen_exit_bubble.h	(revision 42139)
+++ chrome/browser/views/fullscreen_exit_bubble.h	(working copy)
@@ -10,7 +10,7 @@
 #include "chrome/browser/command_updater.h"
 #include "views/controls/link.h"
 
-#if defined(OS_LINUX)
+#if defined(TOOLKIT_GTK)
 namespace views {
 class WidgetGtk;
 }
@@ -72,7 +72,7 @@
   // The popup itself, which is a slightly modified WidgetWin.  We need to use
   // a WidgetWin (and thus an HWND) to make the popup float over other HWNDs.
   FullscreenExitPopup* popup_;
-#elif defined(OS_LINUX)
+#elif defined(TOOLKIT_GTK)
   views::WidgetGtk* popup_;
 #endif
 
Index: src/chrome/browser/views/extensions/extension_popup.cc
===================================================================
--- chrome/browser/views/extensions/extension_popup.cc	(revision 42139)
+++ chrome/browser/views/extensions/extension_popup.cc	(working copy)
@@ -22,7 +22,7 @@
 #include "views/widget/root_view.h"
 #include "views/window/window.h"
 
-#if defined(OS_LINUX)
+#if defined(TOOLKIT_GTK)
 #include "views/widget/widget_gtk.h"
 #endif
 
@@ -91,7 +91,7 @@
   // The bubble chrome requires a separate window, so construct it here.
   if (BUBBLE_CHROME == popup_chrome_) {
     gfx::NativeView native_window = frame->GetNativeView();
-#if defined(OS_LINUX)
+#if defined(TOOLKIT_GTK)
     border_widget_ = new views::WidgetGtk(views::WidgetGtk::TYPE_WINDOW);
     static_cast<views::WidgetGtk*>(border_widget_)->MakeTransparent();
     static_cast<views::WidgetGtk*>(border_widget_)->make_transient_to_parent();
Index: src/chrome/browser/views/extensions/extension_view.cc
===================================================================
--- chrome/browser/views/extensions/extension_view.cc	(revision 42139)
+++ chrome/browser/views/extensions/extension_view.cc	(working copy)
@@ -12,7 +12,7 @@
 
 #if defined(OS_WIN)
 #include "chrome/browser/renderer_host/render_widget_host_view_win.h"
-#elif defined(OS_LINUX)
+#elif defined(TOOLKIT_GTK)
 #include "chrome/browser/renderer_host/render_widget_host_view_gtk.h"
 #endif
 
@@ -100,7 +100,7 @@
   HWND hwnd = view_win->Create(GetWidget()->GetNativeView());
   view_win->ShowWindow(SW_SHOW);
   Attach(hwnd);
-#elif defined(OS_LINUX)
+#elif defined(TOOLKIT_GTK)
   RenderWidgetHostViewGtk* view_gtk =
       static_cast<RenderWidgetHostViewGtk*>(view);
   view_gtk->InitAsChild();
Index: src/chrome/browser/views/fullscreen_exit_bubble.cc
===================================================================
--- chrome/browser/views/fullscreen_exit_bubble.cc	(revision 42139)
+++ chrome/browser/views/fullscreen_exit_bubble.cc	(working copy)
@@ -17,7 +17,7 @@
 #if defined(OS_WIN)
 #include "app/l10n_util_win.h"
 #include "views/widget/widget_win.h"
-#elif defined(OS_LINUX)
+#elif defined(TOOLKIT_GTK)
 #include "views/widget/widget_gtk.h"
 #endif
 
@@ -114,7 +114,7 @@
     return MA_NOACTIVATE;
   }
 };
-#elif defined(OS_LINUX)
+#elif defined(TOOLKIT_GTK)
 // TODO: figure out the equivalent of MA_NOACTIVATE for gtk.
 #endif
 
@@ -149,7 +149,7 @@
   popup_->set_window_style(WS_POPUP);
   popup_->set_window_ex_style(WS_EX_LAYERED | WS_EX_TOOLWINDOW |
                               l10n_util::GetExtendedTooltipStyles());
-#elif defined(OS_LINUX)
+#elif defined(TOOLKIT_GTK)
   popup_ = new views::WidgetGtk(views::WidgetGtk::TYPE_POPUP);
   popup_->MakeTransparent();
 #endif
@@ -197,7 +197,7 @@
 #if defined(OS_WIN)
     popup_->MoveWindow(popup_rect.x(), popup_rect.y(), popup_rect.width(),
                        popup_rect.height());
-#elif defined(OS_LINUX)
+#elif defined(TOOLKIT_GTK)
     popup_->SetBounds(popup_rect);
 #endif
     popup_->Show();
Index: src/chrome/browser/views/info_bubble.h
===================================================================
--- chrome/browser/views/info_bubble.h	(revision 42139)
+++ chrome/browser/views/info_bubble.h	(working copy)
@@ -9,7 +9,7 @@
 #include "views/accelerator.h"
 #if defined(OS_WIN)
 #include "views/widget/widget_win.h"
-#elif defined(OS_LINUX)
+#elif defined(TOOLKIT_GTK)
 #include "views/widget/widget_gtk.h"
 #endif
 
@@ -88,7 +88,7 @@
 class InfoBubble
 #if defined(OS_WIN)
     : public views::WidgetWin,
-#elif defined(OS_LINUX)
+#elif defined(TOOLKIT_GTK)
     : public views::WidgetGtk,
 #endif
       public views::AcceleratorTarget {
@@ -128,7 +128,7 @@
 #if defined(OS_WIN)
   // Overridden from WidgetWin:
   virtual void OnActivate(UINT action, BOOL minimized, HWND window);
-#elif defined(OS_LINUX)
+#elif defined(TOOLKIT_GTK)
   // Overridden from WidgetGtk:
   virtual void IsActiveChanged();
 #endif
Index: src/chrome/browser/views/page_info_window_view.cc
===================================================================
--- chrome/browser/views/page_info_window_view.cc	(revision 42139)
+++ chrome/browser/views/page_info_window_view.cc	(working copy)
@@ -35,7 +35,7 @@
 
 #if defined(OS_WIN)
 #include "app/win_util.h"
-#elif defined(OS_LINUX)
+#elif defined(TOOLKIT_GTK)
 #include "chrome/browser/gtk/certificate_viewer.h"
 #endif
 
@@ -359,7 +359,7 @@
   // This next call blocks but keeps processing windows messages, making it
   // modal to the browser window.
   BOOL rv = ::CryptUIDlgViewCertificate(&view_info, &properties_changed);
-#elif defined(OS_LINUX)
+#elif defined(TOOLKIT_GTK)
   ShowCertificateViewer(window()->GetNativeWindow(), cert_id);
 #else
   NOTIMPLEMENTED();
Index: src/chrome/browser/views/find_bar_host_interactive_uitest.cc
===================================================================
--- chrome/browser/views/find_bar_host_interactive_uitest.cc	(revision 42139)
+++ chrome/browser/views/find_bar_host_interactive_uitest.cc	(working copy)
@@ -38,7 +38,7 @@
 #if defined(TOOLKIT_VIEWS)
     views::View* view =
         reinterpret_cast<BrowserView*>(browser_window)->GetViewByID(view_id);
-#elif defined(OS_LINUX)
+#elif defined(TOOLKIT_GTK)
     gfx::NativeWindow window = browser_window->GetNativeHandle();
     ASSERT_TRUE(window);
     GtkWidget* view = ViewIDUtil::GetWidget(GTK_WIDGET(window), view_id);
Index: src/chrome/browser/views/tabs/dragged_tab_view.cc
===================================================================
--- chrome/browser/views/tabs/dragged_tab_view.cc	(revision 42139)
+++ chrome/browser/views/tabs/dragged_tab_view.cc	(working copy)
@@ -14,7 +14,7 @@
 #include "views/widget/widget.h"
 #if defined(OS_WIN)
 #include "views/widget/widget_win.h"
-#elif defined(OS_LINUX)
+#elif defined(TOOLKIT_GTK)
 #include "views/widget/widget_gtk.h"
 #endif
 
Index: src/chrome/browser/views/tabs/dragged_tab_view.h
===================================================================
--- chrome/browser/views/tabs/dragged_tab_view.h	(revision 42139)
+++ chrome/browser/views/tabs/dragged_tab_view.h	(working copy)
@@ -17,7 +17,7 @@
 namespace views {
 #if defined(OS_WIN)
 class WidgetWin;
-#elif defined(OS_LINUX)
+#elif defined(TOOLKIT_GTK)
 class WidgetGtk;
 #endif
 }
@@ -96,7 +96,7 @@
   // The window that contains the DraggedTabView.
 #if defined(OS_WIN)
   scoped_ptr<views::WidgetWin> container_;
-#elif defined(OS_LINUX)
+#elif defined(TOOLKIT_GTK)
   scoped_ptr<views::WidgetGtk> container_;
 #endif
 
Index: src/chrome/browser/views/tabs/tab_strip.cc
===================================================================
--- chrome/browser/views/tabs/tab_strip.cc	(revision 42139)
+++ chrome/browser/views/tabs/tab_strip.cc	(working copy)
@@ -35,7 +35,7 @@
 #if defined(OS_WIN)
 #include "app/win_util.h"
 #include "views/widget/widget_win.h"
-#elif defined(OS_LINUX)
+#elif defined(TOOLKIT_GTK)
 #include "views/widget/widget_gtk.h"
 #endif
 
@@ -1659,7 +1659,7 @@
 #if defined(OS_WIN)
   DWORD pos = GetMessagePos();
   gfx::Point cursor_point(pos);
-#elif defined(OS_LINUX)
+#elif defined(TOOLKIT_GTK)
   // TODO: make sure this is right with multiple monitors.
   GdkScreen* screen = gdk_screen_get_default();
   GdkDisplay* display = gdk_screen_get_display(screen);
Index: src/chrome/browser/views/tabs/tab_strip.h
===================================================================
--- chrome/browser/views/tabs/tab_strip.h	(revision 42139)
+++ chrome/browser/views/tabs/tab_strip.h	(working copy)
@@ -18,7 +18,7 @@
 
 namespace views {
 class ImageView;
-#if defined(OS_LINUX)
+#if defined(TOOLKIT_GTK)
 class WidgetGtk;
 #elif defined(OS_WIN)
 class WidgetWin;
Index: src/chrome/browser/views/frame/opaque_browser_frame_view.cc
===================================================================
--- chrome/browser/views/frame/opaque_browser_frame_view.cc	(revision 42139)
+++ chrome/browser/views/frame/opaque_browser_frame_view.cc	(working copy)
@@ -31,7 +31,7 @@
 #include "app/win_util.h"
 #endif
 
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
 #include "views/window/hit_test.h"
 #endif
 
Index: src/chrome/browser/views/frame/app_panel_browser_frame_view.cc
===================================================================
--- chrome/browser/views/frame/app_panel_browser_frame_view.cc	(revision 42139)
+++ chrome/browser/views/frame/app_panel_browser_frame_view.cc	(working copy)
@@ -21,7 +21,7 @@
 #include "views/window/window.h"
 #include "views/window/window_resources.h"
 
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
 #include "views/window/hit_test.h"
 #endif
 
Index: src/chrome/browser/views/frame/browser_view_layout.cc
===================================================================
--- chrome/browser/views/frame/browser_view_layout.cc	(revision 42139)
+++ chrome/browser/views/frame/browser_view_layout.cc	(working copy)
@@ -19,7 +19,7 @@
 #include "gfx/scrollbar_size.h"
 #include "views/window/window.h"
 
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
 #include "views/window/hit_test.h"
 #endif
 
Index: src/chrome/browser/views/frame/browser_view.cc
===================================================================
--- chrome/browser/views/frame/browser_view.cc	(revision 42139)
+++ chrome/browser/views/frame/browser_view.cc	(working copy)
@@ -4,7 +4,7 @@
 
 #include "chrome/browser/views/frame/browser_view.h"
 
-#if defined(OS_LINUX)
+#if defined(TOOLKIT_GTK)
 #include <gtk/gtk.h>
 #endif
 
@@ -83,7 +83,7 @@
 #include "app/win_util.h"
 #include "chrome/browser/aeropeek_manager.h"
 #include "chrome/browser/jumplist.h"
-#elif defined(OS_LINUX)
+#elif defined(TOOLKIT_GTK)
 #include "chrome/browser/views/accelerator_table_gtk.h"
 #include "views/window/hit_test.h"
 #endif
@@ -1052,7 +1052,7 @@
   std::wstring message = l10n_util::GetString(message_id);
   win_util::MessageBox(GetNativeHandle(), message, title,
                        MB_OK | MB_ICONWARNING | MB_TOPMOST);
-#elif defined(OS_LINUX)
+#elif defined(TOOLKIT_GTK)
   std::string title = l10n_util::GetStringUTF8(IDS_PRODUCT_NAME);
   std::string message = l10n_util::GetStringUTF8(message_id);
   GtkWidget* dialog = gtk_message_dialog_new(GetNativeHandle(),
@@ -1935,7 +1935,7 @@
 #endif  // No need to invoke SetFullscreen for linux as this code is executed
         // once we're already fullscreen on linux.
 
-#if defined(OS_LINUX)
+#if defined(TOOLKIT_GTK)
   // Updating of commands for fullscreen mode is called from SetFullScreen on
   // Wndows (see just above), but for ChromeOS, this method (ProcessFullScreen)
   // is called after full screen has happened successfully (via GTK's
Index: src/chrome/browser/views/dropdown_bar_host.cc
===================================================================
--- chrome/browser/views/dropdown_bar_host.cc	(revision 42139)
+++ chrome/browser/views/dropdown_bar_host.cc	(working copy)
@@ -20,7 +20,7 @@
 #include "views/focus/view_storage.h"
 #include "views/widget/widget.h"
 
-#if defined(OS_LINUX)
+#if defined(TOOLKIT_GTK)
 #include "app/scoped_handle_gtk.h"
 #endif
 
Index: src/chrome/browser/views/download_item_view.cc
===================================================================
--- chrome/browser/views/download_item_view.cc	(revision 42139)
+++ chrome/browser/views/download_item_view.cc	(working copy)
@@ -257,7 +257,7 @@
 
     // Extract the file extension (if any).
     FilePath filepath(download->original_name());
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
     std::wstring extension = base::SysNativeMBToWide(filepath.Extension());
 #else
     std::wstring extension = filepath.Extension();
@@ -266,7 +266,7 @@
     // Remove leading '.'
     if (extension.length() > 0)
       extension = extension.substr(1);
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
     std::wstring rootname =
         base::SysNativeMBToWide(filepath.BaseName().RemoveExtension().value());
 #else
Index: src/chrome/browser/views/content_blocked_bubble_contents.cc
===================================================================
--- chrome/browser/views/content_blocked_bubble_contents.cc	(revision 42139)
+++ chrome/browser/views/content_blocked_bubble_contents.cc	(working copy)
@@ -4,7 +4,7 @@
 
 #include "chrome/browser/views/content_blocked_bubble_contents.h"
 
-#if defined(OS_LINUX)
+#if defined(TOOLKIT_GTK)
 #include <gdk/gdk.h>
 #endif
 
@@ -87,7 +87,7 @@
   if (!g_hand_cursor)
     g_hand_cursor = LoadCursor(NULL, IDC_HAND);
   return g_hand_cursor;
-#elif defined(OS_LINUX)
+#elif defined(TOOLKIT_GTK)
   return gdk_cursor_new(GDK_HAND2);
 #endif
 }
Index: src/chrome/browser/views/location_bar_view.cc
===================================================================
--- chrome/browser/views/location_bar_view.cc	(revision 42139)
+++ chrome/browser/views/location_bar_view.cc	(working copy)
@@ -4,7 +4,7 @@
 
 #include "chrome/browser/views/location_bar_view.h"
 
-#if defined(OS_LINUX)
+#if defined(TOOLKIT_GTK)
 #include <gtk/gtk.h>
 #endif
 
Index: src/chrome/browser/views/info_bubble.cc
===================================================================
--- chrome/browser/views/info_bubble.cc	(revision 42139)
+++ chrome/browser/views/info_bubble.cc	(working copy)
@@ -216,7 +216,7 @@
 
 InfoBubble::InfoBubble()
     :
-#if defined(OS_LINUX)
+#if defined(TOOLKIT_GTK)
       WidgetGtk(TYPE_WINDOW),
 #endif
       delegate_(NULL),
@@ -237,7 +237,7 @@
   set_window_style(WS_POPUP | WS_CLIPCHILDREN);
   set_window_ex_style(WS_EX_TOOLWINDOW);
   WidgetWin::Init(parent->GetNativeWindow(), gfx::Rect());
-#elif defined(OS_LINUX)
+#elif defined(TOOLKIT_GTK)
   MakeTransparent();
   make_transient_to_parent();
   WidgetGtk::Init(GTK_WIDGET(parent->GetNativeWindow()), gfx::Rect());
@@ -310,7 +310,7 @@
 #if defined(OS_WIN)
   border_->ShowWindow(SW_SHOW);
   ShowWindow(SW_SHOW);
-#elif defined(OS_LINUX)
+#elif defined(TOOLKIT_GTK)
   views::WidgetGtk::Show();
 #endif
 }
@@ -325,7 +325,7 @@
     GetRootView()->GetChildViewAt(0)->RequestFocus();
   }
 }
-#elif defined(OS_LINUX)
+#elif defined(TOOLKIT_GTK)
 void InfoBubble::IsActiveChanged() {
   if (!IsActive())
     Close();
@@ -342,7 +342,7 @@
 #if defined(OS_WIN)
   border_->Close();
   WidgetWin::Close();
-#elif defined(OS_LINUX)
+#elif defined(TOOLKIT_GTK)
   WidgetGtk::Close();
 #endif
 }
Index: src/chrome/browser/views/notifications/balloon_view_host.cc
===================================================================
--- chrome/browser/views/notifications/balloon_view_host.cc	(revision 42139)
+++ chrome/browser/views/notifications/balloon_view_host.cc	(working copy)
@@ -17,7 +17,7 @@
 #if defined(OS_WIN)
 #include "chrome/browser/renderer_host/render_widget_host_view_win.h"
 #endif
-#if defined(OS_LINUX)
+#if defined(TOOLKIT_GTK)
 #include "chrome/browser/renderer_host/render_widget_host_view_gtk.h"
 #endif
 #include "chrome/browser/renderer_host/site_instance.h"
@@ -31,7 +31,7 @@
 #if defined(OS_WIN)
 #include "views/widget/widget_win.h"
 #endif
-#if defined(OS_LINUX)
+#if defined(TOOLKIT_GTK)
 #include "views/widget/widget_gtk.h"
 #endif
 
@@ -149,7 +149,7 @@
   HWND hwnd = view_win->Create(parent_hwnd);
   view_win->ShowWindow(SW_SHOW);
   Attach(hwnd);
-#elif defined(OS_LINUX)
+#elif defined(TOOLKIT_GTK)
   RenderWidgetHostViewGtk* view_gtk =
       static_cast<RenderWidgetHostViewGtk*>(view);
   view_gtk->InitAsChild();
Index: src/chrome/browser/views/notifications/balloon_view.cc
===================================================================
--- chrome/browser/views/notifications/balloon_view.cc	(revision 42139)
+++ chrome/browser/views/notifications/balloon_view.cc	(working copy)
@@ -35,7 +35,7 @@
 #if defined(OS_WIN)
 #include "views/widget/widget_win.h"
 #endif
-#if defined(OS_LINUX)
+#if defined(TOOLKIT_GTK)
 #include "views/widget/widget_gtk.h"
 #endif
 
Index: src/chrome/browser/views/bug_report_view.cc
===================================================================
--- chrome/browser/views/bug_report_view.cc	(revision 42139)
+++ chrome/browser/views/bug_report_view.cc	(working copy)
@@ -30,7 +30,7 @@
 #include "views/window/client_view.h"
 #include "views/window/window.h"
 
-#if defined(OS_LINUX)
+#if defined(USE_X11)
 #include "app/x11_util.h"
 #else
 #include "app/win_util.h"
@@ -98,7 +98,7 @@
   // rendered--do not re-render, and include windowed plugins).
   std::vector<unsigned char> *screenshot_png = new std::vector<unsigned char>;
 
-#if defined(OS_LINUX)
+#if defined(USE_X11)
   x11_util::GrabWindowSnapshot(parent->GetNativeWindow(), screenshot_png);
 #else
   win_util::GrabWindowSnapshot(parent->GetNativeWindow(), screenshot_png);
@@ -167,7 +167,7 @@
 
   description_label_ = new views::Label(
       l10n_util::GetString(IDS_BUGREPORT_DESCRIPTION_LABEL));
-#if defined(OS_LINUX)
+#if defined(TOOLKIT_GTK)
   // TODO(davemoore) Remove this when gtk textfields support multiline.
   description_text_ = new views::Textfield;
 #else
Index: src/chrome/browser/views/create_application_shortcut_view.cc
===================================================================
--- chrome/browser/views/create_application_shortcut_view.cc	(revision 42139)
+++ chrome/browser/views/create_application_shortcut_view.cc	(working copy)
@@ -267,7 +267,7 @@
         l10n_util::GetString(IDS_PIN_TO_TASKBAR_CHKBOX) :
         l10n_util::GetString(IDS_CREATE_SHORTCUTS_QUICK_LAUNCH_BAR_CHKBOX),
       profile->GetPrefs()->GetBoolean(prefs::kWebAppCreateInQuickLaunchBar));
-#elif defined(OS_LINUX)
+#elif defined(OS_NIX)
   menu_check_box_ = AddCheckbox(
       l10n_util::GetString(IDS_CREATE_SHORTCUTS_MENU_CHKBOX),
       profile->GetPrefs()->GetBoolean(prefs::kWebAppCreateInAppsMenu));
Index: src/chrome/browser/child_process_host.cc
===================================================================
--- chrome/browser/child_process_host.cc	(revision 42139)
+++ chrome/browser/child_process_host.cc	(working copy)
@@ -26,9 +26,9 @@
 #include "chrome/common/result_codes.h"
 #include "chrome/installer/util/google_update_settings.h"
 
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
 #include "base/linux_util.h"
-#endif  // OS_LINUX
+#endif  // OS_NIX
 
 #if defined(OS_POSIX)
 // This is defined in chrome/browser/google_update_settings_posix.cc.  It's the
Index: src/chrome/browser/browser_theme_provider.h
===================================================================
--- chrome/browser/browser_theme_provider.h	(revision 42139)
+++ chrome/browser/browser_theme_provider.h	(working copy)
@@ -129,7 +129,7 @@
   virtual bool ShouldUseNativeFrame() const;
   virtual bool HasCustomImage(int id) const;
   virtual RefCountedMemory* GetRawData(int id) const;
-#if defined(OS_LINUX)
+#if defined(TOOLKIT_USES_GTK)
   virtual GdkPixbuf* GetPixbufNamed(int id) const;
   virtual GdkPixbuf* GetRTLEnabledPixbufNamed(int id) const;
 #elif defined(OS_MACOSX)
@@ -233,12 +233,12 @@
   // Remove preference values for themes that are no longer in use.
   void RemoveUnusedThemes();
 
-#if defined(OS_LINUX)
+#if defined(TOOLKIT_GTK)
   // Loads an image and flips it horizontally if |rtl_enabled| is true.
   GdkPixbuf* GetPixbufImpl(int id, bool rtl_enabled) const;
 #endif
 
-#if defined(OS_LINUX)
+#if defined(TOOLKIT_GTK)
   typedef std::map<int, GdkPixbuf*> GdkPixbufMap;
   mutable GdkPixbufMap gdk_pixbufs_;
 #elif defined(OS_MACOSX)
Index: src/chrome/browser/sync/notifier/base/network_status_detector_task_mt.cc
===================================================================
--- chrome/browser/sync/notifier/base/network_status_detector_task_mt.cc	(revision 42139)
+++ chrome/browser/sync/notifier/base/network_status_detector_task_mt.cc	(working copy)
@@ -25,6 +25,7 @@
 
 void NetworkStatusDetectorTaskMT::StartAsyncDetection(
     PlatformNetworkInfo* previous_info) {
+#if !defined(OS_OPENBSD)
   // Use the AsyncNetworkAlive to determine the network state (and changes in
   // the network state).
   AsyncNetworkAlive* network_alive = AsyncNetworkAlive::Create();
@@ -37,6 +38,7 @@
   task->SignalWorkDone.connect(
       this, &NetworkStatusDetectorTaskMT::OnNetworkAliveDone);
   task->Start();
+#endif
 }
 
 NetworkStatusDetectorTask* NetworkStatusDetectorTask::Create(
Index: src/chrome/browser/sync/notifier/base/nethelpers.cc
===================================================================
--- chrome/browser/sync/notifier/base/nethelpers.cc	(revision 42139)
+++ chrome/browser/sync/notifier/base/nethelpers.cc	(working copy)
@@ -16,11 +16,16 @@
   if (!result) {
     *herrno = WSAGetLastError();
   }
-#elif OS_LINUX
-  gethostbyname_r(hostname, host, buffer, buffer_len, &result, herrno);
+#elif OS_POSIX
+#ifdef OS_OPENBSD
+  // OpenBSD does not have gethostbyname_r currently (as of 4.6)
+  result = gethostbyname(hostname);
 #elif OS_MACOSX
   result = getipnodebyname(hostname, AF_INET, AI_DEFAULT, herrno);
 #else
+  gethostbyname_r(hostname, host, buffer, buffer_len, &result, herrno);
+#endif
+#else
 #error "I don't know how to do gethostbyname safely on your system."
 #endif
   return result;
@@ -31,10 +36,10 @@
 void FreeHostEnt(hostent* host) {
 #if WIN32
   // No need to free anything, struct returned is static memory.
-#elif OS_LINUX
-  // No need to free anything, we pass in a pointer to a struct.
 #elif OS_MACOSX
   freehostent(host);
+#elif OS_POSIX
+  // No need to free anything, we pass in a pointer to a struct.
 #else
 #error "I don't know how to free a hostent on your system."
 #endif
Index: src/chrome/browser/sync/syncable/syncable.cc
===================================================================
--- chrome/browser/sync/syncable/syncable.cc	(revision 42139)
+++ chrome/browser/sync/syncable/syncable.cc	(working copy)
@@ -79,7 +79,7 @@
   LARGE_INTEGER n;
   memcpy(&n, &filetime, sizeof(filetime));
   return n.QuadPart;
-#elif defined(OS_LINUX) || defined(OS_MACOSX)
+#elif defined(OS_POSIX)
   struct timeval tv;
   gettimeofday(&tv, NULL);
   return static_cast<int64>(tv.tv_sec);
Index: src/chrome/browser/sync/engine/syncer_thread.cc
===================================================================
--- chrome/browser/sync/engine/syncer_thread.cc	(revision 42139)
+++ chrome/browser/sync/engine/syncer_thread.cc	(working copy)
@@ -215,7 +215,7 @@
   bool initial_sync_for_thread = true;
   bool continue_sync_cycle = false;
 
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
   idle_query_.reset(new IdleQueryLinux());
 #endif
 
@@ -294,7 +294,7 @@
         static_cast<int>(vault_.current_wait_interval_.poll_delta.InSeconds()),
         &user_idle_milliseconds, &continue_sync_cycle, nudged);
   }
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
   idle_query_.reset();
 #endif
 }
@@ -695,7 +695,7 @@
   } else {
     return idle_time / 1000000;  // nano to milli
   }
-#elif defined(OS_LINUX)
+#elif defined(OS_NIX)
   if (idle_query_.get()) {
     return idle_query_->IdleTime();
   } else {
Index: src/chrome/browser/sync/engine/syncer_thread.h
===================================================================
--- chrome/browser/sync/engine/syncer_thread.h	(revision 42139)
+++ chrome/browser/sync/engine/syncer_thread.h	(working copy)
@@ -21,7 +21,7 @@
 #include "base/time.h"
 #include "base/waitable_event.h"
 #include "chrome/browser/sync/engine/all_status.h"
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
 #include "chrome/browser/sync/engine/idle_query_linux.h"
 #endif
 #include "chrome/browser/sync/sessions/sync_session.h"
@@ -310,7 +310,7 @@
   scoped_ptr<EventListenerHookup> directory_manager_hookup_;
   scoped_ptr<EventListenerHookup> syncer_events_;
 
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
   // On Linux, we need this information in order to query idle time.
   scoped_ptr<IdleQueryLinux> idle_query_;
 #endif
Index: src/chrome/browser/find_bar_host_browsertest.cc
===================================================================
--- chrome/browser/find_bar_host_browsertest.cc	(revision 42139)
+++ chrome/browser/find_bar_host_browsertest.cc	(working copy)
@@ -646,7 +646,7 @@
 
 #if defined(TOOLKIT_VIEWS)
 // Make sure Find box grabs the Esc accelerator and restores it again.
-#if defined(OS_LINUX)
+#if defined(USE_X11)
 // TODO(oshima): On Gtk/Linux, a focus out event is asynchronous and
 // hiding a find bar does not immediately update the target
 // accelerator. The last condition fails in most cases due to this
@@ -669,7 +669,7 @@
   // GetNativeView / GetNativewWindow methods on BrowserWindow.
   // See http://crbug.com/26873.
   gfx::NativeView browser_view = browser()->window()->GetNativeHandle();
-#elif defined(OS_LINUX)
+#elif defined(TOOLKIT_GTK)
   gfx::NativeView browser_view =
       GTK_WIDGET(browser()->window()->GetNativeHandle());
 #else
Index: src/chrome/browser/zygote_host_linux.cc
===================================================================
--- chrome/browser/zygote_host_linux.cc	(revision 42139)
+++ chrome/browser/zygote_host_linux.cc	(working copy)
@@ -70,7 +70,12 @@
                                  switches::kZygoteProcess);
 
   int fds[2];
+#if defined(OS_OPENBSD)
+  if (socketpair(PF_UNIX, SOCK_SEQPACKET, 0, fds) != 0)
+    CHECK(socketpair(PF_UNIX, SOCK_DGRAM, 0, fds) == 0);
+#else
   CHECK(socketpair(PF_UNIX, SOCK_SEQPACKET, 0, fds) == 0);
+#endif
   base::file_handle_mapping_vector fds_to_map;
   fds_to_map.push_back(std::make_pair(fds[1], 3));
 
@@ -215,6 +220,7 @@
     return base::kNullProcessHandle;
 
   const int kRendererScore = 5;
+#if defined(OS_LINUX)
   if (using_suid_sandbox_) {
     base::ProcessHandle sandbox_helper_process;
     base::file_handle_mapping_vector dummy_map;
@@ -232,6 +238,7 @@
   } else {
     base::AdjustOOMScore(pid, kRendererScore);
   }
+#endif  // defined(OS_LINUX)
 
   return pid;
 }
Index: src/chrome/browser/cookie_modal_dialog.h
===================================================================
--- chrome/browser/cookie_modal_dialog.h	(revision 42139)
+++ chrome/browser/cookie_modal_dialog.h	(working copy)
@@ -58,7 +58,7 @@
   static void RegisterPrefs(PrefService* prefs);
 
   // AppModalDialog overrides.
-#if defined(OS_LINUX) || defined(OS_MACOSX)
+#if defined(OS_POSIX)
   virtual void CreateAndShowDialog();
 #endif
   virtual int GetDialogButtons();
@@ -85,7 +85,7 @@
  protected:
   // AppModalDialog overrides.
   virtual NativeDialog CreateNativeDialog();
-#if defined(OS_LINUX)
+#if defined(TOOLKIT_GTK)
   virtual void HandleDialogResponse(GtkDialog* dialog, gint response_id);
 #endif
 
@@ -119,7 +119,7 @@
   // delegate could be deleted
   CookiePromptModalDialogDelegate* delegate_;
 
-#if defined(OS_LINUX)
+#if defined(TOOLKIT_GTK)
   // The "remember this choice" radio button in the dialog.
   GtkWidget* remember_radio_;
 #endif
Index: src/chrome/browser/shell_integration_linux.cc
===================================================================
--- chrome/browser/shell_integration_linux.cc	(revision 42139)
+++ chrome/browser/shell_integration_linux.cc	(working copy)
@@ -131,6 +131,8 @@
   if (!PathService::Get(chrome::DIR_USER_DESKTOP, &desktop_path))
     return;
 
+#if !defined(OS_OPENBSD)
+// BSD: Linux-specific calls like openat are used so defined out for BSD.
   int desktop_fd = open(desktop_path.value().c_str(), O_RDONLY | O_DIRECTORY);
   if (desktop_fd < 0)
     return;
@@ -156,6 +158,7 @@
   }
 
   HANDLE_EINTR(close(desktop_fd));
+#endif  // !defined(OS_OPENBSD)
 }
 
 void CreateShortcutInApplicationsMenu(const FilePath& shortcut_filename,
Index: src/chrome/browser/web_applications/web_app.cc
===================================================================
--- chrome/browser/web_applications/web_app.cc	(revision 42139)
+++ chrome/browser/web_applications/web_app.cc	(working copy)
@@ -31,9 +31,9 @@
 #include "chrome/common/url_constants.h"
 #include "webkit/glue/dom_operations.h"
 
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
 #include "base/linux_util.h"
-#endif  // defined(OS_LINUX)
+#endif  // defined(OS_NIX)
 
 #if defined(OS_WIN)
 #include "base/win_util.h"
@@ -259,7 +259,7 @@
 bool CreateShortcutTask::CreateShortcut() {
   DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
 
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
   scoped_ptr<base::EnvironmentVariableGetter> env_getter(
       base::EnvironmentVariableGetter::Create());
 
Index: src/chrome/browser/unload_uitest.cc
===================================================================
--- chrome/browser/unload_uitest.cc	(revision 42139)
+++ chrome/browser/unload_uitest.cc	(working copy)
@@ -166,7 +166,7 @@
   }
 
   void ClickModalDialogButton(MessageBoxFlags::DialogButton button) {
-#if defined(OS_WIN) || defined(OS_LINUX)
+#if defined(OS_WIN) || defined(OS_NIX)
     bool modal_dialog_showing = false;
     MessageBoxFlags::DialogButton available_buttons;
     EXPECT_TRUE(automation()->WaitForAppModalDialog(action_timeout_ms()));
Index: src/chrome/browser/memory_purger.cc
===================================================================
--- chrome/browser/memory_purger.cc	(revision 42139)
+++ chrome/browser/memory_purger.cc	(working copy)
@@ -137,7 +137,7 @@
   // * Purge AppCache memory.  Not yet implemented sufficiently.
   // * Browser-side DatabaseTracker.  Not implemented sufficiently.
 
-#if (defined(OS_WIN) || defined(OS_LINUX)) && defined(USE_TCMALLOC)
+#if !defined(OS_MACOSX) && defined(USE_TCMALLOC)
   // Tell tcmalloc to release any free pages it's still holding.
   //
   // TODO(pkasting): A lot of the above calls kick off actions on other threads.
Index: src/chrome/browser/tab_contents/render_view_context_menu.cc
===================================================================
--- chrome/browser/tab_contents/render_view_context_menu.cc	(revision 42139)
+++ chrome/browser/tab_contents/render_view_context_menu.cc	(working copy)
@@ -549,7 +549,7 @@
           WebContextMenuData::CheckableMenuItemEnabled;
 #endif  // OS_MACOSX
 
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
     // Enable the input methods context menu if the content is editable.
     // TODO(suzhe): It should not be enabled in password boxes. Anyway,
     // it's not a big issue.
Index: src/chrome/browser/tab_contents/interstitial_page.cc
===================================================================
--- chrome/browser/tab_contents/interstitial_page.cc	(revision 42139)
+++ chrome/browser/tab_contents/interstitial_page.cc	(working copy)
@@ -479,7 +479,7 @@
 }
 
 void InterstitialPage::SetSize(const gfx::Size& size) {
-#if defined(OS_WIN) || defined(OS_LINUX)
+#if defined(OS_WIN) || defined(OS_NIX)
   // When a tab is closed, we might be resized after our view was NULLed
   // (typically if there was an info-bar).
   if (render_view_host_->view())
Index: src/chrome/browser/tab_contents/tab_contents.cc
===================================================================
--- chrome/browser/tab_contents/tab_contents.cc	(revision 42139)
+++ chrome/browser/tab_contents/tab_contents.cc	(working copy)
@@ -319,7 +319,7 @@
                  NotificationService::AllSources());
   registrar_.Add(this, NotificationType::RENDER_WIDGET_HOST_DESTROYED,
                  NotificationService::AllSources());
-#if defined(OS_LINUX)
+#if defined(TOOLKIT_GTK)
   registrar_.Add(this, NotificationType::BROWSER_THEME_CHANGED,
                  NotificationService::AllSources());
 #endif
@@ -2797,7 +2797,7 @@
       break;
     }
 
-#if defined(OS_LINUX)
+#if defined(TOOLKIT_GTK)
     case NotificationType::BROWSER_THEME_CHANGED: {
       renderer_preferences_util::UpdateFromSystemSettings(
           &renderer_preferences_, profile());
Index: src/chrome/browser/browser.cc
===================================================================
--- chrome/browser/browser.cc	(revision 42139)
+++ chrome/browser/browser.cc	(working copy)
@@ -199,7 +199,7 @@
 
   BrowserList::RemoveBrowser(this);
 
-#if defined(OS_WIN) || defined(OS_LINUX)
+#if defined(OS_WIN) || defined(OS_NIX)
   if (!BrowserList::HasBrowserWithProfile(profile_)) {
     // We're the last browser window with this profile. We need to nuke the
     // TabRestoreService, which will start the shutdown of the
@@ -583,7 +583,7 @@
   // On Mac or ChromeOS, we don't want to suffix the page title with
   // the application name.
   return title;
-#elif defined(OS_WIN) || defined(OS_LINUX)
+#elif defined(OS_WIN) || defined(OS_NIX)
   int string_id = IDS_BROWSER_WINDOW_TITLE_FORMAT;
   // Don't append the app name to window titles when we're not displaying a
   // distributor logo for the frame.
@@ -640,7 +640,7 @@
 
   bool exiting = false;
 
-#if defined(OS_WIN) || defined(OS_LINUX)
+#if defined(OS_WIN) || defined(OS_NIX)
   // We don't want to do this on Mac since closing all windows isn't a sign
   // that the app is shutting down.
   if (BrowserList::size() == 1) {
@@ -1127,9 +1127,9 @@
 
   UserMetrics::RecordAction("ToggleFullscreen", profile_);
   window_->SetFullscreen(!window_->IsFullscreen());
-  // On Linux, setting fullscreen mode is an async call to the X server, which
+  // On X11, setting fullscreen mode is an async call to the X server, which
   // may or may not support fullscreen mode.
-#if !defined(OS_LINUX)
+#if !defined(USE_X11)
   UpdateCommandsForFullscreenMode(window_->IsFullscreen());
 #endif
 }
@@ -1931,7 +1931,7 @@
 }
 
 void Browser::CloseFrameAfterDragSession() {
-#if defined(OS_WIN) || defined(OS_LINUX)
+#if defined(OS_WIN) || defined(OS_NIX)
   // This is scheduled to run after we return to the message loop because
   // otherwise the frame will think the drag session is still active and ignore
   // the request.
Index: src/chrome/browser/browser_resources.grd
===================================================================
--- chrome/browser/browser_resources.grd	(revision 42139)
+++ chrome/browser/browser_resources.grd	(working copy)
@@ -14,13 +14,13 @@
       <include name="IDR_ABOUT_PLUGINS_HTML" file="resources\about_plugins.html" type="BINDATA" />
       <include name="IDR_ABOUT_VERSION_HTML" file="resources\about_version.html" flattenhtml="true" type="BINDATA" />
 
-      <if expr="os == 'linux2' or os == 'freebsd7' or os == 'openbsd4'">
+      <if expr="os == 'linux2' or os.find('bsd') != -1">
         <include name="IDR_ABOUT_MEMORY_HTML" file="resources\about_memory_linux.html" flattenhtml="true" type="BINDATA" />
       </if>
       <if expr="os == 'darwin'">
         <include name="IDR_ABOUT_MEMORY_HTML" file="resources\about_memory_mac.html" flattenhtml="true" type="BINDATA" />
       </if>
-      <if expr="os != 'linux2' and os != 'darwin' and os != 'freebsd' and os != 'openbsd'">
+      <if expr="os != 'linux2' and os != 'darwin' and os.find('bsd') == -1">
         <include name="IDR_ABOUT_MEMORY_HTML" file="resources\about_memory.html" flattenhtml="true" type="BINDATA" />
       </if>
 
--- chrome/browser/renderer_host/render_sandbox_host_linux.cc.orig	Mon Mar 29 22:29:15 2010
+++ chrome/browser/renderer_host/render_sandbox_host_linux.cc	Tue Mar 30 17:06:21 2010
@@ -309,7 +309,7 @@
       return;
     }
 
-    uint64_t inode;
+    uint64 inode;
     if (!pickle.ReadUInt64(&iter, &inode))
       return;
 
@@ -397,7 +397,12 @@
   // inherit some sockets. With PF_UNIX+SOCK_DGRAM, it can call sendmsg to send
   // a datagram to any (abstract) socket on the same system. With
   // SOCK_SEQPACKET, this is prevented.
+#if defined(OS_OPENBSD)
+  if (socketpair(AF_UNIX, SOCK_SEQPACKET, 0, fds) != 0)
+    CHECK(socketpair(AF_UNIX, SOCK_DGRAM, 0, fds) == 0);
+#else
   CHECK(socketpair(AF_UNIX, SOCK_SEQPACKET, 0, fds) == 0);
+#endif
 
   renderer_socket_ = fds[0];
   const int browser_socket = fds[1];
Index: src/chrome/browser/renderer_host/render_widget_host_unittest.cc
===================================================================
--- chrome/browser/renderer_host/render_widget_host_unittest.cc	(revision 42139)
+++ chrome/browser/renderer_host/render_widget_host_unittest.cc	(working copy)
@@ -369,7 +369,7 @@
 
 // Tests setting custom background
 TEST_F(RenderWidgetHostTest, Background) {
-#if defined(OS_WIN) || defined(OS_LINUX)
+#if defined(OS_WIN) || defined(OS_NIX)
   scoped_ptr<RenderWidgetHostView> view(
       RenderWidgetHostView::CreateViewForWidget(host_.get()));
   host_->set_view(view.get());
Index: src/chrome/browser/renderer_host/mock_render_process_host.cc
===================================================================
--- chrome/browser/renderer_host/mock_render_process_host.cc	(revision 42139)
+++ chrome/browser/renderer_host/mock_render_process_host.cc	(working copy)
@@ -97,7 +97,7 @@
   // On Mac, TransportDIBs are always created in the browser, so we cannot map
   // one from a dib_id.
   transport_dib_ = TransportDIB::Create(100 * 100 * 4, 0);
-#elif defined(OS_LINUX)
+#elif defined(OS_NIX)
   transport_dib_ = TransportDIB::Map(dib_id);
 #endif
 
Index: src/chrome/browser/renderer_host/render_view_host_delegate.cc
===================================================================
--- chrome/browser/renderer_host/render_view_host_delegate.cc	(revision 42139)
+++ chrome/browser/renderer_host/render_view_host_delegate.cc	(working copy)
@@ -10,7 +10,7 @@
 #include "googleurl/src/gurl.h"
 #include "webkit/glue/webpreferences.h"
 
-#if defined(OS_LINUX)
+#if defined(TOOLKIT_GTK)
 #include "chrome/browser/gtk/gtk_util.h"
 #endif
 
Index: src/chrome/browser/renderer_host/render_widget_host_view.h
===================================================================
--- chrome/browser/renderer_host/render_widget_host_view.h	(revision 42139)
+++ chrome/browser/renderer_host/render_widget_host_view.h	(working copy)
@@ -205,7 +205,7 @@
   virtual void DrawAcceleratedSurfaceInstances(CGLContextObj context) = 0;
 #endif
 
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
   virtual void CreatePluginContainer(gfx::PluginWindowHandle id) = 0;
   virtual void DestroyPluginContainer(gfx::PluginWindowHandle id) = 0;
 #endif
Index: src/chrome/browser/renderer_host/backing_store_x.cc
===================================================================
--- chrome/browser/renderer_host/backing_store_x.cc	(revision 42139)
+++ chrome/browser/renderer_host/backing_store_x.cc	(working copy)
@@ -48,6 +48,9 @@
   XShmDetach(display, shminfo);
   XDestroyImage(image);
   shmdt(shminfo->shmaddr);
+#if defined(OS_OPENBSD)
+  shmctl(shminfo->shmid, IPC_RMID, 0);
+#endif
 }
 
 BackingStoreX::BackingStoreX(RenderWidgetHost* widget,
@@ -304,7 +307,9 @@
     }
 
     void* mapped_memory = shmat(shminfo.shmid, NULL, SHM_RDONLY);
+#if !defined(OS_OPENBSD)
     shmctl(shminfo.shmid, IPC_RMID, 0);
+#endif
     if (mapped_memory == (void*)-1) {
       XDestroyImage(image);
       return false;
Index: src/chrome/browser/renderer_host/test/test_render_view_host.h
===================================================================
--- chrome/browser/renderer_host/test/test_render_view_host.h	(revision 42139)
+++ chrome/browser/renderer_host/test/test_render_view_host.h	(working copy)
@@ -97,7 +97,7 @@
 #endif
   virtual void SetVisuallyDeemphasized(bool deemphasized) { }
 
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
   virtual void CreatePluginContainer(gfx::PluginWindowHandle id) { }
   virtual void DestroyPluginContainer(gfx::PluginWindowHandle id) { }
 #endif
Index: src/chrome/browser/renderer_host/browser_render_process_host.cc
===================================================================
--- chrome/browser/renderer_host/browser_render_process_host.cc	(revision 42139)
+++ chrome/browser/renderer_host/browser_render_process_host.cc	(working copy)
@@ -310,11 +310,11 @@
     in_process_renderer_.reset(new RendererMainThread(channel_id));
 
     base::Thread::Options options;
-#if !defined(OS_LINUX)
+#if !defined(USE_X11)
     // In-process plugins require this to be a UI message loop.
     options.message_loop_type = MessageLoop::TYPE_UI;
 #else
-    // We can't have multiple UI loops on Linux, so we don't support
+    // We can't have multiple UI loops on X, so we don't support
     // in-process plugins.
     options.message_loop_type = MessageLoop::TYPE_DEFAULT;
 #endif
@@ -693,9 +693,9 @@
   // On OSX, the browser allocates all DIBs and keeps a file descriptor around
   // for each.
   return widget_helper_->MapTransportDIB(dib_id);
-#elif defined(OS_LINUX)
+#elif defined(OS_NIX)
   return TransportDIB::Map(dib_id);
-#endif  // defined(OS_LINUX)
+#endif  // defined(OS_NIX)
 }
 
 TransportDIB* BrowserRenderProcessHost::GetTransportDIB(
Index: src/chrome/browser/renderer_host/render_widget_host.cc
===================================================================
--- chrome/browser/renderer_host/render_widget_host.cc	(revision 42139)
+++ chrome/browser/renderer_host/render_widget_host.cc	(working copy)
@@ -141,7 +141,7 @@
     IPC_MESSAGE_HANDLER(ViewHostMsg_ImeUpdateStatus, OnMsgImeUpdateStatus)
     IPC_MESSAGE_HANDLER(ViewHostMsg_EstablishGpuChannel,
         OnMsgEstablishGpuChannel)
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
     IPC_MESSAGE_HANDLER(ViewHostMsg_CreatePluginContainer,
                         OnMsgCreatePluginContainer)
     IPC_MESSAGE_HANDLER(ViewHostMsg_DestroyPluginContainer,
@@ -873,7 +873,7 @@
   GpuProcessHost::Get()->EstablishGpuChannel(process_->id(), routing_id_);
 }
 
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
 
 void RenderWidgetHost::OnMsgCreatePluginContainer(gfx::PluginWindowHandle id) {
   // TODO(piman): view_ can only be NULL with delayed view creation in
Index: src/chrome/browser/renderer_host/render_widget_host.h
===================================================================
--- chrome/browser/renderer_host/render_widget_host.h	(revision 42139)
+++ chrome/browser/renderer_host/render_widget_host.h	(working copy)
@@ -449,7 +449,7 @@
   // channel.
   void OnMsgEstablishGpuChannel();
 
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
   void OnMsgCreatePluginContainer(gfx::PluginWindowHandle id);
   void OnMsgDestroyPluginContainer(gfx::PluginWindowHandle id);
 #elif defined(OS_MACOSX)
Index: src/chrome/browser/geolocation/empty_device_data_provider.cc
===================================================================
--- chrome/browser/geolocation/empty_device_data_provider.cc	(revision 42139)
+++ chrome/browser/geolocation/empty_device_data_provider.cc	(working copy)
@@ -12,7 +12,7 @@
 }
 
 // Only define for platforms that lack a real wifi data provider.
-#if !defined(OS_WIN) && !defined(OS_MACOSX) && !defined(OS_LINUX)
+#if !defined(OS_WIN) && !defined(OS_MACOSX) && !defined(OS_NIX)
 // static
 template<>
 WifiDataProviderImplBase* WifiDataProvider::DefaultFactoryFunction() {
Index: src/chrome/browser/memory_details.cc
===================================================================
--- chrome/browser/memory_details.cc	(revision 42139)
+++ chrome/browser/memory_details.cc	(working copy)
@@ -18,7 +18,7 @@
 #include "chrome/common/url_constants.h"
 #include "grit/chromium_strings.h"
 
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
 #include "chrome/browser/zygote_host_linux.h"
 #include "chrome/browser/renderer_host/render_sandbox_host_linux.h"
 #endif
@@ -73,7 +73,7 @@
 void MemoryDetails::CollectChildInfoOnUIThread() {
   DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
 
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
   const pid_t zygote_pid = Singleton<ZygoteHost>()->pid();
   const pid_t sandbox_helper_pid = Singleton<RenderSandboxHostLinux>()->pid();
 #endif
@@ -152,7 +152,7 @@
       }
     }
 
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
     if (process.pid == zygote_pid) {
       process.type = ChildProcessInfo::ZYGOTE_PROCESS;
     } else if (process.pid == sandbox_helper_pid) {
Index: src/chrome/browser/download/download_util.cc
===================================================================
--- chrome/browser/download/download_util.cc	(revision 42139)
+++ chrome/browser/download/download_util.cc	(working copy)
@@ -41,14 +41,14 @@
 #include "views/drag_utils.h"
 #endif
 
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
 #if defined(TOOLKIT_VIEWS)
 #include "app/drag_drop_types.h"
 #include "views/widget/widget_gtk.h"
 #elif defined(TOOLKIT_GTK)
 #include "chrome/browser/gtk/custom_drag.h"
 #endif  // defined(TOOLKIT_GTK)
-#endif  // defined(OS_LINUX)
+#endif  // defined(OS_NIX)
 
 #if defined(OS_WIN)
 #include "app/os_exchange_data_provider_win.h"
@@ -334,7 +334,7 @@
   DWORD effects;
   DoDragDrop(OSExchangeDataProviderWin::GetIDataObject(data), drag_source.get(),
              DROPEFFECT_COPY | DROPEFFECT_LINK, &effects);
-#elif defined(OS_LINUX)
+#elif defined(TOOLKIT_GTK)
   GtkWidget* root = gtk_widget_get_toplevel(view);
   if (!root)
     return;
@@ -345,13 +345,13 @@
   widget->DoDrag(data, DragDropTypes::DRAG_COPY | DragDropTypes::DRAG_LINK);
 #endif  // OS_WIN
 }
-#elif defined(OS_LINUX)
+#elif defined(USE_X11)
 void DragDownload(const DownloadItem* download,
                   SkBitmap* icon,
                   gfx::NativeView view) {
   DownloadItemDrag::BeginDrag(download, icon);
 }
-#endif  // OS_LINUX
+#endif // USE_X11
 
 DictionaryValue* CreateDownloadItemValue(DownloadItem* download, int id) {
   DictionaryValue* file_value = new DictionaryValue();
Index: src/chrome/browser/task_manager_resource_providers.cc
===================================================================
--- chrome/browser/task_manager_resource_providers.cc	(revision 42139)
+++ chrome/browser/task_manager_resource_providers.cc	(working copy)
@@ -710,7 +710,7 @@
       default_icon_ = IconUtil::CreateSkBitmapFromHICON(icon, icon_size);
     }
   }
-#elif defined(OS_LINUX)
+#elif defined(OS_NIX)
   if (!default_icon_) {
     ResourceBundle& rb = ResourceBundle::GetSharedInstance();
     default_icon_ = rb.GetBitmapNamed(IDR_PRODUCT_LOGO_16);
Index: src/chrome/browser/zygote_main_linux.cc
===================================================================
--- chrome/browser/zygote_main_linux.cc	(revision 42139)
+++ chrome/browser/zygote_main_linux.cc	(working copy)
@@ -2,11 +2,17 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
+#include "build/build_config.h"
+
 #include <dlfcn.h>
 #include <fcntl.h>
+#if defined(OS_OPENBSD)
+#include <signal.h>
+#else
 #include <sys/epoll.h>
 #include <sys/prctl.h>
 #include <sys/signal.h>
+#endif
 #include <sys/socket.h>
 #include <sys/stat.h>
 #include <sys/types.h>
@@ -47,7 +53,7 @@
 
 #include "unicode/timezone.h"
 
-#if defined(ARCH_CPU_X86_FAMILY) && !defined(CHROMIUM_SELINUX)
+#if defined(ARCH_CPU_X86_FAMILY) && defined(OS_LINUX) && !defined(CHROMIUM_SELINUX)
 // The seccomp sandbox is enabled on all ia32 and x86-64 processor as long as
 // we aren't using SELinux.
 #define SECCOMP_SANDBOX
@@ -207,7 +213,11 @@
     int argc, numfds;
     base::GlobalDescriptors::Mapping mapping;
     base::ProcessId child;
+#if defined(OS_OPENBSD)
+    uint32_t dummy_inode = 0;
+#elif
     uint64_t dummy_inode = 0;
+#endif
     int dummy_fd = -1;
 
     if (!pickle.ReadInt(&iter, &argc))
@@ -250,10 +260,13 @@
 #if defined(SECCOMP_SANDBOX)
       // Try to open /proc/self/maps as the seccomp sandbox needs access to it
       if (g_proc_fd >= 0) {
+#if defined(OS_LINUX)
+// BSD: Removing all Seccomp Sandbox code if not on linux
         int proc_self_maps = openat(g_proc_fd, "self/maps", O_RDONLY);
         if (proc_self_maps >= 0) {
           SeccompSandboxSetProcSelfMaps(proc_self_maps);
         }
+#endif
         close(g_proc_fd);
         g_proc_fd = -1;
       }
@@ -544,6 +557,8 @@
 
     SkiaFontConfigUseIPCImplementation(kMagicSandboxIPCDescriptor);
 
+    // TODO(benl): Do something for FreeBSD...
+#if !defined(OS_OPENBSD)
     // Previously, we required that the binary be non-readable. This causes the
     // kernel to mark the process as non-dumpable at startup. The thinking was
     // that, although we were putting the renderers into a PID namespace (with
@@ -569,6 +584,7 @@
         return false;
       }
     }
+#endif
   } else {
     SkiaFontConfigUseDirectImplementation();
   }
Index: src/chrome/browser/search_engines/template_url_prepopulate_data.cc
===================================================================
--- chrome/browser/search_engines/template_url_prepopulate_data.cc	(revision 42139)
+++ chrome/browser/search_engines/template_url_prepopulate_data.cc	(working copy)
@@ -4,7 +4,7 @@
 
 #include "chrome/browser/search_engines/template_url_prepopulate_data.h"
 
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
 #include <locale.h>
 #endif
 
Index: src/chrome/chrome_browser.gypi
===================================================================
--- chrome/chrome_browser.gypi	(revision 42139)
+++ chrome/chrome_browser.gypi	(working copy)
@@ -2373,7 +2373,7 @@
             ['exclude', '^browser/chromeos'],
           ],
         }],
-        ['OS=="linux"', {
+        ['OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
           'dependencies': [
             '../build/linux/system.gyp:dbus-glib',
             # Temporarily disabled while we figure some stuff out.
@@ -2384,12 +2384,6 @@
             '../build/linux/system.gyp:nss',
             '../base/base.gyp:linux_versioninfo',
           ],
-          'link_settings': {
-            'libraries': [
-              # For dlsym() in 'browser/zygote_main_linux.cc'
-              '-ldl',
-            ],
-          },
           'sources!': [
              # Exclude extension shelf for toolstrips.
             'browser/views/extensions/extension_shelf.cc',
@@ -2436,7 +2430,7 @@
             'browser/file_watcher_inotify.cc',
           ],
         }],
-        ['OS=="freebsd" or OS=="openbsd"', {
+        ['OS=="freebsd" or OS=="freebsd" or OS=="openbsd"', {
           'dependencies': [
             '../build/linux/system.gyp:gtk',
             '../build/linux/system.gyp:gtkprint',
@@ -2445,6 +2439,9 @@
           'sources': [
             'browser/file_watcher_stub.cc',
           ],
+          'sources!': [
+            'browser/file_watcher_inotify.cc',
+          ],
         }],
         ['OS=="mac"', {
           'sources!': [
@@ -2940,7 +2937,7 @@
               ],
             }],
             # GTK build only
-            ['OS=="linux" and chromeos==0 and toolkit_views==0', {
+            ['(OS=="linux" or OS=="freebsd" or OS=="openbsd") and chromeos==0 and toolkit_views==0', {
               'sources/': [
                 ['include', '^browser/printing/print_dialog_gtk.cc'],
                 ['include', '^browser/printing/print_dialog_gtk.h'],
Index: src/chrome/common/chrome_constants.cc
===================================================================
--- chrome/common/chrome_constants.cc	(revision 42139)
+++ chrome/common/chrome_constants.cc	(working copy)
@@ -27,7 +27,7 @@
 #if defined(OS_WIN)
 const wchar_t kBrowserProcessExecutableName[] = L"chrome.exe";
 const wchar_t kHelperProcessExecutableName[] = L"chrome.exe";
-#elif defined(OS_LINUX)
+#elif defined(OS_NIX)
 const wchar_t kBrowserProcessExecutableName[] = L"chrome";
 // Helper processes end up with a name of "exe" due to execing via
 // /proc/self/exe.  See bug 22703.
@@ -39,7 +39,7 @@
 #if defined(OS_WIN)
 const wchar_t kBrowserProcessExecutablePath[] = L"chrome.exe";
 const FilePath::CharType kHelperProcessExecutablePath[] = FPL("chrome.exe");
-#elif defined(OS_LINUX)
+#elif defined(OS_NIX)
 const wchar_t kBrowserProcessExecutablePath[] = L"chrome";
 const FilePath::CharType kHelperProcessExecutablePath[] = FPL("chrome");
 #elif defined(OS_MACOSX)
Index: src/chrome/common/native_web_keyboard_event.h
===================================================================
--- chrome/common/native_web_keyboard_event.h	(revision 42139)
+++ chrome/common/native_web_keyboard_event.h	(working copy)
@@ -32,7 +32,7 @@
   NativeWebKeyboardEvent(wchar_t character,
                          int state,
                          double time_stamp_seconds);
-#elif defined(OS_LINUX)
+#elif defined(TOOLKIT_GTK)
   explicit NativeWebKeyboardEvent(const GdkEventKey* event);
   NativeWebKeyboardEvent(wchar_t character,
                          int state,
@@ -48,7 +48,7 @@
   MSG os_event;
 #elif defined(OS_MACOSX)
   NSEvent* os_event;
-#elif defined(OS_LINUX)
+#elif defined(TOOLKIT_GTK)
   GdkEventKey* os_event;
 #endif
 
Index: src/chrome/common/chrome_paths.cc
===================================================================
--- chrome/common/chrome_paths.cc	(revision 42139)
+++ chrome/common/chrome_paths.cc	(working copy)
@@ -132,7 +132,7 @@
       cur = cur.Append(FILE_PATH_LITERAL("inspector"));
       break;
     case chrome::DIR_APP_DICTIONARIES:
-#if defined(OS_LINUX) || defined(OS_MACOSX)
+#if defined(OS_POSIX)
       // We can't write into the EXE dir on Linux, so keep dictionaries
       // alongside the safe browsing database in the user data dir.
       // And we don't want to write into the bundle on the Mac, so push
Index: src/chrome/common_constants.gypi
===================================================================
--- chrome/common_constants.gypi	(revision 42139)
+++ chrome/common_constants.gypi	(working copy)
@@ -63,7 +63,7 @@
         '../base/base.gyp:base',
       ],
       'conditions': [
-        ['OS=="linux"', {
+        ['OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
           'dependencies': ['../build/linux/system.gyp:gtk'],
         }],
       ],
Index: src/chrome/gpu/x_util.h
===================================================================
--- chrome/gpu/x_util.h	(revision 42139)
+++ chrome/gpu/x_util.h	(working copy)
@@ -11,7 +11,7 @@
 #include "build/build_config.h"
 #include "chrome/gpu/gpu_config.h"
 
-#if defined(OS_LINUX)
+#if defined(USE_X11)
 
 // Forward declares ------------------------------------------------------------
 //
@@ -41,6 +41,6 @@
   void operator()(void* x) const;
 };
 
-#endif  // OS_LINUX
+#endif  // USE_X11
 
 #endif  // CHROME_GPU_X_UTIL_H_
Index: src/chrome/installer/installer_util.gypi
===================================================================
--- chrome/installer/installer_util.gypi	(revision 42139)
+++ chrome/installer/installer_util.gypi	(working copy)
@@ -123,7 +123,7 @@
         },
       ],
     }],
-    ['OS=="linux"', {
+    ['OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
       'targets': [
         {
           'target_name': 'installer_util',
Index: src/chrome/plugin/plugin_main_linux.cc
===================================================================
--- chrome/plugin/plugin_main_linux.cc	(revision 42139)
+++ chrome/plugin/plugin_main_linux.cc	(working copy)
@@ -11,7 +11,7 @@
 #include "build/build_config.h"
 
 // This whole file is only useful on 64-bit architectures.
-#if defined(ARCH_CPU_64_BITS)
+#if defined(ARCH_CPU_64_BITS) && !defined(OS_OPENBSD)
 
 namespace {
 
Index: src/chrome/plugin/plugin_thread.cc
===================================================================
--- chrome/plugin/plugin_thread.cc	(revision 42139)
+++ chrome/plugin/plugin_thread.cc	(working copy)
@@ -6,7 +6,7 @@
 
 #include "build/build_config.h"
 
-#if defined(OS_LINUX)
+#if defined(TOOLKIT_GTK)
 #include <gtk/gtk.h>
 #endif
 
@@ -46,7 +46,7 @@
           switches::kPluginPath);
 
   lazy_tls.Pointer()->Set(this);
-#if defined(OS_LINUX)
+#if defined(TOOLKIT_GTK)
   {
     // XEmbed plugins assume they are hosted in a Gtk application, so we need
     // to initialize Gtk in the plugin process.
@@ -216,7 +216,7 @@
 bool IsDefaultPluginEnabled() {
 #if defined(OS_WIN)
   return true;
-#elif defined(OS_LINUX)
+#elif defined(OS_NIX)
   // http://code.google.com/p/chromium/issues/detail?id=10952
   return false;
 #elif defined(OS_MACOSX)
Index: src/chrome/tools/build/linux/sed.sh
===================================================================
--- chrome/tools/build/linux/sed.sh	(revision 42139)
+++ chrome/tools/build/linux/sed.sh	(working copy)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # Copyright (c) 2009 The Chromium Authors. All rights reserved.
 # Use of this source code is governed by a BSD-style license that can be
Index: src/chrome/renderer/render_process.cc
===================================================================
--- chrome/renderer/render_process.cc	(revision 42139)
+++ chrome/renderer/render_process.cc	(working copy)
@@ -128,7 +128,7 @@
 
 bool RenderProcess::InProcessPlugins() {
   const CommandLine& command_line = *CommandLine::ForCurrentProcess();
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
   // Plugin processes require a UI message loop, and the Linux message loop
   // implementation only allows one UI loop per process.
   if (command_line.HasSwitch(switches::kInProcessPlugins))
@@ -166,10 +166,10 @@
 // Platform specific code for dealing with bitmap transport...
 
 TransportDIB* RenderProcess::CreateTransportDIB(size_t size) {
-#if defined(OS_WIN) || defined(OS_LINUX)
+#if defined(OS_WIN) || defined(OS_NIX)
   // Windows and Linux create transport DIBs inside the renderer
   return TransportDIB::Create(size, sequence_number_++);
-#elif defined(OS_MACOSX)  // defined(OS_WIN) || defined(OS_LINUX)
+#elif defined(OS_MACOSX)  // defined(OS_WIN) || defined(OS_NIX)
   // Mac creates transport DIBs in the browser, so we need to do a sync IPC to
   // get one.
   TransportDIB::Handle handle;
@@ -204,7 +204,7 @@
   int width = rect.width();
   int height = rect.height();
   const size_t stride = skia::PlatformCanvas::StrideForWidth(rect.width());
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
   const size_t max_size = base::SysInfo::MaxSharedMemorySize();
 #else
   const size_t max_size = 0;
Index: src/chrome/renderer/webplugin_delegate_pepper.cc
===================================================================
--- chrome/renderer/webplugin_delegate_pepper.cc	(revision 42139)
+++ chrome/renderer/webplugin_delegate_pepper.cc	(working copy)
@@ -894,7 +894,7 @@
 
 bool WebPluginDelegatePepper::PrintPage(int page_number,
                                         WebKit::WebCanvas* canvas) {
-#if defined(OS_WIN) || defined(OS_LINUX)
+#if defined(OS_WIN) || defined(OS_NIX)
   NPPPrintExtensions* print_extensions = GetPrintExtensions();
   if (!print_extensions)
     return false;
@@ -969,10 +969,10 @@
     canvas->drawBitmapRect(committed, &src_rect, dest_rect);
 
   return true;
-#else  // defined(OS_WIN) || defined(OS_LINUX)
+#else  // defined(OS_WIN) || defined(OS_NIX)
   NOTIMPLEMENTED();
   return false;
-#endif  // defined(OS_WIN) || defined(OS_LINUX)
+#endif  // defined(OS_WIN) || defined(OS_NIX)
 }
 
 void WebPluginDelegatePepper::PrintEnd() {
@@ -1028,7 +1028,7 @@
 
 void WebPluginDelegatePepper::Paint(WebKit::WebCanvas* canvas,
                                     const gfx::Rect& rect) {
-#if defined(OS_WIN) || defined(OS_LINUX)
+#if defined(OS_WIN) || defined(OS_NIX)
   if (nested_delegate_) {
     // TODO(apatrick): The GPU plugin will render to an offscreen render target.
     //    Need to copy it to the screen here.
Index: src/chrome/renderer/render_thread.cc
===================================================================
--- chrome/renderer/render_thread.cc	(revision 42139)
+++ chrome/renderer/render_thread.cc	(working copy)
@@ -827,7 +827,7 @@
 }
 
 void RenderThread::IdleHandler() {
-#if (defined(OS_WIN) || defined(OS_LINUX)) && defined(USE_TCMALLOC)
+#if !defined(OS_MACOSX) && defined(USE_TCMALLOC)
   MallocExtension::instance()->ReleaseFreeMemory();
 #endif
 
@@ -901,7 +901,7 @@
   while (!v8::V8::IdleNotification()) {
   }
 
-#if (defined(OS_WIN) || defined(OS_LINUX)) && defined(USE_TCMALLOC)
+#if !defined(OS_MACOSX) && defined(USE_TCMALLOC)
   // Tell tcmalloc to release any free pages it's still holding.
   MallocExtension::instance()->ReleaseFreeMemory();
 #endif
Index: src/chrome/renderer/renderer_webkitclient_impl.cc
===================================================================
--- chrome/renderer/renderer_webkitclient_impl.cc	(revision 42139)
+++ chrome/renderer/renderer_webkitclient_impl.cc	(working copy)
@@ -33,7 +33,7 @@
 #include "webkit/appcache/web_application_cache_host_impl.h"
 #include "webkit/glue/webkit_glue.h"
 
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
 #include "chrome/renderer/renderer_sandbox_support_linux.h"
 #endif
 
@@ -63,7 +63,7 @@
 }
 
 WebKit::WebSandboxSupport* RendererWebKitClientImpl::sandboxSupport() {
-#if defined(OS_WIN) || defined(OS_LINUX)
+#if defined(OS_WIN) || defined(OS_NIX)
   return &sandbox_support_;
 #else
   return NULL;
@@ -226,7 +226,7 @@
   return RenderThread::current()->Send(new ViewHostMsg_LoadFont(logfont));
 }
 
-#elif defined(OS_LINUX)
+#elif defined(OS_NIX)
 
 WebString RendererWebKitClientImpl::SandboxSupport::getFontFamilyForCharacters(
     const WebKit::WebUChar* characters, size_t num_characters) {
Index: src/chrome/renderer/renderer_webkitclient_impl.h
===================================================================
--- chrome/renderer/renderer_webkitclient_impl.h	(revision 42139)
+++ chrome/renderer/renderer_webkitclient_impl.h	(working copy)
@@ -13,7 +13,7 @@
 
 #if defined(OS_WIN)
 #include "third_party/WebKit/WebKit/chromium/public/win/WebSandboxSupport.h"
-#elif defined(OS_LINUX)
+#elif defined(OS_NIX)
 #include <string>
 #include <map>
 #include "base/lock.h"
@@ -81,7 +81,7 @@
    public:
     virtual bool ensureFontLoaded(HFONT);
   };
-#elif defined(OS_LINUX)
+#elif defined(OS_NIX)
   class SandboxSupport : public WebKit::WebSandboxSupport {
    public:
     virtual WebKit::WebString getFontFamilyForCharacters(
@@ -102,7 +102,7 @@
   webkit_glue::WebClipboardImpl clipboard_;
 
   MimeRegistry mime_registry_;
-#if defined(OS_WIN) || defined(OS_LINUX)
+#if defined(OS_WIN) || defined(OS_NIX)
   SandboxSupport sandbox_support_;
 #endif
 
Index: src/chrome/renderer/render_process_impl.cc
===================================================================
--- chrome/renderer/render_process_impl.cc	(revision 42139)
+++ chrome/renderer/render_process_impl.cc	(working copy)
@@ -170,10 +170,10 @@
 // Platform specific code for dealing with bitmap transport...
 
 TransportDIB* RenderProcessImpl::CreateTransportDIB(size_t size) {
-#if defined(OS_WIN) || defined(OS_LINUX)
+#if defined(OS_WIN) || defined(OS_NIX)
   // Windows and Linux create transport DIBs inside the renderer
   return TransportDIB::Create(size, transport_dib_next_sequence_number_++);
-#elif defined(OS_MACOSX)  // defined(OS_WIN) || defined(OS_LINUX)
+#elif defined(OS_MACOSX)  // defined(OS_WIN) || defined(OS_NIX)
   // Mac creates transport DIBs in the browser, so we need to do a sync IPC to
   // get one.
   TransportDIB::Handle handle;
@@ -208,7 +208,7 @@
   int width = rect.width();
   int height = rect.height();
   const size_t stride = skia::PlatformCanvas::StrideForWidth(rect.width());
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
   const size_t max_size = base::SysInfo::MaxSharedMemorySize();
 #else
   const size_t max_size = 0;
Index: src/chrome/renderer/renderer_main.cc
===================================================================
--- chrome/renderer/renderer_main.cc	(revision 42139)
+++ chrome/renderer/renderer_main.cc	(working copy)
@@ -264,7 +264,7 @@
   }
 
   {
-#if !defined(OS_LINUX)
+#if !defined(OS_NIX)
     // TODO(markus): Check if it is OK to unconditionally move this
     // instruction down.
     RenderProcessImpl render_process;
@@ -274,7 +274,7 @@
     if (!no_sandbox) {
       run_loop = platform.EnableSandbox();
     }
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
     RenderProcessImpl render_process;
     render_process.set_main_thread(new RenderThread());
 #endif
Index: src/chrome/renderer/render_view.h
===================================================================
--- chrome/renderer/render_view.h	(revision 42139)
+++ chrome/renderer/render_view.h	(working copy)
@@ -857,7 +857,7 @@
 
   void Print(WebKit::WebFrame* frame, bool script_initiated);
 
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
   void UpdateFontRenderingFromRendererPrefs();
 #else
   void UpdateFontRenderingFromRendererPrefs() { }
Index: src/chrome/renderer/renderer_main_platform_delegate_linux.cc
===================================================================
--- chrome/renderer/renderer_main_platform_delegate_linux.cc	(revision 42139)
+++ chrome/renderer/renderer_main_platform_delegate_linux.cc	(working copy)
@@ -36,7 +36,7 @@
   //
   // The seccomp sandbox is started in the renderer.
   // http://code.google.com/p/seccompsandbox/
-#if defined(ARCH_CPU_X86_FAMILY) && !defined(CHROMIUM_SELINUX)
+#if defined(OS_LINUX) && defined(ARCH_CPU_X86_FAMILY) && !defined(CHROMIUM_SELINUX)
   // N.b. SupportsSeccompSandbox() returns a cached result, as we already
   // called it earlier in the zygote. Thus, it is OK for us to not pass in
   // a file descriptor for "/proc".
Index: src/chrome/chrome_tests.gypi
===================================================================
--- chrome/chrome_tests.gypi	(revision 42139)
+++ chrome/chrome_tests.gypi	(working copy)
@@ -122,7 +122,7 @@
         'test/ui_test_utils_win.cc',
       ],
       'conditions': [
-        ['OS=="linux"', {
+        ['OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
           'dependencies': [
             '../build/linux/system.gyp:gtk',
           ],
@@ -167,7 +167,7 @@
         'test/ui/ui_test_suite.h',
       ],
       'conditions': [
-        ['OS=="linux"', {
+        ['OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
           'dependencies': [
             '../build/linux/system.gyp:gtk',
           ],
@@ -197,7 +197,7 @@
         'test/unit/run_all_unittests.cc',
       ],
       'conditions': [
-        ['OS=="linux"', {
+        ['OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
           'dependencies': [
             # Needed for the following #include chain:
             #   test/unit/run_all_unittests.cc
@@ -232,7 +232,7 @@
         'test/automated_ui_tests/automated_ui_tests.h',
       ],
       'conditions': [
-        ['OS=="linux"', {
+        ['OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
           'dependencies': [
             '../tools/xdisplaycheck/xdisplaycheck.gyp:xdisplaycheck',
           ],
@@ -333,7 +333,7 @@
             '../webkit/webkit.gyp:npapi_test_plugin',
           ],
         }],
-        ['OS=="linux"', {
+        ['OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
           'dependencies': [
             '../build/linux/system.gyp:gtk',
             '../tools/xdisplaycheck/xdisplaycheck.gyp:xdisplaycheck',
@@ -982,7 +982,7 @@
             '../sandbox/sandbox.gyp:*',
           ],
         }],
-        ['OS=="linux"', {
+        ['OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
           'conditions': [
             [ 'gcc_version==44', {
               # Avoid gcc 4.4 strict aliasing issues in stl_tree.h when
@@ -1297,7 +1297,7 @@
             },
           }
         }],
-        ['OS=="linux"', {
+        ['OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
           'dependencies': [
             '../build/linux/system.gyp:gtk',
             '../tools/xdisplaycheck/xdisplaycheck.gyp:xdisplaycheck',
@@ -1311,7 +1311,7 @@
             '<@(browser_tests_sources_views_specific)',
           ],
         }],
-        ['OS=="linux" and toolkit_views==0 and chromeos==0', {
+        ['(OS=="linux" or OS=="freebsd" or OS=="openbsd") and toolkit_views==0 and chromeos==0', {
           'sources': [
             'browser/extensions/browser_action_test_util_gtk.cc',
             'browser/gtk/view_id_util_browsertest.cc',
@@ -1371,7 +1371,7 @@
         'test/startup/startup_test.cc',
       ],
       'conditions': [
-        ['OS=="linux"', {
+        ['OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
           'dependencies': [
             '../build/linux/system.gyp:gtk',
             '../tools/xdisplaycheck/xdisplaycheck.gyp:xdisplaycheck',
@@ -1431,7 +1431,7 @@
             '<(allocator_target)',
           ],
         },],
-        ['OS=="linux"', {
+        ['OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
           'dependencies': [
             '../build/linux/system.gyp:gtk',
           ],
@@ -1457,7 +1457,7 @@
         'test/page_cycler/page_cycler_test.cc',
       ],
       'conditions': [
-        ['OS=="linux"', {
+        ['OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
           'dependencies': [
             '../build/linux/system.gyp:gtk',
             '../tools/xdisplaycheck/xdisplaycheck.gyp:xdisplaycheck',
@@ -1494,7 +1494,7 @@
         'test/tab_switching/tab_switching_test.cc',
       ],
       'conditions': [
-        ['OS=="linux"', {
+        ['OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
           'dependencies': [
             '../build/linux/system.gyp:gtk',
             '../tools/xdisplaycheck/xdisplaycheck.gyp:xdisplaycheck',
@@ -1528,7 +1528,7 @@
         'test/memory_test/memory_test.cc',
       ],
       'conditions': [
-        ['OS=="linux"', {
+        ['OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
           'dependencies': [
             '../build/linux/system.gyp:gtk',
             '../tools/xdisplaycheck/xdisplaycheck.gyp:xdisplaycheck',
@@ -1666,7 +1666,7 @@
             'browser/sync/util/data_encryption_unittest.cc',
           ],
         }],
-        ['OS=="linux"', {
+        ['OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
           'dependencies': [
             '../build/linux/system.gyp:gtk',
             'packed_resources'
@@ -1736,7 +1736,7 @@
       ],
       'conditions': [
         # Plugin code.
-        ['OS=="linux" or OS=="win"', {
+        ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="win"', {
           'dependencies': [
             'plugin',
            ],
@@ -1745,7 +1745,7 @@
           ],
         }],
         # Linux-specific rules.
-        ['OS=="linux"', {
+        ['OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
            'dependencies': [
              '../build/linux/system.gyp:gtk',
            ],
@@ -1816,7 +1816,7 @@
             'test/perf/url_parse_perftest.cc',
           ],
           'conditions': [
-            ['OS=="linux"', {
+            ['OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
               'dependencies': [
                 '../build/linux/system.gyp:gtk',
                 '../tools/xdisplaycheck/xdisplaycheck.gyp:xdisplaycheck',
@@ -1955,7 +1955,7 @@
       ]},  # 'targets'
     ],  # OS=="win"
     # Build on linux x86_64 only if linux_fpic==1
-    ['OS=="mac" or OS=="win" or (OS=="linux" and target_arch==python_arch '
+    ['OS=="mac" or OS=="win" or ((OS=="linux" or OS=="freebsd" or OS=="openbsd") and target_arch==python_arch '
      'and (target_arch!="x64" or linux_fpic==1))', {
       'targets': [
         {
Index: src/chrome/worker/worker_uitest.cc
===================================================================
--- chrome/worker/worker_uitest.cc	(revision 42139)
+++ chrome/worker/worker_uitest.cc	(working copy)
@@ -59,7 +59,7 @@
     // The 1 is for the browser process.
     int number_of_processes = 1 + workers +
         (UITest::in_process_renderer() ? 0 : tabs);
-#if defined(OS_LINUX)
+#if defined(OS_NIX)
     // On Linux, we also have a zygote process and a sandbox host process.
     number_of_processes += 2;
 #endif
Index: src/chrome/chrome_renderer.gypi
===================================================================
--- chrome/chrome_renderer.gypi	(revision 42139)
+++ chrome/chrome_renderer.gypi	(working copy)
@@ -102,7 +102,6 @@
         'renderer/gpu_channel_host.h',
         'renderer/localized_error.cc',
         'renderer/localized_error.h',
-        'renderer/nacl_desc_wrapper_chrome.cc',
         'renderer/navigation_state.h',
         'renderer/notification_provider.cc',
         'renderer/notification_provider.h',
Index: src/chrome/chrome.gyp
===================================================================
--- chrome/chrome.gyp	(revision 42139)
+++ chrome/chrome.gyp	(working copy)
@@ -78,6 +78,10 @@
         'platform_locale_settings_grd':
             'app/resources/locale_settings_linux.grd',
       },],
+      ['OS=="freebsd" or OS=="openbsd"', {
+        'platform_locale_settings_grd':
+            'app/resources/locale_settings_linux.grd',
+      },],
       ['OS=="mac"', {
         'tweak_info_plist_path': 'tools/build/mac/tweak_info_plist',
         'nacl_defines': [
@@ -126,7 +130,7 @@
     'chrome_renderer.gypi',
     'chrome_tests.gypi',
     'common_constants.gypi',
-    'nacl.gypi',
+    #'nacl.gypi',
   ],
   'targets': [
     {
@@ -555,7 +559,7 @@
         '..',
       ],
       'conditions': [
-        ['OS=="linux"', {
+        ['OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
           'dependencies': [
             '../build/linux/system.gyp:gtk',
           ],
@@ -749,7 +753,6 @@
         'browser/sync/notifier/base/async_dns_lookup.h',
         'browser/sync/notifier/base/async_network_alive.h',
         'browser/sync/notifier/base/fastalloc.h',
-        'browser/sync/notifier/base/linux/async_network_alive_linux.cc',
         'browser/sync/notifier/base/mac/network_status_detector_task_mac.h',
         'browser/sync/notifier/base/mac/network_status_detector_task_mac.cc',
         'browser/sync/notifier/base/nethelpers.cc',
@@ -992,6 +995,12 @@
             ],
           },
         }],
+        [ 'OS == "openbsd"', {
+          'dependencies': [
+            '../build/linux/system.gyp:gtk'
+          ],
+          'sources/': [['exclude', '^browser/sync/util/path_helpers_linux.cc$']],
+        }],
         ['OS=="mac"', {
           'link_settings': {
             'libraries': [
Index: src/native_client/src/shared/platform/platform.gyp
===================================================================
--- native_client/src/shared/platform/platform.gyp	(revision 1742)
+++ native_client/src/shared/platform/platform.gyp	(working copy)
@@ -58,7 +58,7 @@
       'time.h',
     ],
     'conditions': [
-      ['OS=="linux"', {
+      ['OS=="linux" or OS=="openbsd"', {
         'platform_sources': [
           'linux/condition_variable.cc',
           'linux/lock.cc',
Index: src/native_client/src/trusted/service_runtime/service_runtime.gyp
===================================================================
--- native_client/src/trusted/service_runtime/service_runtime.gyp	(revision 1742)
+++ native_client/src/trusted/service_runtime/service_runtime.gyp	(working copy)
@@ -31,7 +31,7 @@
 {
   'variables': {
     'conditions': [
-      ['OS=="linux"', {
+      ['OS=="linux" or OS=="openbsd"', {
         'syscall_handler': [
           'linux/nacl_syscall_impl.c'
         ],
Index: src/native_client/build/common.gypi
===================================================================
--- native_client/build/common.gypi	(revision 1742)
+++ native_client/build/common.gypi	(working copy)
@@ -347,7 +347,7 @@
     },
   },
   'conditions': [
-    ['OS=="linux"', {
+    ['OS=="linux" or OS=="openbsd"', {
       'target_defaults': {
         # Enable -Werror by default, but put it in a variable so it can
         # be disabled in ~/.gyp/include.gypi on the valgrind builders.
Index: src/third_party/WebKit/JavaScriptCore/wtf/StringExtras.h
===================================================================
--- third_party/WebKit/JavaScriptCore/wtf/StringExtras.h	(revision 56239)
+++ third_party/WebKit/JavaScriptCore/wtf/StringExtras.h	(working copy)
@@ -86,7 +86,7 @@
 
 #endif
 
-#if OS(WINDOWS) || OS(LINUX) || OS(SOLARIS)
+#if OS(WINDOWS) || OS(LINUX) || OS(SOLARIS) || OS(OPENBSD)
 // FIXME: should check HAVE_STRNSTR
 
 inline char* strnstr(const char* buffer, const char* target, size_t bufferLength)
Index: src/third_party/WebKit/JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp
===================================================================
--- third_party/WebKit/JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp	(revision 56239)
+++ third_party/WebKit/JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp	(working copy)
@@ -83,7 +83,7 @@
               'WTF_USE_NEW_THEME=1',
             ],
           }],
-          ['OS=="linux" or OS=="freebsd"', {
+          ['OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
             'defines': [
               'WTF_USE_PTHREADS=1',
             ],
Index: src/third_party/WebKit/WebCore/dom/SelectElement.cpp
===================================================================
--- third_party/WebKit/WebCore/dom/SelectElement.cpp	(revision 56239)
+++ third_party/WebKit/WebCore/dom/SelectElement.cpp	(working copy)
@@ -53,7 +53,7 @@
 #if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN))
 #define ARROW_KEYS_POP_MENU 1
 #define SPACE_OR_RETURN_POP_MENU 0
-#elif PLATFORM(GTK) || (PLATFORM(CHROMIUM) && OS(LINUX))
+#elif PLATFORM(GTK) || (PLATFORM(CHROMIUM) && (OS(LINUX) || OS(OPENBSD)))
 #define ARROW_KEYS_POP_MENU 0
 #define SPACE_OR_RETURN_POP_MENU 1
 #else
Index: src/third_party/WebKit/WebCore/page/EventHandler.cpp
===================================================================
--- third_party/WebKit/WebCore/page/EventHandler.cpp	(revision 56239)
+++ third_party/WebKit/WebCore/page/EventHandler.cpp	(working copy)
@@ -1822,7 +1822,7 @@
     return swallowEvent;
 }
 
-#if !PLATFORM(GTK) && !(PLATFORM(CHROMIUM) && OS(LINUX))
+#if !PLATFORM(GTK) && !(PLATFORM(CHROMIUM) && (OS(LINUX) || OS(OPENBSD)))
 bool EventHandler::shouldTurnVerticalTicksIntoHorizontal(const HitTestResult&) const
 {
     return false;
Index: src/third_party/WebKit/WebCore/page/chromium/EventHandlerChromium.cpp
===================================================================
--- third_party/WebKit/WebCore/page/chromium/EventHandlerChromium.cpp	(revision 56239)
+++ third_party/WebKit/WebCore/page/chromium/EventHandlerChromium.cpp	(working copy)
@@ -154,7 +154,7 @@
 #endif
 }
 
-#if OS(LINUX)
+#if OS(LINUX) || OS(OPENBSD)
 // GTK+ must scroll horizontally if the mouse pointer is on top of the
 // horizontal scrollbar while scrolling with the wheel.
 // This code comes from gtk/EventHandlerGtk.cpp.
Index: src/third_party/WebKit/WebCore/platform/chromium/ChromiumBridge.h
===================================================================
--- third_party/WebKit/WebCore/platform/chromium/ChromiumBridge.h	(revision 56239)
+++ third_party/WebKit/WebCore/platform/chromium/ChromiumBridge.h	(working copy)
@@ -114,7 +114,7 @@
 #if OS(WINDOWS)
         static bool ensureFontLoaded(HFONT font);
 #endif
-#if OS(LINUX)
+#if OS(LINUX) || OS(OPENBSD)
         static void getRenderStyleForStrike(const char* family, int sizeAndStyle, FontRenderStyle* result);
         static String getFontFamilyForCharacters(const UChar*, size_t numCharacters);
 #endif
Index: src/third_party/WebKit/WebCore/platform/graphics/chromium/FontCustomPlatformData.cpp
===================================================================
--- third_party/WebKit/WebCore/platform/graphics/chromium/FontCustomPlatformData.cpp	(revision 56239)
+++ third_party/WebKit/WebCore/platform/graphics/chromium/FontCustomPlatformData.cpp	(working copy)
@@ -36,7 +36,7 @@
 #include "Base64.h"
 #include "ChromiumBridge.h"
 #include "OpenTypeUtilities.h"
-#elif OS(LINUX)
+#elif OS(LINUX) || OS(OPENBSD)
 #include "SkStream.h"
 #endif
 
@@ -47,7 +47,7 @@
 
 #if OS(WINDOWS)
 #include <objbase.h>
-#elif OS(LINUX)
+#elif OS(LINUX) || OS(OPENBSD)
 #include <cstring>
 #endif
 
@@ -58,7 +58,7 @@
 #if OS(WINDOWS)
     if (m_fontReference)
         RemoveFontMemResourceEx(m_fontReference);
-#elif OS(LINUX)
+#elif OS(LINUX) || OS(OPENBSD)
     if (m_fontReference)
         m_fontReference->unref();
 #endif
@@ -99,7 +99,7 @@
 
     HFONT hfont = CreateFontIndirect(&logFont);
     return FontPlatformData(hfont, size);
-#elif OS(LINUX)
+#elif OS(LINUX) || OS(OPENBSD)
     ASSERT(m_fontReference);
     return FontPlatformData(m_fontReference, "", size, bold && !m_fontReference->isBold(), italic && !m_fontReference->isItalic());
 #else
@@ -123,7 +123,7 @@
 }
 #endif
 
-#if OS(LINUX)
+#if OS(LINUX) || OS(OPENBSD)
 class RemoteFontStream : public SkStream {
 public:
     explicit RemoteFontStream(PassRefPtr<SharedBuffer> buffer)
@@ -189,7 +189,7 @@
     if (!fontReference)
         return 0;
     return new FontCustomPlatformData(fontReference, fontName);
-#elif OS(LINUX)
+#elif OS(LINUX) || OS(OPENBSD)
     RemoteFontStream* stream = new RemoteFontStream(buffer);
     SkTypeface* typeface = SkTypeface::CreateFromStream(stream);
     if (!typeface)
Index: src/third_party/WebKit/WebCore/platform/graphics/chromium/FontPlatformData.h
===================================================================
--- third_party/WebKit/WebCore/platform/graphics/chromium/FontPlatformData.h	(revision 56239)
+++ third_party/WebKit/WebCore/platform/graphics/chromium/FontPlatformData.h	(working copy)
@@ -33,7 +33,7 @@
 
 #if OS(WINDOWS)
 #include "FontPlatformDataChromiumWin.h"
-#elif OS(LINUX)
+#elif OS(LINUX) || OS(OPENBSD)
 #include "FontPlatformDataLinux.h"
 #endif
 
Index: src/third_party/WebKit/WebCore/platform/graphics/chromium/FontCustomPlatformData.h
===================================================================
--- third_party/WebKit/WebCore/platform/graphics/chromium/FontCustomPlatformData.h	(revision 56239)
+++ third_party/WebKit/WebCore/platform/graphics/chromium/FontCustomPlatformData.h	(working copy)
@@ -38,7 +38,7 @@
 #if OS(WINDOWS)
 #include "PlatformString.h"
 #include <windows.h>
-#elif OS(LINUX)
+#elif OS(LINUX) || OS(OPENBSD)
 #include "SkTypeface.h"
 #endif
 
@@ -53,7 +53,7 @@
         : m_fontReference(fontReference)
         , m_name(name)
     {}
-#elif OS(LINUX)
+#elif OS(LINUX) || OS(OPENBSD)
     explicit FontCustomPlatformData(SkTypeface* typeface)
         : m_fontReference(typeface)
     {}
@@ -67,7 +67,7 @@
 #if OS(WINDOWS)
     HANDLE m_fontReference;
     String m_name;
-#elif OS(LINUX)
+#elif OS(LINUX) || OS(OPENBSD)
     SkTypeface* m_fontReference;
 #endif
 };
Index: src/third_party/WebKit/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
===================================================================
--- third_party/WebKit/WebCore/platform/graphics/skia/PlatformContextSkia.cpp	(revision 56239)
+++ third_party/WebKit/WebCore/platform/graphics/skia/PlatformContextSkia.cpp	(working copy)
@@ -89,7 +89,7 @@
     // color to produce a new output color.
     SkColor applyAlpha(SkColor) const;
 
-#if OS(LINUX) || OS(WINDOWS)
+#if OS(LINUX) || OS(OPENBSD) || OS(WINDOWS)
     // If non-empty, the current State is clipped to this image.
     SkBitmap m_imageBufferClip;
     // If m_imageBufferClip is non-empty, this is the region the image is clipped to.
@@ -143,7 +143,7 @@
     , m_lineJoin(other.m_lineJoin)
     , m_dash(other.m_dash)
     , m_textDrawingMode(other.m_textDrawingMode)
-#if OS(LINUX) || OS(WINDOWS)
+#if OS(LINUX) || OS(OPENBSD) || OS(WINDOWS)
     , m_imageBufferClip(other.m_imageBufferClip)
     , m_clip(other.m_clip)
 #endif
@@ -214,7 +214,7 @@
     m_stateStack.append(*m_state);
     m_state = &m_stateStack.last();
 
-#if OS(LINUX) || OS(WINDOWS)
+#if OS(LINUX) || OS(OPENBSD) || OS(WINDOWS)
     // The clip image only needs to be applied once. Reset the image so that we
     // don't attempt to clip multiple times.
     m_state->m_imageBufferClip.reset();
@@ -224,7 +224,7 @@
     canvas()->save();
 }
 
-#if OS(LINUX) || OS(WINDOWS)
+#if OS(LINUX) || OS(OPENBSD) || OS(WINDOWS)
 void PlatformContextSkia::beginLayerClippedToImage(const WebCore::FloatRect& rect,
                                                    const WebCore::ImageBuffer* imageBuffer)
 {
@@ -272,7 +272,7 @@
 
 void PlatformContextSkia::restore()
 {
-#if OS(LINUX) || OS(WINDOWS)
+#if OS(LINUX) || OS(OPENBSD) || OS(WINDOWS)
     if (!m_state->m_imageBufferClip.empty()) {
         applyClipFromImage(m_state->m_clip, m_state->m_imageBufferClip);
         canvas()->restore();
@@ -563,7 +563,7 @@
     return m_canvas->getTopPlatformDevice().IsVectorial();
 }
 
-#if OS(LINUX) || OS(WINDOWS)
+#if OS(LINUX) || OS(OPENBSD) || OS(WINDOWS)
 void PlatformContextSkia::applyClipFromImage(const WebCore::FloatRect& rect, const SkBitmap& imageBuffer)
 {
     // NOTE: this assumes the image mask contains opaque black for the portions that are to be shown, as such we
Index: src/third_party/WebKit/WebCore/platform/graphics/skia/PlatformContextSkia.h
===================================================================
--- third_party/WebKit/WebCore/platform/graphics/skia/PlatformContextSkia.h	(revision 56239)
+++ third_party/WebKit/WebCore/platform/graphics/skia/PlatformContextSkia.h	(working copy)
@@ -88,7 +88,7 @@
     // |rect|. This layer is implicitly restored when the next restore is
     // invoked.
     // NOTE: |imageBuffer| may be deleted before the |restore| is invoked.
-#if OS(LINUX) || OS(WINDOWS)
+#if OS(LINUX) || OS(OPENBSD) || OS(WINDOWS)
     void beginLayerClippedToImage(const WebCore::FloatRect&,
                                   const WebCore::ImageBuffer*);
 #endif
@@ -168,7 +168,7 @@
     bool isPrinting();
 
 private:
-#if OS(LINUX) || OS(WINDOWS)
+#if OS(LINUX) || OS(OPENBSD) || OS(WINDOWS)
     // Used when restoring and the state has an image clip. Only shows the pixels in
     // m_canvas that are also in imageBuffer.
     void applyClipFromImage(const WebCore::FloatRect&, const SkBitmap&);
Index: src/third_party/WebKit/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp
===================================================================
--- third_party/WebKit/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp	(revision 56239)
+++ third_party/WebKit/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp	(working copy)
@@ -434,7 +434,7 @@
     if (paintingDisabled())
         return;
 
-#if OS(LINUX) || OS(WINDOWS)
+#if OS(LINUX) || OS(OPENBSD) || OS(WINDOWS)
     platformContext()->beginLayerClippedToImage(rect, imageBuffer);
 #endif
 }
Index: src/third_party/WebKit/WebCore/WebCore.gyp/WebCore.gyp
===================================================================
--- third_party/WebKit/WebCore/WebCore.gyp/WebCore.gyp	(revision 56239)
+++ third_party/WebKit/WebCore/WebCore.gyp/WebCore.gyp	(working copy)
@@ -891,7 +891,7 @@
             ['exclude', 'rendering/SVG'],
           ],
         }],
-        ['OS=="linux" or OS=="freebsd"', {
+        ['OS=="linux" or OS=="openbsd"', {
           'dependencies': [
             '<(chromium_src_dir)/build/linux/system.gyp:fontconfig',
             '<(chromium_src_dir)/build/linux/system.gyp:gtk',
@@ -1094,7 +1094,7 @@
             'include_dirs+++': ['../dom'],
           },
         }],
-        ['OS!="linux" and OS!="freebsd"', {
+        ['OS!="linux" and OS!="openbsd"', {
           'sources/': [['exclude', '(Gtk|Linux)\\.cpp$']]
         }],
         ['OS!="mac"', {
Index: src/third_party/WebKit/WebCore/bindings/v8/V8Proxy.cpp
===================================================================
--- third_party/WebKit/WebCore/bindings/v8/V8Proxy.cpp	(revision 56239)
+++ third_party/WebKit/WebCore/bindings/v8/V8Proxy.cpp	(working copy)
@@ -875,7 +875,7 @@
     if (!context->GetData()->IsString())
         return -1;
     v8::String::AsciiValue ascii(context->GetData());
-    char* comma = strnstr(*ascii, ",", ascii.length());
+    char* comma = strstr(*ascii, ",");
     if (!comma)
         return -1;
     return atoi(comma + 1);
Index: src/third_party/WebKit/WebCore/inspector/InspectorFrontendHost.cpp
===================================================================
--- third_party/WebKit/WebCore/inspector/InspectorFrontendHost.cpp	(revision 56239)
+++ third_party/WebKit/WebCore/inspector/InspectorFrontendHost.cpp	(working copy)
@@ -141,6 +141,8 @@
     DEFINE_STATIC_LOCAL(const String, platform, ("windows"));
 #elif OS(LINUX)
     DEFINE_STATIC_LOCAL(const String, platform, ("linux"));
+#elif OS(OPENBSD)
+    DEFINE_STATIC_LOCAL(const String, platform, ("openbsd"));
 #else
     DEFINE_STATIC_LOCAL(const String, platform, ("unknown"));
 #endif
Index: src/third_party/WebKit/WebCore/loader/CachedFont.cpp
===================================================================
--- third_party/WebKit/WebCore/loader/CachedFont.cpp	(revision 56239)
+++ third_party/WebKit/WebCore/loader/CachedFont.cpp	(working copy)
@@ -27,7 +27,7 @@
 #include "config.h"
 #include "CachedFont.h"
 
-#if PLATFORM(CG) || PLATFORM(QT) || PLATFORM(GTK) || (PLATFORM(CHROMIUM) && (OS(WINDOWS) || OS(LINUX))) || PLATFORM(HAIKU) || OS(WINCE)
+#if PLATFORM(CG) || PLATFORM(QT) || PLATFORM(GTK) || (PLATFORM(CHROMIUM) && (OS(WINDOWS) || OS(LINUX) || OS(OPENBSD))) || PLATFORM(HAIKU) || OS(WINCE)
 #define STORE_FONT_CUSTOM_PLATFORM_DATA
 #endif
 
Index: src/third_party/WebKit/WebKit/chromium/WebKit.gyp
===================================================================
--- third_party/WebKit/WebKit/chromium/WebKit.gyp	(revision 56239)
+++ third_party/WebKit/WebKit/chromium/WebKit.gyp	(working copy)
@@ -383,7 +383,7 @@
                 'src/win/WebScreenInfoFactory.cpp',
             ],
             'conditions': [
-                ['OS=="linux" or OS=="freebsd"', {
+                ['OS=="linux" or OS=="openbsd"', {
                     'dependencies': [
                         '<(chromium_src_dir)/build/linux/system.gyp:fontconfig',
                         '<(chromium_src_dir)/build/linux/system.gyp:gtk',
Index: src/third_party/WebKit/WebKit/chromium/src/ChromiumBridge.cpp
===================================================================
--- third_party/WebKit/WebKit/chromium/src/ChromiumBridge.cpp	(revision 56239)
+++ third_party/WebKit/WebKit/chromium/src/ChromiumBridge.cpp	(working copy)
@@ -62,7 +62,7 @@
 #include "WebThemeEngine.h"
 #endif
 
-#if OS(LINUX)
+#if OS(LINUX) || OS(OPENBSD)
 #include "WebSandboxSupport.h"
 #include "WebFontInfo.h"
 #include "WebFontRenderStyle.h"
@@ -340,7 +340,7 @@
 }
 #endif
 
-#if OS(LINUX)
+#if OS(LINUX) || OS(OPENBSD)
 String ChromiumBridge::getFontFamilyForCharacters(const UChar* characters, size_t numCharacters)
 {
     if (webKitClient()->sandboxSupport())
Index: src/third_party/WebKit/WebKit/chromium/src/WebFrameImpl.cpp
===================================================================
--- third_party/WebKit/WebKit/chromium/src/WebFrameImpl.cpp	(revision 56239)
+++ third_party/WebKit/WebKit/chromium/src/WebFrameImpl.cpp	(working copy)
@@ -150,7 +150,7 @@
 #include "LocalCurrentGraphicsContext.h"
 #endif
 
-#if OS(LINUX)
+#if OS(LINUX) || OS(OPENBSD)
 #include <gdk/gdk.h>
 #endif
 
@@ -1243,7 +1243,7 @@
         return 0;
     }
 
-#if OS(WINDOWS) || OS(LINUX) || OS(FREEBSD) || OS(SOLARIS)
+#if OS(WINDOWS) || OS(LINUX) || OS(OPENBSD) || OS(SOLARIS)
     PlatformContextSkia context(canvas);
     GraphicsContext spool(&context);
 #elif OS(DARWIN)
Index: src/third_party/WebKit/WebKit/chromium/src/GraphicsContext3D.cpp
===================================================================
--- third_party/WebKit/WebKit/chromium/src/GraphicsContext3D.cpp	(revision 56239)
+++ third_party/WebKit/WebKit/chromium/src/GraphicsContext3D.cpp	(working copy)
@@ -75,7 +75,7 @@
 #define USE_TEXTURE_RECTANGLE_FOR_FRAMEBUFFER
 #endif
 
-#if OS(LINUX)
+#if OS(OPENBSD)
 #include <dlfcn.h>
 #include "GL/glxew.h"
 #endif
@@ -188,7 +188,7 @@
     CGLPBufferObj m_pbuffer;
     CGLContextObj m_contextObj;
     unsigned char* m_renderOutput;
-#elif OS(LINUX)
+#elif OS(OPENBSD)
     GLXContext m_contextObj;
     GLXPbuffer m_pbuffer;
 
@@ -280,7 +280,7 @@
 
 bool GraphicsContext3DInternal::s_initializedGLEW = false;
 
-#if OS(LINUX)
+#if OS(OPENBSD)
 GraphicsContext3DInternal::GLConnection* GraphicsContext3DInternal::s_gl = 0;
 
 GraphicsContext3DInternal::GLConnection* GraphicsContext3DInternal::GLConnection::create()
@@ -333,7 +333,7 @@
     dlclose(m_libGL);
 }
 
-#endif // OS(LINUX)
+#endif // OS(OPENBSD)
 
 GraphicsContext3DInternal::VertexAttribPointerState::VertexAttribPointerState()
     : enabled(false)
@@ -368,7 +368,7 @@
     , m_pbuffer(0)
     , m_contextObj(0)
     , m_renderOutput(0)
-#elif OS(LINUX)
+#elif OS(OPENBSD)
     , m_contextObj(0)
     , m_pbuffer(0)
 #else
@@ -497,7 +497,7 @@
     }
     m_pbuffer = pbuffer;
     m_contextObj = context;
-#elif OS(LINUX)
+#elif OS(OPENBSD)
     if (!s_gl) {
         s_gl = GLConnection::create();
         if (!s_gl)
@@ -595,7 +595,7 @@
     CGLDestroyPBuffer(m_pbuffer);
     if (m_renderOutput)
         delete[] m_renderOutput;
-#elif OS(LINUX)
+#elif OS(OPENBSD)
     s_gl->makeCurrent(0, 0);
     s_gl->destroyContext(m_contextObj);
     s_gl->destroyPbuffer(m_pbuffer);
@@ -615,7 +615,7 @@
     if (CGLGetCurrentContext() != m_contextObj)
         if (CGLSetCurrentContext(m_contextObj) == kCGLNoError)
             return true;
-#elif OS(LINUX)
+#elif OS(OPENBSD)
     if (s_gl->getCurrentContext() != m_contextObj)
         if (s_gl->makeCurrent(m_pbuffer, m_contextObj))
             return true;
Index: src/third_party/WebKit/WebKit/chromium/src/WebViewImpl.cpp
===================================================================
--- third_party/WebKit/WebKit/chromium/src/WebViewImpl.cpp	(revision 56239)
+++ third_party/WebKit/WebKit/chromium/src/WebViewImpl.cpp	(working copy)
@@ -103,7 +103,7 @@
 #include "KeyboardCodesWin.h"
 #include "RenderThemeChromiumWin.h"
 #else
-#if OS(LINUX)
+#if OS(LINUX) || OS(OPENBSD)
 #include "RenderThemeChromiumLinux.h"
 #endif
 #include "KeyboardCodesPosix.h"
@@ -371,7 +371,7 @@
         || (event.button == WebMouseEvent::ButtonLeft
             && event.modifiers & WebMouseEvent::ControlKey))
         mouseContextMenu(event);
-#elif OS(LINUX)
+#elif OS(LINUX) || OS(OPENBSD)
     if (event.button == WebMouseEvent::ButtonRight)
         mouseContextMenu(event);
 #endif
@@ -410,7 +410,7 @@
     if (!mainFrameImpl() || !mainFrameImpl()->frameView())
         return;
 
-#if OS(LINUX)
+#if OS(LINUX) || OS(OPENBSD)
     // If the event was a middle click, attempt to copy text into the focused
     // frame. We execute this before we let the page have a go at the event
     // because the page may change what is focused during in its event handler.
@@ -490,11 +490,11 @@
     if (!handler)
         return keyEventDefault(event);
 
-#if OS(WINDOWS) || OS(LINUX)
+#if OS(WINDOWS) || OS(LINUX) || OS(OPENBSD)
     const WebInputEvent::Type contextMenuTriggeringEventType =
 #if OS(WINDOWS)
         WebInputEvent::KeyUp;
-#elif OS(LINUX)
+#elif OS(LINUX) || OS(OPENBSD)
         WebInputEvent::RawKeyDown;
 #endif
 
@@ -636,7 +636,7 @@
 //
 // This function is an ugly copy/paste and should be cleaned up when the
 // WebKitWin version is cleaned: https://bugs.webkit.org/show_bug.cgi?id=20438
-#if OS(WINDOWS) || OS(LINUX)
+#if OS(WINDOWS) || OS(LINUX) || OS(OPENBSD)
 // FIXME: implement on Mac
 bool WebViewImpl::sendContextMenuEvent(const WebKeyboardEvent& event)
 {
@@ -1833,7 +1833,7 @@
 void WebViewImpl::setScrollbarColors(unsigned inactiveColor,
                                      unsigned activeColor,
                                      unsigned trackColor) {
-#if OS(LINUX)
+#if OS(LINUX) || OS(OPENBSD)
     RenderThemeChromiumLinux::setScrollbarColors(inactiveColor,
                                                  activeColor,
                                                  trackColor);
@@ -1844,7 +1844,7 @@
                                      unsigned activeForegroundColor,
                                      unsigned inactiveBackgroundColor,
                                      unsigned inactiveForegroundColor) {
-#if OS(LINUX)
+#if OS(LINUX) || OS(OPENBSD)
     RenderThemeChromiumLinux::setSelectionColors(activeBackgroundColor,
                                                  activeForegroundColor,
                                                  inactiveBackgroundColor,
@@ -1885,7 +1885,7 @@
                                                  bool alt, bool meta,
                                                  WebNavigationPolicy* policy)
 {
-#if OS(WINDOWS) || OS(LINUX) || OS(FREEBSD) || OS(SOLARIS)
+#if OS(WINDOWS) || OS(LINUX) || OS(OPENBSD) || OS(SOLARIS)
     const bool newTabModifier = (button == 1) || ctrl;
 #elif OS(DARWIN)
     const bool newTabModifier = (button == 1) || meta;
Index: src/third_party/hunspell/hunspell.gyp
===================================================================
--- third_party/hunspell/hunspell.gyp	(revision 41000)
+++ third_party/hunspell/hunspell.gyp	(working copy)
@@ -63,11 +63,12 @@
         ],
       },
       'conditions': [
-        ['OS=="linux"', {
+        ['OS=="linux" or OS=="openbsd"', {
           'cflags': [
             '-Wno-unused-value',
             '-Wno-unused-variable',
             '-Wno-write-strings',
+            '-Wno-parentheses',
           ],
         }],
       ],
Index: src/third_party/icu/public/common/unicode/umachine.h
===================================================================
--- third_party/icu/public/common/unicode/umachine.h	(revision 37341)
+++ third_party/icu/public/common/unicode/umachine.h	(working copy)
@@ -49,6 +49,8 @@
 #   include "unicode/pmac.h"
 #elif defined(__linux__)
 #   include "unicode/plinux.h"
+#elif defined(__OpenBSD__)
+#   include "unicode/pfreebsd.h"
 #else
 #   include "unicode/platform.h"
 #endif
Index: src/third_party/icu/icu.gyp
===================================================================
--- third_party/icu/icu.gyp	(revision 37341)
+++ third_party/icu/icu.gyp	(working copy)
@@ -38,7 +38,7 @@
         }, {  # else: OS != "win"
           'sources!': ['icudt42.dll'],
         }],
-        [ 'OS != "linux"', {
+        [ 'OS != "linux" and OS!= "openbsd"', {
           'sources!': ['linux/icudt42l_dat.s'],
         }],
         [ 'OS != "mac"', {
@@ -208,7 +208,7 @@
         ],
       },
       'conditions': [
-        [ 'OS=="linux"', {
+        [ 'OS=="linux" or OS=="openbsd"', {
           # Since ICU wants to internally use its own deprecated APIs, don't
           # complain about it.
           'cflags': [
@@ -396,7 +396,7 @@
             'source/stubdata/stubdata.c',
           ],
         }],
-        [ 'OS == "linux"', {
+        [ 'OS == "linux" or OS=="openbsd"', {
           'cflags': [
             # TODO(port): fix ICU to not depend on this flag.
             '-fno-strict-aliasing',
Index: src/tools/gyp/pylib/gyp/generator/make.py
===================================================================
--- tools/gyp/pylib/gyp/generator/make.py	(revision 794)
+++ tools/gyp/pylib/gyp/generator/make.py	(working copy)
@@ -34,7 +34,7 @@
 generator_default_variables = {
   'EXECUTABLE_PREFIX': '',
   'EXECUTABLE_SUFFIX': '',
-  'OS': 'linux',
+# 'OS': 'linux',
   'STATIC_LIB_PREFIX': 'lib',
   'SHARED_LIB_PREFIX': 'lib',
   'STATIC_LIB_SUFFIX': '.a',
@@ -147,7 +147,7 @@
 # and dollar signs past make, the shell, and sed at the same time."""
 r"""
 define fixup_dep
-sed -i -e "s|^$(notdir $@)|$@|" $(depfile).tmp
+sed -e "s|^$(notdir $@)|$@|" $(depfile).tmp > $(depfile).tmp2 && mv $(depfile).tmp2 $(depfile).tmp
 sed -e "s|^[^:]*: *||" -e "s| *\\\\$$||" -e 's|^ *||' \
     -e "/./s|$$|:|" $(depfile).tmp >> $(depfile).tmp
 cat $(depfile).tmp >> $(depfile)
@@ -784,12 +784,14 @@
 # CFLAGS et al overrides must be target-local.
 # See "Target-specific Variable Values" in the GNU Make manual.""")
       self.WriteLn("$(OBJS): TOOLSET := $(TOOLSET)")
-      self.WriteLn("$(OBJS): GYP_CFLAGS := $(CFLAGS_$(BUILDTYPE)) "
+      self.WriteLn("$(OBJS): GYP_CFLAGS := $(INCS_$(BUILDTYPE)) "
+                   "$(CFLAGS_$(BUILDTYPE)) "
                    "$(CFLAGS_C_$(BUILDTYPE)) "
-                   "$(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE))")
-      self.WriteLn("$(OBJS): GYP_CXXFLAGS := $(CFLAGS_$(BUILDTYPE)) "
+                   "$(DEFS_$(BUILDTYPE))")
+      self.WriteLn("$(OBJS): GYP_CXXFLAGS := $(INCS_$(BUILDTYPE)) "
+                   "$(CFLAGS_$(BUILDTYPE)) "
                    "$(CFLAGS_CC_$(BUILDTYPE)) "
-                   "$(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE))")
+                   "$(DEFS_$(BUILDTYPE))")
 
     self.WriteLn()
 
Index: src/tools/gyp/test/additional-targets/src/dir1/actions.gyp
===================================================================
--- tools/gyp/test/additional-targets/src/dir1/actions.gyp	(revision 794)
+++ tools/gyp/test/additional-targets/src/dir1/actions.gyp	(working copy)
@@ -47,7 +47,7 @@
     },
   ],
   'conditions': [
-    ['OS=="linux"', {
+    ['OS=="linux" or OS=="openbsd"', {
       'target_defaults': {
         'cflags': ['-fPIC'],
       },
Index: src/tools/gyp/test/library/src/library.gyp
===================================================================
--- tools/gyp/test/library/src/library.gyp	(revision 794)
+++ tools/gyp/test/library/src/library.gyp	(working copy)
@@ -48,7 +48,7 @@
     },
   ],
   'conditions': [
-    ['OS=="linux"', {
+    ['OS=="linux" or OS=="openbsd"', {
       'target_defaults': {
         # Support 64-bit shared libs (also works fine for 32-bit).
         'cflags': ['-fPIC'],
Index: src/v8/tools/gyp/v8.gyp
===================================================================
--- v8/tools/gyp/v8.gyp	(revision 4183)
+++ v8/tools/gyp/v8.gyp	(working copy)
@@ -74,10 +74,15 @@
             'LinkIncremental': '2',
           },
         },
+        'conditions': [
+         ['OS=="openbsd"', {
+           'cflags': [ '-I/usr/local/include' ],
+         }],
+       ],
       },
       'Release': {
         'conditions': [
-          ['OS=="linux"', {
+          ['OS=="linux" or OS=="openbsd"', {
             'cflags!': [
               '-O2',
               '-Os',
@@ -97,6 +102,9 @@
               }],
             ],
           }],
+         ['OS=="openbsd"', {
+           'cflags': [ '-I/usr/local/include' ],
+         }],
           ['OS=="mac"', {
             'xcode_settings': {
               'GCC_OPTIMIZATION_LEVEL': '3',  # -O3
@@ -526,6 +534,17 @@
             ],
           }
         ],
+        ['OS=="openbsd"', {
+            'link_settings': {
+              'libraries': [
+                '-L/usr/local/lib -lexecinfo',
+            ]},
+            'sources': [
+              '../../src/platform-openbsd.cc',
+              '../../src/platform-posix.cc'
+            ],
+          }
+        ],
         ['OS=="mac"', {
           'sources': [
             '../../src/platform-macos.cc',
Index: src/v8/src/globals.h
===================================================================
--- v8/src/globals.h	(revision 4183)
+++ v8/src/globals.h	(working copy)
@@ -107,7 +107,7 @@
 #define V8PRIxPTR "lx"
 #endif
 
-#if defined(__APPLE__) && defined(__MACH__)
+#if (defined(__APPLE__) && defined(__MACH__)) || defined(__OpenBSD__)
 #define USING_MAC_ABI
 #endif
 
--- third_party/icu/public/common/unicode/pfreebsd.h.orig	Tue Mar 23 16:40:47 2010
+++ third_party/icu/public/common/unicode/pfreebsd.h	Tue Mar 23 16:40:47 2010
@@ -0,0 +1,313 @@
+/*
+******************************************************************************
+*
+*   Copyright (C) 1997-2007, International Business Machines
+*   Corporation and others.  All Rights Reserved.
+*
+******************************************************************************
+*
+*  FILE NAME : platform.h
+*
+*   Date        Name        Description
+*   05/13/98    nos         Creation (content moved here from ptypes.h).
+*   03/02/99    stephen     Added AS400 support.
+*   03/30/99    stephen     Added Linux support.
+*   04/13/99    stephen     Reworked for autoconf.
+******************************************************************************
+*/
+
+/**
+ * \file 
+ * \brief Basic types for the platform 
+ */
+
+/* Define the platform we're on. */
+#ifndef U_BSD
+#define U_BSD
+#endif
+
+/* Define whether inttypes.h is available */
+#ifndef U_HAVE_INTTYPES_H
+#define U_HAVE_INTTYPES_H 1
+#endif
+
+/*
+ * Define what support for C++ streams is available.
+ *     If U_IOSTREAM_SOURCE is set to 199711, then <iostream> is available
+ * (1997711 is the date the ISO/IEC C++ FDIS was published), and then
+ * one should qualify streams using the std namespace in ICU header
+ * files.
+ *     If U_IOSTREAM_SOURCE is set to 198506, then <iostream.h> is
+ * available instead (198506 is the date when Stroustrup published
+ * "An Extensible I/O Facility for C++" at the summer USENIX conference).
+ *     If U_IOSTREAM_SOURCE is 0, then C++ streams are not available and
+ * support for them will be silently suppressed in ICU.
+ *
+ */
+
+#ifndef U_IOSTREAM_SOURCE
+#define U_IOSTREAM_SOURCE 199711
+#endif
+
+/* Determines whether specific types are available */
+#ifndef U_HAVE_INT8_T
+#define U_HAVE_INT8_T 1
+#endif
+
+#ifndef U_HAVE_UINT8_T
+#define U_HAVE_UINT8_T 1
+#endif
+
+#ifndef U_HAVE_INT16_T
+#define U_HAVE_INT16_T 1
+#endif
+
+#ifndef U_HAVE_UINT16_T
+#define U_HAVE_UINT16_T 1
+#endif
+
+#ifndef U_HAVE_INT32_T
+#define U_HAVE_INT32_T 1
+#endif
+
+#ifndef U_HAVE_UINT32_T
+#define U_HAVE_UINT32_T 1
+#endif
+
+#ifndef U_HAVE_INT64_T
+#define U_HAVE_INT64_T 1
+#endif
+
+#ifndef U_HAVE_UINT64_T
+#define U_HAVE_UINT64_T 1
+#endif
+
+/*===========================================================================*/
+/* Generic data types                                                        */
+/*===========================================================================*/
+
+#include <sys/types.h>
+
+/* If your platform does not have the <inttypes.h> header, you may
+   need to edit the typedefs below. */
+#if U_HAVE_INTTYPES_H
+
+/* autoconf 2.13 sometimes can't properly find the data types in <inttypes.h> */
+/* os/390 needs <inttypes.h>, but it doesn't have int8_t, and it sometimes */
+/* doesn't have uint8_t depending on the OS version. */
+/* So we have this work around. */
+#ifdef OS390
+/* The features header is needed to get (u)int64_t sometimes. */
+#include <features.h>
+#if ! U_HAVE_INT8_T
+typedef signed char int8_t;
+#endif
+#if !defined(__uint8_t)
+#define __uint8_t 1
+typedef unsigned char uint8_t;
+#endif
+#endif /* OS390 */
+
+#include <inttypes.h>
+
+#else /* U_HAVE_INTTYPES_H */
+
+#if ! U_HAVE_INT8_T
+typedef signed char int8_t;
+#endif
+
+#if ! U_HAVE_UINT8_T
+typedef unsigned char uint8_t;
+#endif
+
+#if ! U_HAVE_INT16_T
+typedef signed short int16_t;
+#endif
+
+#if ! U_HAVE_UINT16_T
+typedef unsigned short uint16_t;
+#endif
+
+#if ! U_HAVE_INT32_T
+typedef signed int int32_t;
+#endif
+
+#if ! U_HAVE_UINT32_T
+typedef unsigned int uint32_t;
+#endif
+
+#if ! U_HAVE_INT64_T
+    typedef signed long long int64_t;
+/* else we may not have a 64-bit type */
+#endif
+
+#if ! U_HAVE_UINT64_T
+    typedef unsigned long long uint64_t;
+/* else we may not have a 64-bit type */
+#endif
+
+#endif
+
+/*===========================================================================*/
+/* Compiler and environment features                                         */
+/*===========================================================================*/
+
+/* Define whether namespace is supported */
+#ifndef U_HAVE_NAMESPACE
+#define U_HAVE_NAMESPACE 1
+#endif
+
+/* Determines the endianness of the platform
+   It's done this way in case multiple architectures are being built at once.
+   For example, Darwin supports fat binaries, which can be both PPC and x86 based. */
+#if defined(BYTE_ORDER) && defined(BIG_ENDIAN)
+#define U_IS_BIG_ENDIAN (BYTE_ORDER == BIG_ENDIAN)
+#else
+#define U_IS_BIG_ENDIAN 0
+#endif
+
+/* 1 or 0 to enable or disable threads.  If undefined, default is: enable threads. */
+#define ICU_USE_THREADS 1
+
+/* On strong memory model CPUs (e.g. x86 CPUs), we use a safe & quick double check lock. */
+#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
+#define UMTX_STRONG_MEMORY_MODEL 1
+#endif
+
+#ifndef U_DEBUG
+#define U_DEBUG 0
+#endif
+
+#ifndef U_RELEASE
+#define U_RELEASE 1
+#endif
+
+/* Determine whether to disable renaming or not. This overrides the
+   setting in umachine.h which is for all platforms. */
+#ifndef U_DISABLE_RENAMING
+#define U_DISABLE_RENAMING 0
+#endif
+
+/* Determine whether to override new and delete. */
+#ifndef U_OVERRIDE_CXX_ALLOCATION
+#define U_OVERRIDE_CXX_ALLOCATION 1
+#endif
+/* Determine whether to override placement new and delete for STL. */
+#ifndef U_HAVE_PLACEMENT_NEW
+#define U_HAVE_PLACEMENT_NEW 1
+#endif
+
+/* Determine whether to enable tracing. */
+#ifndef U_ENABLE_TRACING
+#define U_ENABLE_TRACING 0
+#endif
+
+/* Do we allow ICU users to use the draft APIs by default? */
+#ifndef U_DEFAULT_SHOW_DRAFT
+#define U_DEFAULT_SHOW_DRAFT 1
+#endif
+
+/* Define the library suffix in a C syntax. */
+#define U_HAVE_LIB_SUFFIX 0
+#define U_LIB_SUFFIX_C_NAME 
+#define U_LIB_SUFFIX_C_NAME_STRING ""
+
+/*===========================================================================*/
+/* Character data types                                                      */
+/*===========================================================================*/
+
+#if ((defined(OS390) && (!defined(__CHARSET_LIB) || !__CHARSET_LIB))) || defined(OS400)
+#   define U_CHARSET_FAMILY 1
+#endif
+
+/*===========================================================================*/
+/* Information about wchar support                                           */
+/*===========================================================================*/
+
+#define U_HAVE_WCHAR_H      1
+#define U_SIZEOF_WCHAR_T    4
+
+#define U_HAVE_WCSCPY       1
+
+/**
+ * \def U_DECLARE_UTF16
+ * Do not use this macro. Use the UNICODE_STRING or U_STRING_DECL macros
+ * instead.
+ * @internal
+ */
+#if 1 || defined(U_CHECK_UTF16_STRING)
+#if (defined(__xlC__) && defined(__IBM_UTF_LITERAL) && U_SIZEOF_WCHAR_T != 2) \
+    || (defined(__HP_aCC) && __HP_aCC >= 035000) \
+    || (defined(__HP_cc) && __HP_cc >= 111106)
+#define U_DECLARE_UTF16(string) u ## string
+#elif (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x550)
+/* || (defined(__SUNPRO_C) && __SUNPRO_C >= 0x580) */
+/* Sun's C compiler has issues with this notation, and it's unreliable. */
+#define U_DECLARE_UTF16(string) U ## string
+#elif U_SIZEOF_WCHAR_T == 2 \
+    && (U_CHARSET_FAMILY == 0 || ((defined(OS390) || defined(OS400)) && defined(__UCS2__)))
+#define U_DECLARE_UTF16(string) L ## string
+#endif
+#endif
+
+/*===========================================================================*/
+/* Information about POSIX support                                           */
+/*===========================================================================*/
+
+#define U_HAVE_NL_LANGINFO_CODESET  1
+#define U_NL_LANGINFO_CODESET       CODESET
+
+#if 1
+#define U_TZSET         tzset
+#endif
+#if 0
+#define U_TIMEZONE      
+#endif
+#if 1
+#define U_TZNAME        tzname
+#endif
+
+#define U_HAVE_MMAP     1
+#define U_HAVE_POPEN    1
+
+/*===========================================================================*/
+/* Symbol import-export control                                              */
+/*===========================================================================*/
+
+#if 1
+#define U_EXPORT __attribute__((visibility("default")))
+/*#elif defined(__HP_aCC) || defined(__HP_cc)
+#define U_EXPORT __declspec(dllexport)*/
+#else
+#define U_EXPORT
+#endif
+
+/* U_CALLCONV is releated to U_EXPORT2 */
+#define U_EXPORT2
+
+/* cygwin needs to export/import data */
+#ifdef U_CYGWIN
+#define U_IMPORT __declspec(dllimport)
+#else
+#define U_IMPORT 
+#endif
+
+/*===========================================================================*/
+/* Code alignment and C function inlining                                    */
+/*===========================================================================*/
+
+#ifndef U_INLINE
+#   ifdef __cplusplus
+#       define U_INLINE inline
+#   else
+#       define U_INLINE inline
+#   endif
+#endif
+
+#define U_ALIGN_CODE(n) 
+
+/*===========================================================================*/
+/* Programs used by ICU code                                                 */
+/*===========================================================================*/
+
+#define U_MAKE  "/usr/local/bin/gmake"
--- third_party/libevent/openbsd/event-config.h.orig	Tue Mar 23 16:12:36 2010
+++ third_party/libevent/openbsd/event-config.h	Tue Mar 23 16:12:36 2010
@@ -0,0 +1,262 @@
+/* event-config.h
+ * Generated by autoconf; post-processed by libevent.
+ * Do not edit this file.
+ * Do not rely on macros in this file existing in later versions.
+ */
+#ifndef _EVENT_CONFIG_H_
+#define _EVENT_CONFIG_H_
+/* config.h.  Generated from config.h.in by configure.  */
+/* config.h.in.  Generated from configure.in by autoheader.  */
+
+/* Define if clock_gettime is available in libc */
+#define _EVENT_DNS_USE_CPU_CLOCK_FOR_ID 1
+
+/* Define is no secure id variant is available */
+/* #undef _EVENT_DNS_USE_GETTIMEOFDAY_FOR_ID */
+
+/* Define to 1 if you have the `clock_gettime' function. */
+#define _EVENT_HAVE_CLOCK_GETTIME 1
+
+/* Define if /dev/poll is available */
+/* #undef _EVENT_HAVE_DEVPOLL */
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#define _EVENT_HAVE_DLFCN_H 1
+
+/* Define if your system supports the epoll system calls */
+/* #undef _EVENT_HAVE_EPOLL */
+
+/* Define to 1 if you have the `epoll_ctl' function. */
+/* #undef _EVENT_HAVE_EPOLL_CTL */
+
+/* Define if your system supports event ports */
+/* #undef _EVENT_HAVE_EVENT_PORTS */
+
+/* Define to 1 if you have the `fcntl' function. */
+#define _EVENT_HAVE_FCNTL 1
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#define _EVENT_HAVE_FCNTL_H 1
+
+/* Define to 1 if you have the `getaddrinfo' function. */
+#define _EVENT_HAVE_GETADDRINFO 1
+
+/* Define to 1 if you have the `getnameinfo' function. */
+#define _EVENT_HAVE_GETNAMEINFO 1
+
+/* Define to 1 if you have the `gettimeofday' function. */
+#define _EVENT_HAVE_GETTIMEOFDAY 1
+
+/* Define to 1 if you have the `inet_ntop' function. */
+#define _EVENT_HAVE_INET_NTOP 1
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define _EVENT_HAVE_INTTYPES_H 1
+
+/* Define to 1 if you have the `kqueue' function. */
+#define _EVENT_HAVE_KQUEUE 1
+
+/* Define to 1 if you have the `nsl' library (-lnsl). */
+/* #undef _EVENT_HAVE_LIBNSL */
+
+/* Define to 1 if you have the `resolv' library (-lresolv). */
+/* #undef _EVENT_HAVE_LIBRESOLV */
+
+/* Define to 1 if you have the `rt' library (-lrt). */
+#define _EVENT_HAVE_LIBRT 1
+
+/* Define to 1 if you have the `socket' library (-lsocket). */
+/* #undef _EVENT_HAVE_LIBSOCKET */
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define _EVENT_HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the <netinet/in6.h> header file. */
+/* #undef _EVENT_HAVE_NETINET_IN6_H */
+
+/* Define to 1 if you have the `poll' function. */
+#define _EVENT_HAVE_POLL 1
+
+/* Define to 1 if you have the <poll.h> header file. */
+#define _EVENT_HAVE_POLL_H 1
+
+/* Define to 1 if you have the `port_create' function. */
+/* #undef _EVENT_HAVE_PORT_CREATE */
+
+/* Define to 1 if you have the <port.h> header file. */
+/* #undef _EVENT_HAVE_PORT_H */
+
+/* Define to 1 if you have the `select' function. */
+#define _EVENT_HAVE_SELECT 1
+
+/* Define if F_SETFD is defined in <fcntl.h> */
+#define _EVENT_HAVE_SETFD 1
+
+/* Define to 1 if you have the `sigaction' function. */
+#define _EVENT_HAVE_SIGACTION 1
+
+/* Define to 1 if you have the `signal' function. */
+#define _EVENT_HAVE_SIGNAL 1
+
+/* Define to 1 if you have the <signal.h> header file. */
+#define _EVENT_HAVE_SIGNAL_H 1
+
+/* Define to 1 if you have the <stdarg.h> header file. */
+#define _EVENT_HAVE_STDARG_H 1
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define _EVENT_HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define _EVENT_HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define _EVENT_HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define _EVENT_HAVE_STRING_H 1
+
+/* Define to 1 if you have the `strlcpy' function. */
+#define _EVENT_HAVE_STRLCPY 1
+
+/* Define to 1 if you have the `strsep' function. */
+#define _EVENT_HAVE_STRSEP 1
+
+/* Define to 1 if you have the `strtok_r' function. */
+#define _EVENT_HAVE_STRTOK_R 1
+
+/* Define to 1 if you have the `strtoll' function. */
+#define _EVENT_HAVE_STRTOLL 1
+
+/* Define to 1 if the system has the type `struct in6_addr'. */
+#define _EVENT_HAVE_STRUCT_IN6_ADDR 1
+
+/* Define to 1 if you have the <sys/devpoll.h> header file. */
+/* #undef _EVENT_HAVE_SYS_DEVPOLL_H */
+
+/* Define to 1 if you have the <sys/epoll.h> header file. */
+/* #undef _EVENT_HAVE_SYS_EPOLL_H */
+
+/* Define to 1 if you have the <sys/event.h> header file. */
+#define _EVENT_HAVE_SYS_EVENT_H 1
+
+/* Define to 1 if you have the <sys/ioctl.h> header file. */
+#define _EVENT_HAVE_SYS_IOCTL_H 1
+
+/* Define to 1 if you have the <sys/param.h> header file. */
+#define _EVENT_HAVE_SYS_PARAM_H 1
+
+/* Define to 1 if you have the <sys/queue.h> header file. */
+#define _EVENT_HAVE_SYS_QUEUE_H 1
+
+/* Define to 1 if you have the <sys/select.h> header file. */
+#define _EVENT_HAVE_SYS_SELECT_H 1
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+#define _EVENT_HAVE_SYS_SOCKET_H 1
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define _EVENT_HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#define _EVENT_HAVE_SYS_TIME_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define _EVENT_HAVE_SYS_TYPES_H 1
+
+/* Define if TAILQ_FOREACH is defined in <sys/queue.h> */
+#define _EVENT_HAVE_TAILQFOREACH 1
+
+/* Define if timeradd is defined in <sys/time.h> */
+#define _EVENT_HAVE_TIMERADD 1
+
+/* Define if timerclear is defined in <sys/time.h> */
+#define _EVENT_HAVE_TIMERCLEAR 1
+
+/* Define if timercmp is defined in <sys/time.h> */
+#define _EVENT_HAVE_TIMERCMP 1
+
+/* Define if timerisset is defined in <sys/time.h> */
+#define _EVENT_HAVE_TIMERISSET 1
+
+/* Define to 1 if the system has the type `uint16_t'. */
+#define _EVENT_HAVE_UINT16_T 1
+
+/* Define to 1 if the system has the type `uint32_t'. */
+#define _EVENT_HAVE_UINT32_T 1
+
+/* Define to 1 if the system has the type `uint64_t'. */
+#define _EVENT_HAVE_UINT64_T 1
+
+/* Define to 1 if the system has the type `uint8_t'. */
+#define _EVENT_HAVE_UINT8_T 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define _EVENT_HAVE_UNISTD_H 1
+
+/* Define to 1 if you have the `vasprintf' function. */
+#define _EVENT_HAVE_VASPRINTF 1
+
+/* Define if kqueue works correctly with pipes */
+#define _EVENT_HAVE_WORKING_KQUEUE 1
+
+/* Name of package */
+#define _EVENT_PACKAGE "libevent"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define _EVENT_PACKAGE_BUGREPORT ""
+
+/* Define to the full name of this package. */
+#define _EVENT_PACKAGE_NAME ""
+
+/* Define to the full name and version of this package. */
+#define _EVENT_PACKAGE_STRING ""
+
+/* Define to the one symbol short name of this package. */
+#define _EVENT_PACKAGE_TARNAME ""
+
+/* Define to the version of this package. */
+#define _EVENT_PACKAGE_VERSION ""
+
+/* The size of `int', as computed by sizeof. */
+#define _EVENT_SIZEOF_INT 4
+
+/* The size of `long', as computed by sizeof. */
+#define _EVENT_SIZEOF_LONG 8
+
+/* The size of `long long', as computed by sizeof. */
+#define _EVENT_SIZEOF_LONG_LONG 8
+
+/* The size of `short', as computed by sizeof. */
+#define _EVENT_SIZEOF_SHORT 2
+
+/* Define to 1 if you have the ANSI C header files. */
+#define _EVENT_STDC_HEADERS 1
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#define _EVENT_TIME_WITH_SYS_TIME 1
+
+/* Version number of package */
+#define _EVENT_VERSION "1.4.13-stable"
+
+/* Define to appropriate substitue if compiler doesnt have __func__ */
+/* #undef _EVENT___func__ */
+
+/* Define to empty if `const' does not conform to ANSI C. */
+/* #undef _EVENT_const */
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+   calls it, or to nothing if 'inline' is not supported under any name.  */
+#ifndef _EVENT___cplusplus
+/* #undef _EVENT_inline */
+#endif
+
+/* Define to `int' if <sys/types.h> does not define. */
+/* #undef _EVENT_pid_t */
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+/* #undef _EVENT_size_t */
+
+/* Define to unsigned int if you dont have it */
+/* #undef _EVENT_socklen_t */
+#endif
--- /dev/null	Tue Mar 30 13:28:01 2010
+++ media/audio/openbsd/audio_manager_openbsd.cc	Wed Mar 24 13:42:18 2010
@@ -0,0 +1,60 @@
+// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "media/audio/openbsd/audio_manager_openbsd.h"
+
+#include "base/at_exit.h"
+#include "base/logging.h"
+//#include "media/audio/fake_audio_output_stream.h"
+//#include "media/audio/linux/alsa_output.h"
+//#include "media/audio/linux/alsa_wrapper.h"
+
+namespace {
+AudioManagerOpenBSD* g_audio_manager = NULL;
+}  // namespace
+
+// Implementation of AudioManager.
+bool AudioManagerOpenBSD::HasAudioDevices() {
+  NOTIMPLEMENTED();
+  return false;
+}
+
+AudioOutputStream* AudioManagerOpenBSD::MakeAudioStream(Format format,
+                                                        int channels,
+                                                        int sample_rate,
+                                                        char bits_per_sample) {
+  NOTIMPLEMENTED();
+  return NULL;
+}
+
+AudioManagerOpenBSD::AudioManagerOpenBSD() {
+}
+
+AudioManagerOpenBSD::~AudioManagerOpenBSD() {
+}
+
+void AudioManagerOpenBSD::Init() {
+}
+
+void AudioManagerOpenBSD::MuteAll() {
+  NOTIMPLEMENTED();
+}
+
+void AudioManagerOpenBSD::UnMuteAll() {
+  NOTIMPLEMENTED();
+}
+
+void DestroyAudioManagerOpenBSD(void* not_used) {
+  delete g_audio_manager;
+  g_audio_manager = NULL;
+}
+
+AudioManager* AudioManager::GetAudioManager() {
+  if (!g_audio_manager) {
+    g_audio_manager = new AudioManagerOpenBSD();
+    g_audio_manager->Init();
+    base::AtExitManager::RegisterCallback(&DestroyAudioManagerOpenBSD, NULL);
+  }
+  return g_audio_manager;
+}
--- /dev/null	Tue Mar 30 13:28:08 2010
+++ media/audio/openbsd/audio_manager_openbsd.h	Wed Mar 24 13:42:18 2010
@@ -0,0 +1,39 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MEDIA_AUDIO_OPENBSD_AUDIO_MANAGER_OPENBSD_H_
+#define MEDIA_AUDIO_OPENBSD_AUDIO_MANAGER_OPENBSD_H_
+
+//#include <map>
+
+//#include "base/ref_counted.h"
+//#include "base/scoped_ptr.h"
+//#include "base/thread.h"
+#include "media/audio/audio_output.h"
+
+class AudioManagerOpenBSD : public AudioManager {
+ public:
+  AudioManagerOpenBSD();
+
+  // Call before using a newly created AudioManagerOpenBSD instance.
+  virtual void Init();
+
+  // Implementation of AudioManager.
+  virtual bool HasAudioDevices();
+  virtual AudioOutputStream* MakeAudioStream(Format format, int channels,
+                                             int sample_rate,
+                                             char bits_per_sample);
+  virtual void MuteAll();
+  virtual void UnMuteAll();
+
+ protected:
+  // Friend function for invoking the destructor at exit.
+  friend void DestroyAudioManagerOpenBSD(void*);
+  virtual ~AudioManagerOpenBSD();
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(AudioManagerOpenBSD);
+};
+
+#endif  // MEDIA_AUDIO_OPENBSD_AUDIO_MANAGER_OPENBSD_H_
