Update to 10.0.648.204, which is the latest release from the Stable series.

There are still some problems with it on 8.X (and presumably 7.X), see
pkg-message for a possible workaround.

This would not have been possible without:
- portmgr@ for drawing me into this in October last year
- beat@ for providing a development repository
- dhw@ for creating the freebsd-chromium list
- all the patch contributors and testers on the freebsd-chromium list
This commit is contained in:
Rene Ladan 2011-04-01 16:45:01 +00:00
parent 0d22e27da9
commit f3285ad410
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=272093
199 changed files with 10134 additions and 6590 deletions

View file

@ -7,11 +7,12 @@
PORTNAME= chromium
DISTVERSIONPREFIX= courgette-redacted-
DISTVERSION= 6.0.472.63
DISTVERSION= 10.0.648.204
CATEGORIES= www
MASTER_SITES= http://download.goodking.org/downloads/ \
ftp://rene-ladan.nl/pub/distfiles/ \
CRITICAL
http://files.etoilebsd.net/goodking/
DISTNAME= chromium-${DISTVERSIONPREFIX}${DISTVERSION}
MAINTAINER= chromium@FreeBSD.org
COMMENT= A mostly BSD-licensed web browser based on WebKit and Gtk+
@ -25,7 +26,6 @@ BUILD_DEPENDS= ${LOCALBASE}/bin/flex:${PORTSDIR}/textproc/flex \
# minimal version of nss, LIB_DEPENDS does not enforce this
LIB_DEPENDS= execinfo.1:${PORTSDIR}/devel/libexecinfo \
avformat:${PORTSDIR}/multimedia/ffmpeg \
cairo.2:${PORTSDIR}/graphics/cairo \
dbus-1.3:${PORTSDIR}/devel/dbus \
dbus-glib-1.2:${PORTSDIR}/devel/dbus-glib \
@ -35,8 +35,6 @@ LIB_DEPENDS= execinfo.1:${PORTSDIR}/devel/libexecinfo \
nss3.1:${PORTSDIR}/security/nss \
gnome-keyring.0:${PORTSDIR}/security/libgnome-keyring
FORBIDDEN= several security vulnerabilities
RUN_DEPENDS= ${LOCALBASE}/lib/alsa-lib/libasound_module_pcm_oss.so:${PORTSDIR}/audio/alsa-plugins \
${LOCALBASE}/lib/X11/fonts/Droid/fonts.dir:${PORTSDIR}/x11-fonts/droid-fonts-ttf
@ -47,7 +45,7 @@ USE_PYTHON= 2.6+ # only needed at build time
USE_PERL5_BUILD=yes
USE_GMAKE= yes
MAN1= chrome.1
USE_XORG= scrnsaverproto xtst
USE_XORG= scrnsaverproto x11 xproto xtst
USE_GNOME= glib20 gtk20 dconf libxslt
LICENSE_COMB= multi
LICENSE= BSD LGPL21 MPL
@ -64,22 +62,31 @@ ALL_TARGET= chrome
#GYP_DEFINES+= use_system_libjpeg=1
#GYP_DEFINES+= use_system_libpng=1
GYP_DEFINES+= use_system_libxml=1
GYP_DEFINES+= use_system_ffmpeg=0
#GYP_DEFINES+= use_system_sqlite=0
GYP_DEFINES+= use_system_yasm=1
#GYP_DEFINES+= use_system_zlib=1
.include <bsd.port.options.mk>
GYP_DEFINES+= python_ver=${PYTHON_VER}
OPTIONS= CODECS "Compile and enable patented codecs like H.264" off \
GCONF "Use gconf2 for preferences" on \
SSE2 "Use SSE2, disable this for PIII or older" on \
VPX "Use system libvpx for VP8 codec" on
.include <bsd.port.pre.mk>
.include <bsd.port.options.mk>
.if ${OSVERSION} < 900033
BUILD_DEPENDS+= ${LOCALBASE}/bin/as:${PORTSDIR}/devel/binutils
CONFIGURE_ENV+= COMPILER_PATH=${LOCALBASE}/bin
MAKE_ENV+= COMPILER_PATH=${LOCALBASE}/bin
.endif
.if defined(WITH_CODECS)
GYP_DEFINES+= ffmpeg_branding=Chrome
GYP_DEFINES+= use_proprietary_codecs=1
.else
GYP_DEFINES+= ffmpeg_branding=Chromium
GYP_DEFINES+= use_proprietary_codecs=0
.endif
.if defined(WITH_GCONF)
@ -101,11 +108,11 @@ GYP_DEFINES+= use_system_vpx=1
BUILDTYPE= Release
.else
BUILDTYPE= Debug
STRIP=
.endif
MAKE_ENV+= BUILDTYPE=${BUILDTYPE}
MAKE_JOBS_SAFE= yes
STRIP=
pre-everything::
@${ECHO_MSG}
@ -121,21 +128,33 @@ post-patch:
@${REINPLACE_CMD} -e "s|/usr/local|${LOCALBASE}|" \
${WRKSRC}/base/base.gypi \
${WRKSRC}/build/common.gypi \
${WRKSRC}/third_party/ffmpeg/ffmpeg.gyp \
${WRKSRC}/third_party/icu/public/common/unicode/pfreebsd.h \
${WRKSRC}/third_party/tcmalloc/chromium/src/config_freebsd.h \
${WRKSRC}/third_party/WebKit/WebCore/plugins/PluginDatabase.cpp \
${WRKSRC}/third_party/libvpx/libvpx.gyp \
${WRKSRC}/third_party/WebKit/Source/WebCore/plugins/PluginDatabase.cpp \
${WRKSRC}/v8/tools/gyp/v8.gyp
@${REINPLACE_CMD} -e "s|/usr/include/vpx|${LOCALBASE}/include|" \
${WRKSRC}/third_party/ffmpeg/ffmpeg.gyp
@${REINPLACE_CMD} -e "s|linux|freebsd|" \
${WRKSRC}/tools/gyp/pylib/gyp/generator/make.py
@${REINPLACE_CMD} -e 's|/usr/bin/gcc|${CC}|' \
${WRKSRC}/third_party/WebKit/WebCore/bindings/scripts/IDLParser.pm \
${WRKSRC}/third_party/WebKit/WebCore/dom/make_names.pl
${WRKSRC}/third_party/WebKit/Source/WebCore/bindings/scripts/IDLParser.pm \
${WRKSRC}/third_party/WebKit/Source/WebCore/dom/make_names.pl
@${REINPLACE_CMD} -e "s|'flex'|'${LOCALBASE}/bin/flex'|" \
${WRKSRC}/third_party/angle/src/build_angle.gyp \
${WRKSRC}/third_party/WebKit/WebCore/WebCore.gyp/scripts/action_maketokenizer.py
${WRKSRC}/third_party/WebKit/Source/WebCore/WebCore.gyp/scripts/action_maketokenizer.py
@${REINPLACE_CMD} -e 's|gperf --key-positions|${LOCALBASE}/bin/gperf --key-positions|' \
${WRKSRC}/third_party/WebKit/WebCore/css/makeprop.pl \
${WRKSRC}/third_party/WebKit/WebCore/css/makevalues.pl \
${WRKSRC}/third_party/WebKit/WebCore/make-hash-tools.pl
${WRKSRC}/third_party/WebKit/Source/WebCore/css/makeprop.pl \
${WRKSRC}/third_party/WebKit/Source/WebCore/css/makevalues.pl \
${WRKSRC}/third_party/WebKit/Source/WebCore/make-hash-tools.pl
# kludges just to make it progress for now
@${REINPLACE_CMD} -e "s|/usr/lib|${LOCALBASE}/lib|" \
-e "s|'python_ver%': '2.5'|'python_ver%': '2.6'|" \
-e "s|.so.1.0|.so.1|" \
${WRKSRC}/build/common.gypi
@${REINPLACE_CMD} -e "s|'-ldl',|'-lc',|" \
${WRKSRC}/app/app_base.gypi \
${WRKSRC}/build/linux/system.gyp \
${WRKSRC}/chrome/chrome_browser.gypi \
${WRKSRC}/media/media.gyp
do-configure:
cd ${WRKSRC} && \
@ -155,4 +174,9 @@ do-install:
cd ${WRKSRC}/out/${BUILDTYPE} && ${COPYTREE_SHARE} "locales resources" ${DATADIR}
${LN} -sf ${DATADIR}/chrome ${PREFIX}/bin/
.include <bsd.port.post.mk>
post-install:
.if ${OSVERSION} < 900000
@${CAT} ${PKGMESSAGE}
.endif
.include <bsd.port.mk>

View file

@ -1,2 +1,2 @@
SHA256 (chromium-courgette-redacted-6.0.472.63.tar.xz) = 94ffd913f3724570eaa4bc9c61b8c78e0fd66c6d3e4a39fe4c27bcd075c0a455
SIZE (chromium-courgette-redacted-6.0.472.63.tar.xz) = 95188168
SHA256 (chromium-courgette-redacted-10.0.648.204.tar.xz) = c3f0de3a7f849e108b5572e2b458c39753f6ee51a37856a5142223b911d7b5e0
SIZE (chromium-courgette-redacted-10.0.648.204.tar.xz) = 113622144

View file

@ -0,0 +1,20 @@
--- app/app_base.gypi.orig 2011-03-20 22:02:04.362467155 +0200
+++ app/app_base.gypi 2011-03-20 22:02:04.479736529 +0200
@@ -232,7 +232,7 @@
'surface/io_surface_support_mac.cc',
'surface/io_surface_support_mac.h',
'surface/transport_dib.h',
- 'surface/transport_dib_linux.cc',
+ 'surface/transport_dib_freebsd.cc',
'surface/transport_dib_mac.cc',
'surface/transport_dib_win.cc',
'win/iat_patch_function.cc',
@@ -335,7 +335,7 @@
['exclude', '^win/*'],
],
}],
- ['OS=="linux"', {
+ ['OS=="linux" or OS=="freebsd"', {
'sources': [
'gfx/gl/gl_context_egl.cc',
'gfx/gl/gl_context_egl.h',

View file

@ -0,0 +1,38 @@
--- ./app/gfx/gl/gl_bindings.h.orig 2010-12-16 02:11:22.000000000 +0100
+++ ./app/gfx/gl/gl_bindings.h 2010-12-20 20:15:07.000000000 +0100
@@ -22,7 +22,7 @@
// The standard OpenGL native extension headers are also included.
#if defined(OS_WIN)
#include <GL/wglext.h>
-#elif defined(OS_LINUX)
+#elif defined(OS_LINUX) || defined(OS_FREEBSD)
#include <GL/glx.h>
#include <GL/glxext.h>
@@ -52,7 +52,7 @@
typedef struct osmesa_context *OSMesaContext;
typedef void (*OSMESAproc)();
-#if defined(OS_WIN) || defined(OS_LINUX)
+#if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_FREEBSD)
// Forward declare EGL types.
typedef unsigned int EGLBoolean;
@@ -75,7 +75,7 @@
typedef Window EGLNativeWindowType;
#endif
-#endif // OS_WIN || OS_LINUX
+#endif // OS_WIN || OS_LINUX || OS_FREEBSD
#include "gl_bindings_autogen_gl.h"
#include "gl_bindings_autogen_osmesa.h"
@@ -83,7 +83,7 @@
#if defined(OS_WIN)
#include "gl_bindings_autogen_egl.h"
#include "gl_bindings_autogen_wgl.h"
-#elif defined(OS_LINUX)
+#elif defined(OS_LINUX) || defined(OS_FREEBSD)
#include "gl_bindings_autogen_egl.h"
#include "gl_bindings_autogen_glx.h"
#endif

View file

@ -0,0 +1,20 @@
--- app/gfx/gl/gl_context_egl.cc.orig 2011-01-26 10:30:13.000000000 +0100
+++ app/gfx/gl/gl_context_egl.cc 2011-01-30 13:55:55.000000000 +0100
@@ -4,7 +4,7 @@
#include <EGL/egl.h>
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_FREEBSD)
extern "C" {
#include <X11/Xlib.h>
}
@@ -82,7 +82,7 @@
if (initialized)
return true;
-#ifdef OS_LINUX
+#ifdef OS_LINUX || defined(OS_FREEBSD)
EGLNativeDisplayType native_display = XOpenDisplay(NULL);
#else
EGLNativeDisplayType native_display = EGL_DEFAULT_DISPLAY;

View file

@ -0,0 +1,44 @@
--- ./app/surface/transport_dib.h.orig 2010-12-16 02:11:21.000000000 +0100
+++ ./app/surface/transport_dib.h 2010-12-20 20:15:07.000000000 +0100
@@ -8,7 +8,7 @@
#include "base/basictypes.h"
-#if defined(OS_WIN) || defined(OS_MACOSX)
+#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_FREEBSD)
#include "base/shared_memory.h"
#endif
@@ -78,7 +78,7 @@
static int fake_handle = 10;
return reinterpret_cast<Handle>(fake_handle++);
}
-#elif defined(OS_MACOSX)
+#elif defined(OS_MACOSX) || defined(OS_FREEBSD)
typedef base::SharedMemoryHandle Handle;
// On Mac, the inode number of the backing file is used as an id.
typedef base::SharedMemoryId Id;
@@ -93,7 +93,7 @@
static int fake_handle = 10;
return Handle(fake_handle++, false);
}
-#elif defined(USE_X11)
+#elif defined(OS_LINUX)
typedef int Handle; // These two ints are SysV IPC shared memory keys
typedef int Id;
@@ -171,11 +171,12 @@
private:
TransportDIB();
-#if defined(OS_WIN) || defined(OS_MACOSX)
+#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_FREEBSD)
explicit TransportDIB(base::SharedMemoryHandle dib);
base::SharedMemory shared_memory_;
uint32 sequence_num_;
-#elif defined(USE_X11)
+#endif
+#if defined(USE_X11)
int key_; // SysV shared memory id
void* address_; // mapped address
XSharedMemoryId x_shm_; // X id for the shared segment

View file

@ -0,0 +1,99 @@
--- app/surface/transport_dib_freebsd.cc.orig 2011-03-20 22:02:04.374736591 +0200
+++ app/surface/transport_dib_freebsd.cc 2011-03-20 22:02:04.482738307 +0200
@@ -0,0 +1,96 @@
+// 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.
+
+#include "app/surface/transport_dib.h"
+
+#include <unistd.h>
+#include <sys/stat.h>
+
+#include "base/eintr_wrapper.h"
+#include "base/shared_memory.h"
+#include "base/scoped_ptr.h"
+#include "skia/ext/platform_canvas.h"
+
+TransportDIB::TransportDIB()
+ : size_(0) {
+}
+
+TransportDIB::TransportDIB(TransportDIB::Handle dib)
+ : shared_memory_(dib, false /* read write */),
+ size_(0) {
+}
+
+TransportDIB::~TransportDIB() {
+}
+
+// static
+TransportDIB* TransportDIB::Create(size_t size, uint32 sequence_num) {
+ TransportDIB* dib = new TransportDIB;
+ if (!dib->shared_memory_.CreateAndMapAnonymous(size)) {
+ delete dib;
+ return NULL;
+ }
+
+ dib->size_ = size;
+ return dib;
+}
+
+// static
+TransportDIB* TransportDIB::Map(Handle handle) {
+ scoped_ptr<TransportDIB> dib(CreateWithHandle(handle));
+ if (!dib->Map())
+ return NULL;
+ return dib.release();
+}
+
+// static
+TransportDIB* TransportDIB::CreateWithHandle(Handle handle) {
+ return new TransportDIB(handle);
+}
+
+bool TransportDIB::Map() {
+ if (!is_valid(handle()))
+ return false;
+ if (memory())
+ return true;
+
+ struct stat st;
+ if ((fstat(shared_memory_.handle().fd, &st) != 0) ||
+ (!shared_memory_.Map(st.st_size))) {
+ return false;
+ }
+
+ size_ = st.st_size;
+ return true;
+}
+
+bool TransportDIB::is_valid(Handle dib) {
+ return dib.fd >= 0;
+}
+
+skia::PlatformCanvas* TransportDIB::GetPlatformCanvas(int w, int h) {
+ return new skia::PlatformCanvas(w, h, true,
+ reinterpret_cast<uint8_t*>(memory()));
+}
+
+void* TransportDIB::memory() const {
+ return shared_memory_.memory();
+}
+
+TransportDIB::Id TransportDIB::id() const {
+ return shared_memory_.id();
+}
+
+TransportDIB::Handle TransportDIB::handle() const {
+ return shared_memory_.handle();
+}
+
+XID TransportDIB::MapToX(Display* display) {
+ if (!x_shm_) {
+ x_shm_ = ui::AttachSharedMemory(display, key_);
+ display_ = display;
+ }
+
+ return x_shm_;
+}

View file

@ -0,0 +1,16 @@
--- ./base/base.gyp.orig 2010-12-16 02:11:49.000000000 +0100
+++ ./base/base.gyp 2010-12-20 20:15:07.000000000 +0100
@@ -241,6 +241,13 @@
],
}],
],
+ 'conditions': [
+ [ 'OS == "freebsd"', {
+ # fdatasync is not implemented on FreeBSD
+ 'sources/': [ ['exclude', '^test/test_file_util_linux.cc$'] ],
+ },
+ ],
+ ],
},
{
'target_name': 'test_support_base',

View file

@ -0,0 +1,36 @@
--- base/base.gypi.orig 2011-03-21 21:48:13.059300970 +0200
+++ base/base.gypi 2011-03-21 21:49:30.340376078 +0200
@@ -157,6 +157,7 @@
'process_posix.cc',
'process_util.cc',
'process_util.h',
+ 'process_util_freebsd.cc',
'process_util_linux.cc',
'process_util_mac.mm',
'process_util_posix.cc',
@@ -343,11 +344,9 @@
'message_pump_glib_x.cc',
],
}],
- [ 'OS != "linux"', {
+ [ 'OS != "linux" and OS != "freebsd"', {
'sources!': [
# Not automatically excluded by the *linux.cc rules.
- 'gtk_util.cc',
- 'gtk_util.h',
'linux_util.cc',
],
},
@@ -462,6 +461,12 @@
],
}],
[ 'OS == "freebsd" or OS == "openbsd"', {
+ # XXX rene: maybe this chunk should go one day
+ 'sources!': [
+ 'file_util_linux.cc',
+ 'process_linux.cc',
+ 'process_util_linux.cc',
+ ],
'link_settings': {
'libraries': [
'-L/usr/local/lib -lexecinfo',

View file

@ -0,0 +1,48 @@
--- base/debug/debugger_posix.cc.orig 2011-02-03 10:01:35.000000000 +0100
+++ base/debug/debugger_posix.cc 2011-02-06 17:07:57.000000000 +0100
@@ -15,6 +15,7 @@
#include <sys/sysctl.h>
#endif
#include <sys/types.h>
+#include <sys/user.h>
#include <unistd.h>
#include <string>
@@ -50,7 +51,7 @@
return false;
}
-#if defined(OS_MACOSX)
+#if defined(OS_MACOSX) || defined(OS_FREEBSD)
// Based on Apple's recommended method as described in
// http://developer.apple.com/qa/qa2004/qa1361.html
@@ -88,7 +89,11 @@
// This process is being debugged if the P_TRACED flag is set.
is_set = true;
+#if defined(OS_FREEBSD)
+ being_debugged = (info.ki_flag & P_TRACED) != 0;
+#else
being_debugged = (info.kp_proc.p_flag & P_TRACED) != 0;
+#endif
return being_debugged;
}
@@ -135,15 +140,7 @@
return false;
}
-#elif defined(OS_FREEBSD)
-
-bool BeingDebugged() {
- // TODO(benl): can we determine this under FreeBSD?
- NOTIMPLEMENTED();
- return false;
-}
-
-#endif // defined(OS_FREEBSD)
+#endif
// We want to break into the debugger in Debug mode, and cause a crash dump in
// Release mode. Breakpad behaves as follows:

View file

@ -0,0 +1,11 @@
--- ./base/debug/leak_annotations.h.orig 2010-12-16 02:11:48.000000000 +0100
+++ ./base/debug/leak_annotations.h 2010-12-20 20:15:07.000000000 +0100
@@ -8,7 +8,7 @@
#include "build/build_config.h"
-#if defined(OS_LINUX) && defined(USE_HEAPCHECKER)
+#if (defined(OS_LINUX) || defined(OS_FREEBSD)) && defined(USE_HEAPCHECKER)
#include "third_party/tcmalloc/chromium/src/google/heap-checker.h"

View file

@ -0,0 +1,14 @@
--- ./base/file_util_posix.cc.orig 2010-12-16 02:11:49.000000000 +0100
+++ ./base/file_util_posix.cc 2010-12-20 20:15:07.000000000 +0100
@@ -815,7 +815,11 @@
}
bool GetShmemTempDir(FilePath* path) {
+#if defined(OS_LINUX)
*path = FilePath("/dev/shm");
+#else
+ *path = FilePath("/tmp");
+#endif
return true;
}

View file

@ -0,0 +1,33 @@
--- base/linux_util.cc.orig 2011-03-21 20:43:02.797111222 +0200
+++ base/linux_util.cc 2011-03-21 20:44:28.268111587 +0200
@@ -133,12 +133,14 @@
char g_linux_distro[kDistroSize] =
#if defined(OS_CHROMEOS)
"CrOS";
+#elif defined(OS_FREEBSD)
+ "FreeBSD";
#else // if defined(OS_LINUX)
"Unknown";
#endif
std::string GetLinuxDistro() {
-#if defined(OS_CHROMEOS)
+#if defined(OS_CHROMEOS) || defined(OS_FREEBSD)
return g_linux_distro;
#elif defined(OS_LINUX)
LinuxDistroHelper* distro_state_singleton = LinuxDistroHelper::GetInstance();
@@ -194,6 +196,7 @@
return true;
}
+#if defined(OS_LINUX)
bool FindProcessHoldingSocket(pid_t* pid_out, ino_t socket_inode) {
DCHECK(pid_out);
bool already_found = false;
@@ -293,5 +296,5 @@
}
return -1;
}
-
+#endif // if defined(OS_LINUX)
} // namespace base

View file

@ -0,0 +1,39 @@
--- ./base/logging.h.orig 2010-12-16 02:11:49.000000000 +0100
+++ ./base/logging.h 2010-12-20 20:15:08.000000000 +0100
@@ -141,6 +141,18 @@
// There is also the special severity of DFATAL, which logs FATAL in
// debug mode, ERROR in normal mode.
+// XXX better comment -- must be before we use << and in global namespace
+// These functions are provided as a convenience for logging, which is where we
+// use streams (it is against Google style to use streams in other places). It
+// is designed to allow you to emit non-ASCII Unicode strings to the log file,
+// which is normally ASCII. It is relatively slow, so try not to use it for
+// common cases. Non-ASCII characters will be converted to UTF-8 by these
+// operators.
+std::ostream& operator<<(std::ostream& out, const wchar_t* wstr);
+inline std::ostream& operator<<(std::ostream& out, const std::wstring& wstr) {
+ return out << wstr.c_str();
+}
+
namespace logging {
// Where to record logging output? A flat file and/or system debug log via
@@ -857,17 +869,6 @@
} // namespace logging
-// These functions are provided as a convenience for logging, which is where we
-// use streams (it is against Google style to use streams in other places). It
-// is designed to allow you to emit non-ASCII Unicode strings to the log file,
-// which is normally ASCII. It is relatively slow, so try not to use it for
-// common cases. Non-ASCII characters will be converted to UTF-8 by these
-// operators.
-std::ostream& operator<<(std::ostream& out, const wchar_t* wstr);
-inline std::ostream& operator<<(std::ostream& out, const std::wstring& wstr) {
- return out << wstr.c_str();
-}
-
// The NOTIMPLEMENTED() macro annotates codepaths which have
// not been implemented yet.
//

View file

@ -0,0 +1,41 @@
--- base/process_util.h.orig 2011-03-21 07:38:40.133112029 +0200
+++ base/process_util.h 2011-03-21 07:51:24.970111144 +0200
@@ -28,6 +28,10 @@
#include <sys/types.h>
#endif
+#if defined(OS_FREEBSD)
+struct kinfo_proc;
+#endif
+
#include <list>
#include <string>
#include <utility>
@@ -161,7 +165,7 @@
// Win XP SP1 as well.
ProcessId GetProcId(ProcessHandle process);
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_FREEBSD)
// Returns the ID for the parent of the given process.
ProcessId GetParentProcessId(ProcessHandle process);
@@ -172,7 +176,9 @@
// CPU-related ticks. Returns -1 on parse error.
// Exposed for testing.
int ParseProcStatCPU(const std::string& input);
+#endif
+#if defined(OS_LINUX)
static const char kAdjustOOMScoreSwitch[] = "--adjust-oom-score";
// This adjusts /proc/process/oom_adj so the Linux OOM killer will prefer
@@ -439,7 +445,7 @@
#if defined(OS_WIN)
HANDLE snapshot_;
bool started_iteration_;
-#elif defined(OS_MACOSX)
+#elif defined(OS_MACOSX) || defined(OS_FREEBSD)
std::vector<kinfo_proc> kinfo_procs_;
size_t index_of_kinfo_proc_;
#elif defined(OS_POSIX)

View file

@ -0,0 +1,317 @@
--- /dev/null 2011-03-21 20:44:00.000000000 +0200
+++ base/process_util_freebsd.cc 2011-03-21 20:47:32.701912810 +0200
@@ -0,0 +1,314 @@
+// 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.
+
+#include "base/process_util.h"
+
+#include <ctype.h>
+#include <dirent.h>
+#include <dlfcn.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <sys/sysctl.h>
+#include <sys/user.h>
+#include <time.h>
+#include <unistd.h>
+
+#include "base/file_util.h"
+#include "base/logging.h"
+#include "base/string_number_conversions.h"
+#include "base/string_split.h"
+#include "base/string_tokenizer.h"
+#include "base/string_util.h"
+#include "base/sys_info.h"
+//#include "base/thread_restrictions.h"
+
+namespace base {
+
+ProcessId GetParentProcessId(ProcessHandle process) {
+ struct kinfo_proc info;
+ int mib[4];
+ size_t info_size = sizeof(info);
+
+ mib[0] = CTL_KERN;
+ mib[1] = KERN_PROC;
+ mib[2] = KERN_PROC_PID;
+ mib[3] = process;
+
+ if (sysctl(mib, 4, &info, &info_size, NULL, 0) < 0)
+ return -1;
+
+ return info.ki_ppid;
+}
+
+FilePath GetProcessExecutablePath(ProcessHandle process) {
+ char pathname[PATH_MAX];
+ int mib[4];
+ size_t len;
+
+ mib[0] = CTL_KERN;
+ mib[1] = KERN_PROC;
+ mib[2] = KERN_PROC_PATHNAME;
+ mib[3] = process;
+
+ len = sizeof(pathname);
+
+ if (sysctl(mib, 4, pathname, &len, NULL, 0) < 0 || len == 0)
+ return FilePath();
+
+ return FilePath(std::string(pathname));
+}
+
+ProcessIterator::ProcessIterator(const ProcessFilter* filter)
+ : index_of_kinfo_proc_(),
+ filter_(filter) {
+
+ int mib[4];
+
+ mib[0] = CTL_KERN;
+ mib[1] = KERN_PROC;
+ mib[2] = KERN_PROC_UID;
+ mib[3] = getuid();
+
+ bool done = false;
+ int try_num = 1;
+ const int max_tries = 10;
+
+ do {
+ size_t len = 0;
+ if (sysctl(mib, 4, NULL, &len, NULL, 0) <0 ){
+ LOG(ERROR) << "failed to get the size needed for the process list";
+ kinfo_procs_.resize(0);
+ done = true;
+ } else {
+ size_t num_of_kinfo_proc = len / sizeof(struct kinfo_proc);
+ // Leave some spare room for process table growth (more could show up
+ // between when we check and now)
+ num_of_kinfo_proc += 16;
+ kinfo_procs_.resize(num_of_kinfo_proc);
+ len = num_of_kinfo_proc * sizeof(struct kinfo_proc);
+ if (sysctl(mib, 4, &kinfo_procs_[0], &len, NULL, 0) <0) {
+ // If we get a mem error, it just means we need a bigger buffer, so
+ // loop around again. Anything else is a real error and give up.
+ if (errno != ENOMEM) {
+ LOG(ERROR) << "failed to get the process list";
+ kinfo_procs_.resize(0);
+ done = true;
+ }
+ } else {
+ // Got the list, just make sure we're sized exactly right
+ size_t num_of_kinfo_proc = len / sizeof(struct kinfo_proc);
+ kinfo_procs_.resize(num_of_kinfo_proc);
+ done = true;
+ }
+ }
+ } while (!done && (try_num++ < max_tries));
+
+ if (!done) {
+ LOG(ERROR) << "failed to collect the process list in a few tries";
+ kinfo_procs_.resize(0);
+ }
+}
+
+ProcessIterator::~ProcessIterator() {
+}
+
+bool ProcessIterator::CheckForNextProcess() {
+ std::string data;
+
+ for (; index_of_kinfo_proc_ < kinfo_procs_.size(); ++ index_of_kinfo_proc_) {
+ int mib[3];
+ size_t len;
+ struct kinfo_proc kinfo = kinfo_procs_[index_of_kinfo_proc_];
+
+ if ((kinfo.ki_pid > 0) && (kinfo.ki_stat == SZOMB))
+ continue;
+
+ mib[0] = CTL_KERN;
+ mib[1] = KERN_PROC_ARGS;
+ mib[2] = kinfo.ki_pid;
+
+ len = 0;
+ if (sysctl(mib, 3, NULL, &len, NULL, 0) < 0) {
+ LOG(ERROR) << "failed to figure out the buffer size for a command line";
+ continue;
+ }
+
+ data.resize(len);
+
+ if (sysctl(mib, 3, &data[0], &len, NULL, 0) < 0) {
+ LOG(ERROR) << "failed to fetch a commandline";
+ continue;
+ }
+
+ std::string delimiters;
+ delimiters.push_back('\0');
+ Tokenize(data, delimiters, &entry_.cmd_line_args_);
+
+ size_t exec_name_end = data.find('\0');
+ if (exec_name_end == std::string::npos) {
+ LOG(ERROR) << "command line data didn't match expected format";
+ continue;
+ }
+
+ entry_.pid_ = kinfo.ki_pid;
+ entry_.ppid_ = kinfo.ki_ppid;
+ entry_.gid_ = kinfo.ki_pgid;
+
+ size_t last_slash = data.rfind('/', exec_name_end);
+ if (last_slash == std::string::npos)
+ entry_.exe_file_.assign(data, 0, exec_name_end);
+ else
+ entry_.exe_file_.assign(data, last_slash + 1,
+ exec_name_end - last_slash - 1);
+
+ // Start w/ the next entry next time through
+ ++index_of_kinfo_proc_;
+
+ return true;
+ }
+ return false;
+}
+
+bool NamedProcessIterator::IncludeEntry() {
+ if(executable_name_ != entry().exe_file())
+ return false;
+
+ return ProcessIterator::IncludeEntry();
+}
+
+
+ProcessMetrics::ProcessMetrics(ProcessHandle process)
+ : process_(process),
+ last_time_(0),
+ last_system_time_(0),
+ last_cpu_(0) {
+ processor_count_ = base::SysInfo::NumberOfProcessors();
+}
+
+// static
+ProcessMetrics* ProcessMetrics::CreateProcessMetrics(ProcessHandle process) {
+ return new ProcessMetrics(process);
+}
+
+size_t ProcessMetrics::GetPagefileUsage() const {
+ struct kinfo_proc info;
+ int mib[4];
+ size_t info_size = sizeof(info);
+
+ mib[0] = CTL_KERN;
+ mib[1] = KERN_PROC;
+ mib[2] = KERN_PROC_PID;
+ mib[3] = process_;
+
+ if (sysctl(mib, 4, &info, &info_size, NULL, 0) < 0)
+ return 0;
+
+ return info.ki_size;
+}
+
+size_t ProcessMetrics::GetPeakPagefileUsage() const {
+ return 0;
+}
+
+size_t ProcessMetrics::GetWorkingSetSize() const {
+ struct kinfo_proc info;
+ int mib[4];
+ size_t info_size = sizeof(info);
+
+ mib[0] = CTL_KERN;
+ mib[1] = KERN_PROC;
+ mib[2] = KERN_PROC_PID;
+ mib[3] = process_;
+
+ if (sysctl(mib, 4, &info, &info_size, NULL, 0) < 0)
+ return 0;
+
+ return info.ki_rssize * getpagesize();
+}
+
+size_t ProcessMetrics::GetPeakWorkingSetSize() const {
+ return 0;
+}
+
+bool ProcessMetrics::GetMemoryBytes(size_t* private_bytes,
+ size_t* shared_bytes) {
+ WorkingSetKBytes ws_usage;
+ if (!GetWorkingSetKBytes(&ws_usage))
+ return false;
+
+ if (private_bytes)
+ *private_bytes = ws_usage.priv << 10;
+
+ if (shared_bytes)
+ *shared_bytes = ws_usage.shared * 1024;
+
+ return true;
+}
+
+bool ProcessMetrics::GetWorkingSetKBytes(WorkingSetKBytes* ws_usage) const {
+// TODO(bapt) be sure we can't be precise
+ size_t priv = GetWorkingSetSize();
+ if (!priv)
+ return false;
+ ws_usage->priv = priv / 1024;
+ ws_usage->shareable = 0;
+ ws_usage->shared = 0;
+
+ return true;
+}
+
+bool ProcessMetrics::GetIOCounters(IoCounters* io_counters) const {
+ return false;
+}
+
+double ProcessMetrics::GetCPUUsage() {
+ struct kinfo_proc info;
+ int mib[4];
+ size_t info_size = sizeof(info);
+
+ struct timeval now;
+ int retval = gettimeofday(&now, NULL);
+ if (retval)
+ return 0;
+
+ mib[0] = CTL_KERN;
+ mib[1] = KERN_PROC;
+ mib[2] = KERN_PROC_PID;
+ mib[3] = process_;
+
+ if (sysctl(mib, 4, &info, &info_size, NULL, 0) < 0)
+ return 0;
+
+ return (info.ki_pctcpu / FSCALE) * 100.0;
+}
+
+size_t GetSystemCommitCharge() {
+ int mib[2], pagesize;
+ unsigned long mem_total, mem_free, mem_inactive;
+ size_t len = sizeof(mem_total);
+
+ if (sysctl(mib, 2, &mem_total, &len, NULL, 0) < 0)
+ return 0;
+
+ len = sizeof(mem_free);
+ if (sysctlbyname("vm.stats.vm.v_free_count", &mem_free, &len, NULL, 0) < 0)
+ return 0;
+
+ len = sizeof(mem_inactive);
+ if (sysctlbyname("vm.stats.vm.v_inactive_count", &mem_inactive, &len, NULL, 0) < 0)
+ return 0;
+
+ pagesize = getpagesize();
+
+ return mem_total - (mem_free*pagesize) - (mem_inactive*pagesize);
+}
+
+void EnableTerminationOnOutOfMemory() {
+ NOTIMPLEMENTED();
+ return;
+}
+}

View file

@ -0,0 +1,16 @@
--- ./base/process_util_posix.cc.orig 2010-12-16 02:11:49.000000000 +0100
+++ ./base/process_util_posix.cc 2010-12-20 20:15:08.000000000 +0100
@@ -102,11 +102,11 @@
return status;
}
-void StackDumpSignalHandler(int signal, siginfo_t* info, ucontext_t* context) {
+void StackDumpSignalHandler(int signal, siginfo_t* info /*, ucontext_t* context */) {
LOG(ERROR) << "Received signal " << signal;
debug::StackTrace().PrintBacktrace();
- // TODO(shess): Port to Linux.
+ // TODO(shess): Port to Linux and FreeBSD.
#if defined(OS_MACOSX)
// TODO(shess): Port to 64-bit.
#if ARCH_CPU_32_BITS

View file

@ -0,0 +1,24 @@
--- base/sys_info_freebsd.cc.orig 2011-01-29 10:49:10.000000000 +0100
+++ base/sys_info_freebsd.cc 2011-02-07 22:02:40.000000000 +0100
@@ -30,4 +30,21 @@
return limit;
}
+int SysInfo::NumberOfProcessors() {
+ int mib[2];
+
+ mib[0] = CTL_HW;
+ mib[1] = HW_NCPU;
+
+ int ncpu;
+ size_t len = sizeof(ncpu);
+
+ if (sysctl(mib, 2, &ncpu, &len, NULL, 0) == -1) {
+ NOTREACHED();
+ return 1;
+ }
+
+ return ncpu;
+}
+
} // namespace base

View file

@ -0,0 +1,11 @@
--- base/sys_info_posix.cc.orig 2011-02-07 00:36:57.000000000 +0100
+++ base/sys_info_posix.cc 2011-02-07 00:21:53.000000000 +0100
@@ -23,7 +23,7 @@
namespace base {
-#if !defined(OS_OPENBSD)
+#if !defined(OS_OPENBSD) && !defined(OS_FREEBSD)
int SysInfo::NumberOfProcessors() {
// It seems that sysconf returns the number of "logical" processors on both
// Mac and Linux. So we get the number of "online logical" processors.

View file

@ -0,0 +1,17 @@
--- ./build/build_config.h.orig 2010-12-16 02:11:47.000000000 +0100
+++ ./build/build_config.h 2010-12-20 20:15:08.000000000 +0100
@@ -69,12 +69,12 @@
#endif
// Use tcmalloc
-#if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(NO_TCMALLOC)
+#if (defined(OS_WIN) || defined(OS_LINUX) || defined(OS_FREEBSD)) && !defined(NO_TCMALLOC)
#define USE_TCMALLOC 1
#endif
// Use heapchecker.
-#if defined(OS_LINUX) && !defined(NO_HEAPCHECKER)
+#if (defined(OS_LINUX) || defined(OS_FREEBSD)) && !defined(NO_HEAPCHECKER)
#define USE_HEAPCHECKER 1
#endif

View file

@ -0,0 +1,40 @@
--- ./build/common.gypi.orig 2010-12-20 20:09:09.000000000 +0100
+++ ./build/common.gypi 2010-12-20 20:15:08.000000000 +0100
@@ -230,7 +230,7 @@
# Whether proprietary audio/video codecs are assumed to be included with
# this build (only meaningful if branding!=Chrome).
- 'proprietary_codecs%': 0,
+ 'proprietary_codecs%': 1,
# TODO(bradnelson): eliminate this when possible.
# To allow local gyp files to prevent release.vsprops from being included.
@@ -279,8 +279,8 @@
# Disable TCMalloc's debugallocation.
'linux_use_debugallocation%': 0,
- # Disable TCMalloc's heapchecker.
- 'linux_use_heapchecker%': 0,
+ # Enable TCMalloc's heapchecker.
+ 'linux_use_heapchecker%': 1,
# Disable shadow stack keeping used by heapcheck to unwind the stacks
# better.
@@ -298,7 +298,7 @@
# 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,
@@ -638,7 +638,7 @@
['exclude', '(^|/)(gtk|x11)_[^/]*\\.(h|cc)$'],
],
}],
- ['OS!="linux"', {
+ ['OS!="linux" and OS!="freebsd"', {
'sources/': [
['exclude', '_linux(_unittest)?\\.(h|cc)$'],
['exclude', '(^|/)linux/'],

View file

@ -0,0 +1,11 @@
--- ./build/features_override.gypi.orig 2010-12-16 02:11:47.000000000 +0100
+++ ./build/features_override.gypi 2010-12-20 20:15:08.000000000 +0100
@@ -70,7 +70,7 @@
'enable_svg%': '<(enable_svg)',
'enable_touch_events%': '<(enable_touch_events)',
'conditions': [
- ['(OS=="win" or OS=="linux" or OS=="mac") and use_accelerated_compositing==1', {
+ ['(OS=="win" or OS=="linux" or OS=="mac" or OS=="freebsd") and use_accelerated_compositing==1', {
'feature_defines': [
'WTF_USE_ACCELERATED_COMPOSITING=1',
'ENABLE_3D_RENDERING=1',

View file

@ -0,0 +1,22 @@
--- ./build/linux/python_arch.sh.orig 2010-12-16 02:11:47.000000000 +0100
+++ ./build/linux/python_arch.sh 2010-12-20 20:15:08.000000000 +0100
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env 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,7 @@
# 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")
+file_out=$(file "$1")
if [ $? -ne 0 ]; then
echo unknown
exit 0;

View file

@ -0,0 +1,34 @@
--- ./chrome/app/chrome_exe_main_gtk.cc.orig 2010-12-16 02:11:51.000000000 +0100
+++ ./chrome/app/chrome_exe_main_gtk.cc 2010-12-20 20:15:08.000000000 +0100
@@ -3,7 +3,7 @@
// found in the LICENSE file.
#include "base/process_util.h"
-#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
+#if (defined(OS_LINUX) || defined(OS_FREEBSD)) && !defined(OS_CHROMEOS)
#include "chrome/browser/first_run/first_run.h"
#endif
@@ -19,11 +19,11 @@
extern "C" {
int ChromeMain(int argc, const char** argv);
-#if defined(OS_LINUX) && defined(USE_TCMALLOC)
+#if (defined(OS_LINUX) || defined(OS_FREEBSD)) && defined(USE_TCMALLOC)
int tc_set_new_mode(int mode);
-#endif // defined(OS_LINUX) && defined(USE_TCMALLOC)
+#endif // (defined(OS_LINUX) || defined(OS_FREEBSD)) && defined(USE_TCMALLOC)
}
int main(int argc, const char** argv) {
@@ -36,7 +36,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_LINUX) || defined(OS_FREEBSD)) && defined(USE_TCMALLOC)
// For tcmalloc, we need to tell it to behave like new.
tc_set_new_mode(1);
#endif

View file

@ -0,0 +1,38 @@
--- chrome/app/generated_resources.grd.orig 2011-03-20 22:02:04.245737794 +0200
+++ chrome/app/generated_resources.grd 2011-03-20 22:02:04.423741982 +0200
@@ -935,7 +935,7 @@
Preferences...
</message>
</if>
- <if expr="os == 'linux2'">
+ <if expr="os == 'linux2' or os.find('bsd') != -1">
<message name="IDS_PREFERENCES" desc="The text label of the Preferences menu item.">
Preferences
</message>
@@ -6527,7 +6527,7 @@
<message name="IDS_OPTIONS_DIALOG_TITLE" desc="The title of the Options dialog box">
<ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> Options
</message>
- <if expr="os == 'linux2'">
+ <if expr="os == 'linux2' or os.find('bsd') != -1">
<message name="IDS_PREFERENCES_DIALOG_TITLE" desc="The title of the Preferences dialog box">
<ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> Preferences
</message>
@@ -6913,7 +6913,7 @@
</message>
</if>
- <if expr="os == 'darwin' or (os =='linux2' and not pp_ifdef('chromeos'))">
+ <if expr="os == 'darwin' or os.find('bsd') != -1 or (os =='linux2' and not pp_ifdef('chromeos'))">
<message name="IDS_AUTOFILL_OPTIONS_TITLE" desc="The title of the Autofill dialog.">
Autofill Preferences
</message>
@@ -11110,7 +11110,7 @@
Import bookmarks now...
</message>
- <if expr="os == 'linux2' or os == 'openbsd4' or os=='freebsd6'">
+ <if expr="os == 'linux2' or os.find('bsd') != -1">
<!-- Linux proxy configuration fallback help -->
<message name="IDS_ABOUT_LINUX_PROXY_CONFIG_TITLE" desc="Title of HTML page shown on systems where system proxy configuration is unsupported.">
Proxy Configuration Help

View file

@ -0,0 +1,11 @@
--- chrome/browser/about_flags.cc.orig 2011-03-20 22:02:04.388735857 +0200
+++ chrome/browser/about_flags.cc 2011-03-20 22:02:04.492737343 +0200
@@ -503,7 +503,7 @@
return kOsWin;
#elif defined(OS_CHROMEOS) // Needs to be before the OS_LINUX check.
return kOsCrOS;
-#elif defined(OS_LINUX)
+#elif defined(OS_LINUX) || defined(OS_FREEBSD)
return kOsLinux;
#else
#error Unknown platform

View file

@ -0,0 +1,47 @@
--- chrome/browser/browser_about_handler.cc.orig 2011-01-06 10:01:46.000000000 +0100
+++ chrome/browser/browser_about_handler.cc 2011-01-09 20:16:04.000000000 +0100
@@ -74,7 +74,7 @@
#include "chrome/browser/zygote_host_linux.h"
#elif defined(OS_MACOSX)
#include "chrome/browser/ui/cocoa/about_ipc_dialog.h"
-#elif defined(OS_LINUX)
+#elif defined(OS_LINUX) || defined(OS_FREEBSD)
#include "chrome/browser/zygote_host_linux.h"
#endif
@@ -127,7 +127,7 @@
const char kNetInternalsPath[] = "net-internals";
const char kPluginsPath[] = "plugins";
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_FREEBSD)
const char kLinuxProxyConfigPath[] = "linux-proxy-config";
const char kSandboxPath[] = "sandbox";
#endif
@@ -159,7 +159,7 @@
kTcmallocPath,
kTermsPath,
kVersionPath,
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_FREEBSD)
kSandboxPath,
#endif
#if defined(OS_CHROMEOS)
@@ -549,7 +549,7 @@
return data;
}
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_FREEBSD)
std::string AboutLinuxProxyConfig() {
std::string data;
data.append("<!DOCTYPE HTML>\n");
@@ -796,7 +796,7 @@
} else if (path == kTermsPath) {
response = ResourceBundle::GetSharedInstance().GetRawDataResource(
IDR_TERMS_HTML).as_string();
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_FREEBSD)
} else if (path == kLinuxProxyConfigPath) {
response = AboutLinuxProxyConfig();
} else if (path == kSandboxPath) {

View file

@ -0,0 +1,14 @@
--- ./chrome/browser/browser_child_process_host.cc.orig 2010-12-16 02:11:58.000000000 +0100
+++ ./chrome/browser/browser_child_process_host.cc 2010-12-20 20:15:08.000000000 +0100
@@ -27,9 +27,9 @@
#include "chrome/common/result_codes.h"
#include "chrome/installer/util/google_update_settings.h"
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_FREEBSD)
#include "base/linux_util.h"
-#endif // OS_LINUX
+#endif // OS_LINUX || OS_FREEBSD
namespace {

View file

@ -0,0 +1,123 @@
--- ./chrome/browser/child_process_launcher.cc.orig 2010-12-16 02:11:58.000000000 +0100
+++ ./chrome/browser/child_process_launcher.cc 2010-12-20 20:15:08.000000000 +0100
@@ -20,7 +20,7 @@
#if defined(OS_WIN)
#include "base/file_path.h"
#include "chrome/common/sandbox_policy.h"
-#elif defined(OS_LINUX)
+#elif defined(OS_LINUX) || defined(OS_FREEBSD)
#include "base/singleton.h"
#include "chrome/browser/crash_handler_host_linux.h"
#include "chrome/browser/zygote_host_linux.h"
@@ -45,7 +45,7 @@
: client_(NULL),
client_thread_id_(BrowserThread::UI),
starting_(true)
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_FREEBSD)
, zygote_(false)
#endif
{
@@ -110,7 +110,7 @@
handle = sandbox::StartProcessWithAccess(cmd_line, exposed_dir);
#elif defined(OS_POSIX)
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_FREEBSD)
if (use_zygote) {
base::GlobalDescriptors::Mapping mapping;
mapping.push_back(std::pair<uint32_t, int>(kPrimaryIPCChannel, ipcfd));
@@ -131,7 +131,7 @@
ipcfd,
kPrimaryIPCChannel + base::GlobalDescriptors::kBaseDescriptor));
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_FREEBSD)
// On Linux, we need to add some extra file descriptors for crash handling
// and the sandbox.
bool is_renderer =
@@ -163,7 +163,7 @@
sandbox_fd,
kSandboxIPCChannel + base::GlobalDescriptors::kBaseDescriptor));
}
-#endif // defined(OS_LINUX)
+#endif // defined(OS_LINUX) || defined(OS_FREEBSD)
bool launched = false;
#if defined(OS_MACOSX)
@@ -199,20 +199,20 @@
NewRunnableMethod(
this,
&ChildProcessLauncher::Context::Notify,
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_FREEBSD)
use_zygote,
#endif
handle));
}
void Notify(
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_FREEBSD)
bool zygote,
#endif
base::ProcessHandle handle) {
starting_ = false;
process_.set_handle(handle);
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_FREEBSD)
zygote_ = zygote;
#endif
if (client_) {
@@ -232,7 +232,7 @@
BrowserThread::PROCESS_LAUNCHER, FROM_HERE,
NewRunnableFunction(
&ChildProcessLauncher::Context::TerminateInternal,
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_FREEBSD)
zygote_,
#endif
process_.handle()));
@@ -240,7 +240,7 @@
}
static void TerminateInternal(
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_FREEBSD)
bool zygote,
#endif
base::ProcessHandle handle) {
@@ -250,13 +250,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_LINUX) || defined(OS_FREEBSD)
if (zygote) {
// If the renderer was created via a zygote, we have to proxy the reaping
// through the zygote process.
ZygoteHost::GetInstance()->EnsureProcessTerminated(handle);
} else
-#endif // OS_LINUX
+#endif // OS_LINUX || OS_FREEBSD
{
ProcessWatcher::EnsureProcessTerminated(handle);
}
@@ -269,7 +269,7 @@
base::Process process_;
bool starting_;
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_FREEBSD)
bool zygote_;
#endif
};
@@ -315,7 +315,7 @@
int* exit_code) {
base::TerminationStatus status;
base::ProcessHandle handle = context_->process_.handle();
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_FREEBSD)
if (context_->zygote_) {
status = ZygoteHost::GetInstance()->GetTerminationStatus(handle, exit_code);
} else

View file

@ -0,0 +1,11 @@
--- chrome/browser/file_path_watcher/file_path_watcher_stub.cc.orig 2011-03-20 22:02:04.296736175 +0200
+++ chrome/browser/file_path_watcher/file_path_watcher_stub.cc 2011-03-20 22:02:04.454738659 +0200
@@ -9,7 +9,7 @@
class FilePathWatcherImpl : public FilePathWatcher::PlatformDelegate {
public:
- virtual bool Watch(const FilePath& path, FileWatcher::Delegate* delegate) {
+ virtual bool Watch(const FilePath& path, FilePathWatcher::Delegate* delegate) {
return false;
}
};

View file

@ -0,0 +1,29 @@
--- ./chrome/browser/memory_details.cc.orig 2010-12-16 02:11:58.000000000 +0100
+++ ./chrome/browser/memory_details.cc 2010-12-20 20:15:08.000000000 +0100
@@ -19,7 +19,7 @@
#include "chrome/common/url_constants.h"
#include "grit/chromium_strings.h"
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_FREEBSD)
#include "chrome/browser/zygote_host_linux.h"
#include "chrome/browser/renderer_host/render_sandbox_host_linux.h"
#endif
@@ -101,7 +101,7 @@
void MemoryDetails::CollectChildInfoOnUIThread() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_FREEBSD)
const pid_t zygote_pid = ZygoteHost::GetInstance()->pid();
const pid_t sandbox_helper_pid = RenderSandboxHostLinux::GetInstance()->pid();
#endif
@@ -179,7 +179,7 @@
}
}
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_FREEBSD)
if (process.pid == zygote_pid) {
process.type = ChildProcessInfo::ZYGOTE_PROCESS;
} else if (process.pid == sandbox_helper_pid) {

View file

@ -0,0 +1,11 @@
--- ./chrome/browser/memory_purger.cc.orig 2010-12-16 02:11:58.000000000 +0100
+++ ./chrome/browser/memory_purger.cc 2010-12-20 20:15:08.000000000 +0100
@@ -135,7 +135,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_WIN) || defined(OS_LINUX) || defined(OS_FREEBSD)) && 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.

View file

@ -0,0 +1,11 @@
--- ./chrome/browser/net/connection_tester.cc.orig 2010-12-16 02:11:55.000000000 +0100
+++ ./chrome/browser/net/connection_tester.cc 2010-12-20 20:15:08.000000000 +0100
@@ -179,7 +179,7 @@
// Otherwise returns a network error code.
int CreateSystemProxyConfigService(
scoped_ptr<net::ProxyConfigService>* config_service) {
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(FREEBSD)
// TODO(eroman): This is not supported on Linux yet, because of how
// construction needs ot happen on the UI thread.
return net::ERR_NOT_IMPLEMENTED;

View file

@ -0,0 +1,11 @@
--- ./chrome/browser/notifications/balloon_collection_impl.h.orig 2010-12-16 02:11:58.000000000 +0100
+++ ./chrome/browser/notifications/balloon_collection_impl.h 2010-12-20 20:15:08.000000000 +0100
@@ -56,7 +56,7 @@
virtual void WillProcessMessage(const MSG& event) {}
virtual void DidProcessMessage(const MSG& event);
#endif
-#if defined(OS_LINUX)
+#if defined(TOOLKIT_USES_GTK)
virtual void WillProcessEvent(GdkEvent* event) {}
virtual void DidProcessEvent(GdkEvent* event);
#endif

View file

@ -0,0 +1,11 @@
--- chrome/browser/process_singleton.h.orig 2011-03-20 22:02:04.272739829 +0200
+++ chrome/browser/process_singleton.h 2011-03-20 22:02:04.444737667 +0200
@@ -67,7 +67,7 @@
// instance.
NotifyResult NotifyOtherProcessOrCreate();
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_FREEBSD)
// Exposed for testing. We use a timeout on Linux, and in tests we want
// this timeout to be short.
NotifyResult NotifyOtherProcessWithTimeout(const CommandLine& command_line,

View file

@ -0,0 +1,11 @@
--- chrome/browser/renderer_host/browser_render_process_host.cc.orig 2011-03-20 22:02:04.283738713 +0200
+++ chrome/browser/renderer_host/browser_render_process_host.cc 2011-03-20 22:02:04.448747953 +0200
@@ -886,7 +886,7 @@
HANDLE section = app::win::GetSectionFromProcess(
dib_id.handle, GetHandle(), false /* read write */);
return TransportDIB::Map(section);
-#elif defined(OS_MACOSX)
+#elif defined(OS_MACOSX) || defined(OS_FREEBSD)
// On OSX, the browser allocates all DIBs and keeps a file descriptor around
// for each.
return widget_helper_->MapTransportDIB(dib_id);

View file

@ -0,0 +1,11 @@
--- ./chrome/browser/renderer_host/mock_render_process_host.cc.orig 2010-12-16 02:11:57.000000000 +0100
+++ ./chrome/browser/renderer_host/mock_render_process_host.cc 2010-12-20 20:15:08.000000000 +0100
@@ -106,7 +106,7 @@
DuplicateHandle(GetCurrentProcess(), dib_id.handle, GetCurrentProcess(),
&duped, 0, TRUE, DUPLICATE_SAME_ACCESS);
transport_dib_ = TransportDIB::Map(duped);
-#elif defined(OS_MACOSX)
+#elif defined(OS_MACOSX) || defined(OS_FREEBSD)
// 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);

View file

@ -0,0 +1,20 @@
--- chrome/browser/renderer_host/render_message_filter.cc.orig 2011-03-23 00:59:35.959798938 +0200
+++ chrome/browser/renderer_host/render_message_filter.cc 2011-03-23 00:59:46.644644079 +0200
@@ -375,7 +375,7 @@
IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_GetDefaultPrintSettings,
OnGetDefaultPrintSettings)
IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_ScriptedPrint, OnScriptedPrint)
-#if defined(OS_MACOSX)
+#if defined(OS_MACOSX) || defined(OS_FREEBSD)
IPC_MESSAGE_HANDLER(ViewHostMsg_AllocTransportDIB, OnAllocTransportDIB)
IPC_MESSAGE_HANDLER(ViewHostMsg_FreeTransportDIB, OnFreeTransportDIB)
#endif
@@ -1196,7 +1196,7 @@
HistogramSynchronizer::DeserializeHistogramList(sequence_number, histograms);
}
-#if defined(OS_MACOSX)
+#if defined(OS_MACOSX) || defined(OS_FREEBSD)
void RenderMessageFilter::OnAllocTransportDIB(
size_t size, bool cache_in_browser, TransportDIB::Handle* handle) {
render_widget_helper_->AllocTransportDIB(size, cache_in_browser, handle);

View file

@ -0,0 +1,15 @@
--- ./chrome/browser/renderer_host/render_sandbox_host_linux.cc.orig 2010-12-16 02:11:57.000000000 +0100
+++ ./chrome/browser/renderer_host/render_sandbox_host_linux.cc 2010-12-20 20:15:08.000000000 +0100
@@ -660,7 +660,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_FREEBSD)
+ 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];

View file

@ -0,0 +1,20 @@
--- ./chrome/browser/renderer_host/render_widget_helper.cc.orig 2010-12-16 02:11:57.000000000 +0100
+++ ./chrome/browser/renderer_host/render_widget_helper.cc 2010-12-20 20:15:08.000000000 +0100
@@ -58,7 +58,7 @@
// object, so we should not be destroyed unless pending_paints_ is empty!
DCHECK(pending_paints_.empty());
-#if defined(OS_MACOSX)
+#if defined(OS_MACOSX) || defined(OS_FREEBSD)
ClearAllocatedDIBs();
#endif
}
@@ -274,7 +274,7 @@
host->CreateNewFullscreenWidget(route_id, popup_type);
}
-#if defined(OS_MACOSX)
+#if defined(OS_MACOSX) || defined(OS_FREEBSD)
TransportDIB* RenderWidgetHelper::MapTransportDIB(TransportDIB::Id dib_id) {
AutoLock locked(allocated_dibs_lock_);

View file

@ -0,0 +1,29 @@
--- ./chrome/browser/renderer_host/render_widget_helper.h.orig 2010-12-16 02:11:57.000000000 +0100
+++ ./chrome/browser/renderer_host/render_widget_helper.h 2010-12-20 20:15:08.000000000 +0100
@@ -110,7 +110,7 @@
const base::TimeDelta& max_delay,
IPC::Message* msg);
-#if defined(OS_MACOSX)
+#if defined(OS_MACOSX) || defined(OS_FREEBSD)
// Given the id of a transport DIB, return a mapping to it or NULL on error.
TransportDIB* MapTransportDIB(TransportDIB::Id dib_id);
#endif
@@ -134,7 +134,7 @@
WebKit::WebPopupType popup_type,
int* route_id);
-#if defined(OS_MACOSX)
+#if defined(OS_MACOSX) || defined(OS_FREEBSD)
// Called on the IO thread to handle the allocation of a TransportDIB. If
// |cache_in_browser| is |true|, then a copy of the shmem is kept by the
// browser, and it is the caller's repsonsibility to call
@@ -191,7 +191,7 @@
// Called on the IO thread to resume a cross-site response.
void OnCrossSiteClosePageACK(const ViewMsg_ClosePage_Params& params);
-#if defined(OS_MACOSX)
+#if defined(OS_MACOSX) || defined(OS_FREEBSD)
// Called on destruction to release all allocated transport DIBs
void ClearAllocatedDIBs();

View file

@ -0,0 +1,11 @@
--- ./chrome/browser/renderer_host/render_widget_host_unittest.cc.orig 2010-12-16 02:11:57.000000000 +0100
+++ ./chrome/browser/renderer_host/render_widget_host_unittest.cc 2010-12-20 20:15:08.000000000 +0100
@@ -407,7 +407,7 @@
// Tests setting custom background
TEST_F(RenderWidgetHostTest, Background) {
-#if defined(OS_WIN) || defined(OS_LINUX)
+#if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_FREEBSD)
scoped_ptr<RenderWidgetHostView> view(
RenderWidgetHostView::CreateViewForWidget(host_.get()));
host_->set_view(view.get());

View file

@ -0,0 +1,19 @@
--- ./chrome/browser/shell_integration_linux.cc.orig 2010-12-16 02:11:58.000000000 +0100
+++ ./chrome/browser/shell_integration_linux.cc 2010-12-20 20:15:08.000000000 +0100
@@ -118,6 +118,8 @@
if (!PathService::Get(chrome::DIR_USER_DESKTOP, &desktop_path))
return;
+#if !defined(OS_FREEBSD)
+// 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;
@@ -146,6 +148,7 @@
if (HANDLE_EINTR(close(desktop_fd)) < 0)
PLOG(ERROR) << "close";
+#endif // !defined(OS_FREEBSD)
}
void CreateShortcutInApplicationsMenu(const FilePath& shortcut_filename,

View file

@ -0,0 +1,19 @@
--- ./chrome/browser/shell_integration_unittest.cc.orig 2010-12-16 02:11:58.000000000 +0100
+++ ./chrome/browser/shell_integration_unittest.cc 2010-12-20 20:15:08.000000000 +0100
@@ -21,13 +21,13 @@
#if defined(OS_WIN)
#include "chrome/installer/util/browser_distribution.h"
-#elif defined(OS_LINUX)
+#elif defined(OS_LINUX) || defined(OS_FREEBSD)
#include "base/environment.h"
-#endif // defined(OS_LINUX)
+#endif // defined(OS_LINUX) || defined(OS_FREEBSD)
#define FPL FILE_PATH_LITERAL
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_FREEBSD)
namespace {
// Provides mock environment variables values based on a stored map.

View file

@ -0,0 +1,29 @@
--- ./chrome/browser/sync/engine/syncer_thread.cc.orig 2010-12-16 02:11:54.000000000 +0100
+++ ./chrome/browser/sync/engine/syncer_thread.cc 2010-12-20 20:15:08.000000000 +0100
@@ -264,7 +264,7 @@
bool initial_sync_for_thread = true;
bool continue_sync_cycle = false;
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_FREEBSD)
idle_query_.reset(new IdleQueryLinux());
#endif
@@ -359,7 +359,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_LINUX) || defined(OS_FREEBSD)
idle_query_.reset();
#endif
}
@@ -833,7 +833,7 @@
return 0;
}
return idle_time / 1000000; // nano to milli
-#elif defined(OS_LINUX)
+#elif defined(OS_LINUX) || defined(OS_FREEBSD)
if (idle_query_.get())
return idle_query_->IdleTime();
return 0;

View file

@ -0,0 +1,20 @@
--- chrome/browser/sync/engine/syncer_thread.h.orig 2011-01-06 10:01:41.000000000 +0100
+++ chrome/browser/sync/engine/syncer_thread.h 2011-01-09 20:25:21.000000000 +0100
@@ -26,7 +26,7 @@
#include "chrome/browser/sync/syncable/model_type.h"
#include "chrome/common/deprecated/event_sys-inl.h"
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_FREEBSD)
#include "chrome/browser/sync/engine/idle_query_linux.h"
#endif
@@ -329,7 +329,7 @@
NudgeSource source,
const syncable::ModelTypeBitSet& model_types);
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_FREEBSD)
// On Linux, we need this information in order to query idle time.
scoped_ptr<IdleQueryLinux> idle_query_;
#endif

View file

@ -0,0 +1,18 @@
--- ./chrome/browser/sync/syncable/directory_backing_store.cc.orig 2010-12-16 02:11:54.000000000 +0100
+++ ./chrome/browser/sync/syncable/directory_backing_store.cc 2010-12-20 20:15:08.000000000 +0100
@@ -304,13 +304,13 @@
#else
UMA_HISTOGRAM_COUNTS_100("Sync.DirectoryOpenFailedNotWinMac", bucket);
-#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
+#if (defined(OS_LINUX) || defined(OS_FREEBSD)) && !defined(OS_CHROMEOS)
UMA_HISTOGRAM_COUNTS_100("Sync.DirectoryOpenFailedLinux", bucket);
#elif defined(OS_CHROMEOS)
UMA_HISTOGRAM_COUNTS_100("Sync.DirectoryOpenFailedCros", bucket);
#else
UMA_HISTOGRAM_COUNTS_100("Sync.DirectoryOpenFailedOther", bucket);
-#endif // OS_LINUX && !OS_CHROMEOS
+#endif // (OS_LINUX || OS_FREEBSD) && !OS_CHROMEOS
#endif // OS_WIN
return !failed_again;
}

View file

@ -0,0 +1,20 @@
--- ./chrome/browser/tab_contents/tab_contents.cc.orig 2010-12-16 02:11:56.000000000 +0100
+++ ./chrome/browser/tab_contents/tab_contents.cc 2010-12-20 20:15:08.000000000 +0100
@@ -407,7 +407,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
@@ -3181,7 +3181,7 @@
break;
}
-#if defined(OS_LINUX)
+#if defined(TOOLKIT_GTK)
case NotificationType::BROWSER_THEME_CHANGED: {
renderer_preferences_util::UpdateFromSystemSettings(
&renderer_preferences_, profile());

View file

@ -0,0 +1,11 @@
--- ./chrome/browser/task_manager/task_manager_resource_providers.cc.orig 2010-12-16 02:11:54.000000000 +0100
+++ ./chrome/browser/task_manager/task_manager_resource_providers.cc 2010-12-20 20:15:08.000000000 +0100
@@ -1198,7 +1198,7 @@
default_icon_ = IconUtil::CreateSkBitmapFromHICON(icon, icon_size);
}
}
-#elif defined(OS_LINUX)
+#elif defined(OS_LINUX) || defined(OS_FREEBSD)
if (!default_icon_) {
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
default_icon_ = rb.GetBitmapNamed(IDR_PRODUCT_LOGO_16);

View file

@ -0,0 +1,47 @@
--- ./chrome/browser/ui/browser.cc.orig 2010-12-16 02:11:56.000000000 +0100
+++ ./chrome/browser/ui/browser.cc 2010-12-20 20:15:08.000000000 +0100
@@ -271,7 +271,7 @@
BrowserList::RemoveBrowser(this);
-#if defined(OS_WIN) || defined(OS_LINUX)
+#if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_FREEBSD)
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
@@ -799,7 +799,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_LINUX) || defined(OS_FREEBSD)
int string_id = IDS_BROWSER_WINDOW_TITLE_FORMAT;
// Don't append the app name to window titles on app frames and app popups
if (type_ & TYPE_APP)
@@ -1445,7 +1445,7 @@
window_->SetFullscreen(!window_->IsFullscreen());
// On Linux, 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(OS_LINUX) && !defined(OS_FREEBSD)
UpdateCommandsForFullscreenMode(window_->IsFullscreen());
#endif
}
@@ -1700,7 +1700,7 @@
void Browser::OpenCreateShortcutsDialog() {
UserMetrics::RecordAction(UserMetricsAction("CreateShortcut"), profile_);
-#if defined(OS_WIN) || defined(OS_LINUX)
+#if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_FREEBSD)
TabContentsWrapper* current_tab = GetSelectedTabContentsWrapper();
DCHECK(current_tab &&
web_app::IsValidUrl(current_tab->tab_contents()->GetURL())) <<
@@ -2500,7 +2500,7 @@
}
void Browser::CloseFrameAfterDragSession() {
-#if defined(OS_WIN) || defined(OS_LINUX)
+#if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_FREEBSD)
// 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.

View file

@ -0,0 +1,20 @@
--- ./chrome/browser/ui/toolbar/wrench_menu_model.cc.orig 2010-12-16 02:11:56.000000000 +0100
+++ ./chrome/browser/ui/toolbar/wrench_menu_model.cc 2010-12-20 20:15:08.000000000 +0100
@@ -391,7 +391,7 @@
IDS_NEW_INCOGNITO_WINDOW);
AddSeparator();
-#if defined(OS_MACOSX) || (defined(OS_LINUX) && !defined(TOOLKIT_VIEWS))
+#if defined(OS_POSIX) && !defined(TOOLKIT_VIEWS)
// WARNING: Mac does not use the ButtonMenuItemModel, but instead defines the
// layout for this menu item in Toolbar.xib. It does, however, use the
// command_id value from AddButtonItem() to identify this special item.
@@ -406,7 +406,7 @@
#endif
AddSeparator();
-#if defined(OS_MACOSX) || (defined(OS_LINUX) && !defined(TOOLKIT_VIEWS))
+#if defined(OS_POSIX) && !defined(TOOLKIT_VIEWS)
// WARNING: See above comment.
zoom_menu_item_model_.reset(
new menus::ButtonMenuItemModel(IDS_ZOOM_MENU, this));

View file

@ -0,0 +1,11 @@
--- ./chrome/browser/ui/views/accessible_view_helper.cc.orig 2010-12-16 02:11:56.000000000 +0100
+++ ./chrome/browser/ui/views/accessible_view_helper.cc 2010-12-20 20:15:08.000000000 +0100
@@ -21,7 +21,7 @@
if (!accessibility_event_router_->AddViewTree(view_tree_, profile))
view_tree_ = NULL;
-#if defined(OS_LINUX)
+#if defined(TOOLKIT_USES_GTK)
GtkWidget* widget = view_tree->GetWidget()->GetNativeView();
widget_helper_.reset(new AccessibleWidgetHelper(widget, profile));
#endif

View file

@ -0,0 +1,20 @@
--- chrome/browser/ui/views/accessible_view_helper.h.orig 2011-01-26 10:30:51.000000000 +0100
+++ chrome/browser/ui/views/accessible_view_helper.h 2011-01-30 14:03:17.000000000 +0100
@@ -15,7 +15,7 @@
#include "chrome/browser/accessibility_events.h"
#include "gfx/native_widget_types.h"
-#if defined(OS_LINUX)
+#if defined(TOOLKIT_USES_GTK)
#include "chrome/browser/ui/gtk/accessible_widget_helper_gtk.h"
#endif
@@ -73,7 +73,7 @@
std::string window_title_;
std::vector<views::View*> managed_views_;
-#if defined(OS_LINUX)
+#if defined(TOOLKIT_USES_GTK)
scoped_ptr<AccessibleWidgetHelper> widget_helper_;
#endif

View file

@ -0,0 +1,11 @@
--- ./chrome/browser/ui/views/create_application_shortcut_view.cc.orig 2010-12-16 02:11:56.000000000 +0100
+++ ./chrome/browser/ui/views/create_application_shortcut_view.cc 2010-12-20 20:15:08.000000000 +0100
@@ -260,7 +260,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_LINUX) || defined(OS_FREEBSD)
menu_check_box_ = AddCheckbox(
l10n_util::GetString(IDS_CREATE_SHORTCUTS_MENU_CHKBOX),
profile_->GetPrefs()->GetBoolean(prefs::kWebAppCreateInAppsMenu));

View file

@ -0,0 +1,20 @@
--- ./chrome/browser/ui/views/download_item_view.cc.orig 2010-12-16 02:11:56.000000000 +0100
+++ ./chrome/browser/ui/views/download_item_view.cc 2010-12-20 20:15:08.000000000 +0100
@@ -259,7 +259,7 @@
// Extract the file extension (if any).
FilePath filename(download->target_name());
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_FREEBSD)
std::wstring extension = base::SysNativeMBToWide(filename.Extension());
#else
std::wstring extension = filename.Extension();
@@ -268,7 +268,7 @@
// Remove leading '.'
if (extension.length() > 0)
extension = extension.substr(1);
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_FREEBSD)
std::wstring rootname =
base::SysNativeMBToWide(filename.RemoveExtension().value());
#else

View file

@ -0,0 +1,20 @@
--- chrome/browser/ui/views/dropdown_bar_host.cc.orig 2011-01-26 10:30:51.000000000 +0100
+++ chrome/browser/ui/views/dropdown_bar_host.cc 2011-01-30 14:07:11.000000000 +0100
@@ -19,7 +19,7 @@
#if defined(OS_WIN)
#include "base/win/scoped_gdi_object.h"
-#elif defined(OS_LINUX)
+#elif defined(TOOLKIT_GTK)
#include "ui/base/gtk/scoped_handle_gtk.h"
#endif
@@ -27,7 +27,7 @@
#if defined(OS_WIN)
typedef base::win::ScopedRegion ScopedPlatformRegion;
-#elif defined(OS_LINUX)
+#elif defined(OS_LINUX) || defined(OS_FREEBSD)
typedef ui::ScopedRegion ScopedPlatformRegion;
#endif

View file

@ -0,0 +1,20 @@
--- ./chrome/browser/ui/views/extensions/extension_popup.cc.orig 2010-12-16 02:11:56.000000000 +0100
+++ ./chrome/browser/ui/views/extensions/extension_popup.cc 2010-12-20 20:15:08.000000000 +0100
@@ -25,7 +25,7 @@
#include "views/window/window.h"
-#if defined(OS_LINUX)
+#if defined(TOOLKIT_GTK)
#include "views/widget/widget_gtk.h"
#endif
@@ -108,7 +108,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();

View file

@ -0,0 +1,11 @@
--- ./chrome/browser/ui/views/extensions/extension_view.cc.orig 2010-12-16 02:11:56.000000000 +0100
+++ ./chrome/browser/ui/views/extensions/extension_view.cc 2010-12-20 20:15:08.000000000 +0100
@@ -14,7 +14,7 @@
#include "chrome/browser/renderer_host/render_widget_host_view_win.h"
#elif defined(TOUCH_UI)
#include "chrome/browser/renderer_host/render_widget_host_view_views.h"
-#elif defined(OS_LINUX)
+#elif defined(OS_LINUX) || defined(OS_FREEBSD)
#include "chrome/browser/renderer_host/render_widget_host_view_gtk.h"
#endif

View file

@ -0,0 +1,34 @@
--- ./chrome/browser/ui/views/find_bar_view.cc.orig 2010-12-16 02:11:56.000000000 +0100
+++ ./chrome/browser/ui/views/find_bar_view.cc 2010-12-20 20:15:08.000000000 +0100
@@ -85,7 +85,7 @@
FindBarView::FindBarView(FindBarHost* host)
: DropdownBarView(host),
-#if defined(OS_LINUX)
+#if defined(TOOLKIT_USES_GTK)
ignore_contents_changed_(false),
#endif
find_text_(NULL),
@@ -174,11 +174,11 @@
}
void FindBarView::SetFindText(const string16& find_text) {
-#if defined(OS_LINUX)
+#if defined(TOOLKIT_USES_GTK)
ignore_contents_changed_ = true;
#endif
find_text_->SetText(find_text);
-#if defined(OS_LINUX)
+#if defined(TOOLKIT_USES_GTK)
ignore_contents_changed_ = false;
#endif
}
@@ -465,7 +465,7 @@
void FindBarView::ContentsChanged(views::Textfield* sender,
const string16& new_contents) {
-#if defined(OS_LINUX)
+#if defined(TOOLKIT_USES_GTK)
// On gtk setting the text in the find view causes a notification.
if (ignore_contents_changed_)
return;

View file

@ -0,0 +1,11 @@
--- ./chrome/browser/ui/views/find_bar_view.h.orig 2010-12-16 02:11:56.000000000 +0100
+++ ./chrome/browser/ui/views/find_bar_view.h 2010-12-20 20:15:08.000000000 +0100
@@ -125,7 +125,7 @@
// between us and the TabContentsView.
FindBarHost* find_bar_host() const;
-#if defined(OS_LINUX)
+#if defined(TOOLKIT_USES_GTK)
// In GTK we get changed signals if we programmatically set the text. If we
// don't ignore them we run into problems. For example, switching tabs back
// to one with the find bar visible will cause a search to the next found

View file

@ -0,0 +1,11 @@
--- ./chrome/browser/ui/views/frame/app_panel_browser_frame_view.cc.orig 2010-12-16 02:11:56.000000000 +0100
+++ ./chrome/browser/ui/views/frame/app_panel_browser_frame_view.cc 2010-12-20 20:15:08.000000000 +0100
@@ -21,7 +21,7 @@
#include "views/window/window.h"
#include "views/window/window_resources.h"
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_FREEBSD)
#include "views/window/hit_test.h"
#endif

View file

@ -0,0 +1,65 @@
--- chrome/browser/ui/views/frame/browser_view.cc.orig 2011-01-26 10:30:50.000000000 +0100
+++ chrome/browser/ui/views/frame/browser_view.cc 2011-01-30 14:10:27.000000000 +0100
@@ -4,7 +4,7 @@
#include "chrome/browser/ui/views/frame/browser_view.h"
-#if defined(OS_LINUX)
+#if defined(TOOLKIT_GTK)
#include <gtk/gtk.h>
#endif
@@ -87,7 +87,7 @@
#include "chrome/browser/aeropeek_manager.h"
#include "chrome/browser/jumplist_win.h"
#include "ui/base/view_prop.h"
-#elif defined(OS_LINUX)
+#elif defined(TOOLKIT_GTK)
#include "chrome/browser/ui/views/accelerator_table_gtk.h"
#include "views/window/hit_test.h"
#include "views/window/window_gtk.h"
@@ -1130,7 +1130,7 @@
string16 message = l10n_util::GetStringUTF16(message_id);
app::win::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(),
@@ -1224,7 +1224,7 @@
views::FocusManager* focus_manager = GetFocusManager();
DCHECK(focus_manager);
-#if defined(OS_LINUX) && !defined(TOUCH_UI)
+#if (defined(OS_LINUX) || defined(OS_FREEBSD)) && !defined(TOUCH_UI)
// Views and WebKit use different tables for GdkEventKey -> views::KeyEvent
// conversion. We need to use View's conversion table here to keep consistent
// behavior with views::FocusManager::OnKeyEvent() method.
@@ -1271,7 +1271,7 @@
return false;
// Executing the command may cause |this| object to be destroyed.
-#if defined(OS_LINUX) && !defined(TOUCH_UI)
+#if (defined(OS_LINUX) || defined(OS_FREEBSD)) && !defined(TOUCH_UI)
if (browser_->IsReservedCommand(id) && !event.match_edit_command) {
#else
if (browser_->IsReservedCommand(id)) {
@@ -1287,7 +1287,7 @@
}
void BrowserView::HandleKeyboardEvent(const NativeWebKeyboardEvent& event) {
-#if defined(OS_LINUX) && !defined(TOUCH_UI)
+#if (defined(OS_LINUX) || defined(OS_FREEBSD)) && !defined(TOUCH_UI)
views::Window* window = GetWidget()->GetWindow();
if (window && event.os_event && !event.skip_in_browser)
static_cast<views::WindowGtk*>(window)->HandleKeyboardEvent(event.os_event);
@@ -2230,7 +2230,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(OS_LINUX) || defined(OS_FREEBSD)
// 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

View file

@ -0,0 +1,11 @@
--- ./chrome/browser/ui/views/frame/browser_view_layout.cc.orig 2010-12-16 02:11:56.000000000 +0100
+++ ./chrome/browser/ui/views/frame/browser_view_layout.cc 2010-12-20 20:15:08.000000000 +0100
@@ -19,7 +19,7 @@
#include "gfx/scrollbar_size.h"
#include "views/window/window.h"
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_FREEBSD)
#include "views/window/hit_test.h"
#endif

View file

@ -0,0 +1,11 @@
--- ./chrome/browser/ui/views/frame/opaque_browser_frame_view.cc.orig 2010-12-16 02:11:56.000000000 +0100
+++ ./chrome/browser/ui/views/frame/opaque_browser_frame_view.cc 2010-12-20 20:15:08.000000000 +0100
@@ -28,7 +28,7 @@
#include "views/window/window_resources.h"
#include "views/window/window_shape.h"
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_FREEBSD)
#include "views/window/hit_test.h"
#endif

View file

@ -0,0 +1,38 @@
--- ./chrome/browser/ui/views/fullscreen_exit_bubble.cc.orig 2010-12-16 02:11:56.000000000 +0100
+++ ./chrome/browser/ui/views/fullscreen_exit_bubble.cc 2010-12-20 20:15:08.000000000 +0100
@@ -18,7 +18,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
@@ -119,7 +119,7 @@
return MA_NOACTIVATE;
}
};
-#elif defined(OS_LINUX)
+#elif defined(TOOLKIT_GTK)
// TODO: figure out the equivalent of MA_NOACTIVATE for gtk.
#endif
@@ -154,7 +154,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
@@ -202,7 +202,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();

View file

@ -0,0 +1,20 @@
--- ./chrome/browser/ui/views/fullscreen_exit_bubble.h.orig 2010-12-16 02:11:56.000000000 +0100
+++ ./chrome/browser/ui/views/fullscreen_exit_bubble.h 2010-12-20 20:15:08.000000000 +0100
@@ -12,7 +12,7 @@
#include "chrome/browser/command_updater.h"
#include "views/controls/link.h"
-#if defined(OS_LINUX)
+#if defined(TOOLKIT_GTK)
namespace views {
class WidgetGtk;
}
@@ -76,7 +76,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

View file

@ -0,0 +1,47 @@
--- ./chrome/browser/ui/views/info_bubble.cc.orig 2010-12-16 02:11:56.000000000 +0100
+++ ./chrome/browser/ui/views/info_bubble.cc 2010-12-20 20:15:08.000000000 +0100
@@ -308,7 +308,7 @@
InfoBubble::InfoBubble()
:
-#if defined(OS_LINUX)
+#if defined(TOOLKIT_GTK)
WidgetGtk(TYPE_WINDOW),
border_contents_(NULL),
#elif defined(OS_WIN)
@@ -375,7 +375,7 @@
WidgetWin::Init(border_->GetNativeView(), gfx::Rect());
SetWindowText(GetNativeView(), delegate_->accessible_name().c_str());
-#elif defined(OS_LINUX)
+#elif defined(TOOLKIT_USES_GTK)
MakeTransparent();
make_transient_to_parent();
WidgetGtk::InitWithWidget(parent, gfx::Rect());
@@ -447,7 +447,7 @@
ShowWindow(SW_SHOW);
if (fade_in)
FadeIn();
-#elif defined(OS_LINUX)
+#elif defined(TOOLKIT_USES_GTK)
views::WidgetGtk::Show();
#endif
}
@@ -487,7 +487,7 @@
GetRootView()->GetChildViewAt(0)->RequestFocus();
}
}
-#elif defined(OS_LINUX)
+#elif defined(TOOLKIT_GTK)
void InfoBubble::IsActiveChanged() {
if (!IsActive())
Close();
@@ -506,7 +506,7 @@
#if defined(OS_WIN)
border_->Close();
WidgetWin::Close();
-#elif defined(OS_LINUX)
+#elif defined(TOOLKIT_GTK)
WidgetGtk::Close();
#endif
}

View file

@ -0,0 +1,38 @@
--- ./chrome/browser/ui/views/info_bubble.h.orig 2010-12-16 02:11:56.000000000 +0100
+++ ./chrome/browser/ui/views/info_bubble.h 2010-12-20 20:15:08.000000000 +0100
@@ -14,7 +14,7 @@
#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
@@ -178,7 +178,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,
@@ -252,7 +252,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
@@ -260,7 +260,7 @@
#if defined(OS_WIN)
// The window used to render the padding, border and arrow.
BorderWidget* border_;
-#elif defined(OS_LINUX)
+#elif defined(OS_LINUX) || defined(OS_FREEBSD)
// The view displaying the border.
BorderContents* border_contents_;
#endif

View file

@ -0,0 +1,11 @@
--- ./chrome/browser/ui/views/location_bar/location_bar_view.cc.orig 2010-12-16 02:11:56.000000000 +0100
+++ ./chrome/browser/ui/views/location_bar/location_bar_view.cc 2010-12-20 20:15:08.000000000 +0100
@@ -4,7 +4,7 @@
#include "chrome/browser/views/location_bar/location_bar_view.h"
-#if defined(OS_LINUX)
+#if defined(TOOLKIT_USES_GTK)
#include <gtk/gtk.h>
#endif

View file

@ -0,0 +1,11 @@
--- ./chrome/browser/ui/views/notifications/balloon_view.cc.orig 2010-12-16 02:11:56.000000000 +0100
+++ ./chrome/browser/ui/views/notifications/balloon_view.cc 2010-12-20 20:15:08.000000000 +0100
@@ -39,7 +39,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

View file

@ -0,0 +1,29 @@
--- ./chrome/browser/ui/views/notifications/balloon_view_host.cc.orig 2010-12-16 02:11:56.000000000 +0100
+++ ./chrome/browser/ui/views/notifications/balloon_view_host.cc 2010-12-20 20:15:08.000000000 +0100
@@ -10,7 +10,7 @@
#if defined(OS_WIN)
#include "chrome/browser/renderer_host/render_widget_host_view_win.h"
#endif
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_FREEBSD)
#if defined(TOUCH_UI)
#include "chrome/browser/renderer_host/render_widget_host_view_views.h"
#else
@@ -21,7 +21,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
@@ -74,7 +74,7 @@
HWND hwnd = view_win->Create(parent_native_view_);
view_win->ShowWindow(SW_SHOW);
native_host_->Attach(hwnd);
-#elif defined(OS_LINUX)
+#elif defined(OS_LINUX) || defined(OS_FREEBSD)
#if defined(TOUCH_UI)
RenderWidgetHostViewViews* view_views =
static_cast<RenderWidgetHostViewViews*>(render_widget_host_view_);

View file

@ -0,0 +1,11 @@
--- ./chrome/browser/ui/views/tabs/dragged_tab_view.cc.orig 2010-12-16 02:11:56.000000000 +0100
+++ ./chrome/browser/ui/views/tabs/dragged_tab_view.cc 2010-12-20 20:15:08.000000000 +0100
@@ -11,7 +11,7 @@
#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

View file

@ -0,0 +1,20 @@
--- ./chrome/browser/ui/views/tabs/dragged_tab_view.h.orig 2010-12-16 02:11:56.000000000 +0100
+++ ./chrome/browser/ui/views/tabs/dragged_tab_view.h 2010-12-20 20:15:08.000000000 +0100
@@ -14,7 +14,7 @@
namespace views {
#if defined(OS_WIN)
class WidgetWin;
-#elif defined(OS_LINUX)
+#elif defined(TOOLKIT_GTK)
class WidgetGtk;
#endif
}
@@ -71,7 +71,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

View file

@ -0,0 +1,11 @@
--- ./chrome/browser/ui/views/tabs/tab_strip.cc.orig 2010-12-16 02:11:56.000000000 +0100
+++ ./chrome/browser/ui/views/tabs/tab_strip.cc 2010-12-20 20:15:08.000000000 +0100
@@ -30,7 +30,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

View file

@ -0,0 +1,11 @@
--- ./chrome/browser/ui/views/tabs/tab_strip.h.orig 2010-12-16 02:11:56.000000000 +0100
+++ ./chrome/browser/ui/views/tabs/tab_strip.h 2010-12-20 20:15:08.000000000 +0100
@@ -19,7 +19,7 @@
namespace views {
class ImageView;
-#if defined(OS_LINUX)
+#if defined(TOOLKIT_GTK)
class WidgetGtk;
#elif defined(OS_WIN)
class WidgetWin;

View file

@ -0,0 +1,23 @@
--- ./chrome/browser/web_applications/web_app.cc.orig 2010-12-16 02:11:54.000000000 +0100
+++ ./chrome/browser/web_applications/web_app.cc 2010-12-20 20:15:08.000000000 +0100
@@ -34,9 +34,9 @@
#include "chrome/common/url_constants.h"
#include "chrome/common/web_apps.h"
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_FREEBSD)
#include "base/environment.h"
-#endif // defined(OS_LINUX)
+#endif // defined(OS_LINUX) || defined(OS_FREEBSD)
#if defined(OS_WIN)
#include "base/win_util.h"
@@ -261,7 +261,7 @@
bool CreateShortcutTask::CreateShortcut() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_FREEBSD)
scoped_ptr<base::Environment> env(base::Environment::Create());
std::string shortcut_template;

View file

@ -0,0 +1,78 @@
--- chrome/browser/zygote_host_linux.cc.orig 2011-03-23 00:55:52.194986092 +0200
+++ chrome/browser/zygote_host_linux.cc 2011-03-23 00:56:55.886462243 +0200
@@ -61,8 +61,16 @@
}
ZygoteHost::~ZygoteHost() {
- if (init_)
+#if defined(OS_FREEBSD)
+ Pickle pickle;
+#endif
+ if (init_) {
+#if defined(OS_FREEBSD)
+ pickle.WriteInt(kCmdEnd);
+ HANDLE_EINTR(write(control_fd_, pickle.data(), pickle.size()));
+#endif
close(control_fd_);
+ }
}
// static
@@ -81,7 +89,12 @@
cmd_line.AppendSwitchASCII(switches::kProcessType, switches::kZygoteProcess);
int fds[2];
+#if defined(OS_FREEBSD)
+ 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));
@@ -149,6 +162,7 @@
// We need to look for it.
// But first, wait for the zygote to tell us it's running.
// The sending code is in chrome/browser/zygote_main_linux.cc.
+#if defined(OS_LINUX)
std::vector<int> fds_vec;
const int kExpectedLength = sizeof(kZygoteMagic);
char buf[kExpectedLength];
@@ -179,6 +193,7 @@
// Reap the sandbox.
ProcessWatcher::EnsureProcessGetsReaped(process);
}
+#endif // defined(OS_LINUX)
} else {
// Not using the SUID sandbox.
pid_ = process;
@@ -245,9 +260,11 @@
if (pid <= 0)
return base::kNullProcessHandle;
}
-
+
+#if defined(OS_LINUX)
const int kRendererScore = 5;
AdjustRendererOOMScore(pid, kRendererScore);
+#endif
return pid;
}
@@ -285,6 +302,7 @@
selinux_valid = true;
}
+#if defined(OS_LINUX)
if (using_suid_sandbox_ && !selinux) {
base::ProcessHandle sandbox_helper_process;
std::vector<std::string> adj_oom_score_cmdline;
@@ -302,6 +320,7 @@
if (!base::AdjustOOMScore(pid, score))
PLOG(ERROR) << "Failed to adjust OOM score of renderer with pid " << pid;
}
+#endif // defined(OS_LINUX)
}
void ZygoteHost::EnsureProcessTerminated(pid_t process) {

View file

@ -0,0 +1,12 @@
--- ./chrome/browser/zygote_host_linux.h.orig 2010-12-16 02:11:58.000000000 +0100
+++ ./chrome/browser/zygote_host_linux.h 2010-12-20 20:15:08.000000000 +0100
@@ -51,6 +51,9 @@
kCmdReap = 1, // Reap a renderer child.
kCmdGetTerminationStatus = 2, // Check what happend to a child process.
kCmdGetSandboxStatus = 3, // Read a bitmask of kSandbox*
+#if defined(OS_FREEBSD)
+ kCmdEnd = 5, // Kill zygote for SOCK_DGRAM.
+#endif
};
// These form a bitmask which describes the conditions of the sandbox that

View file

@ -0,0 +1,59 @@
--- chrome/browser/zygote_main_linux.cc.orig 2011-01-06 10:01:46.000000000 +0100
+++ chrome/browser/zygote_main_linux.cc 2011-01-09 20:41:38.000000000 +0100
@@ -2,12 +2,18 @@
// 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>
#include <pthread.h>
+#if defined(OS_FREEBSD)
+#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>
@@ -50,7 +56,7 @@
#include "unicode/timezone.h"
#if defined(ARCH_CPU_X86_FAMILY) && !defined(CHROMIUM_SELINUX) && \
- !defined(__clang__)
+ !defined(__clang__) && !defined(OS_FREEBSD)
// The seccomp sandbox is enabled on all ia32 and x86-64 processor as long as
// we aren't using SELinux or clang.
#define SECCOMP_SANDBOX
@@ -173,6 +179,11 @@
case ZygoteHost::kCmdGetSandboxStatus:
HandleGetSandboxStatus(fd, pickle, iter);
return false;
+#if defined(OS_FREEBSD)
+ case ZygoteHost::kCmdEnd:
+ _exit(0);
+ return false;
+#endif
default:
NOTREACHED();
break;
@@ -653,7 +664,7 @@
SkiaFontConfigSetImplementation(
new FontConfigIPC(kMagicSandboxIPCDescriptor));
-
+#if !defined(OS_FREEBSD)
// 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
@@ -679,6 +690,7 @@
return false;
}
}
+#endif // !OS_FREEBSD
} else if (switches::SeccompSandboxEnabled()) {
PreSandboxInit();
SkiaFontConfigSetImplementation(

View file

@ -0,0 +1,40 @@
--- ./chrome/chrome.gyp.orig 2010-12-16 02:12:13.000000000 +0100
+++ ./chrome/chrome.gyp 2010-12-20 20:15:08.000000000 +0100
@@ -96,6 +96,10 @@
}],
],
},],
+ ['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': [
@@ -673,7 +677,7 @@
'..',
],
'conditions': [
- ['OS=="linux"', {
+ ['OS=="linux" or OS=="freebsd"', {
'dependencies': [
'../build/linux/system.gyp:gtk',
],
@@ -795,7 +799,7 @@
'gpu/media/mft_angle_video_device.h',
],
}],
- ['OS=="linux" and target_arch!="arm"', {
+ ['(OS=="linux" or OS=="freebsd") and target_arch!="arm"', {
'sources': [
'gpu/x_util.cc',
'gpu/x_util.h',
@@ -1175,7 +1179,7 @@
'service/cloud_print/print_system_win.cc',
],
}],
- ['OS=="linux"', {
+ ['OS=="linux" or OS=="freebsd"', {
'dependencies': [
'../build/linux/system.gyp:gtk',
],

View file

@ -0,0 +1,49 @@
--- chrome/chrome_browser.gypi.orig 2011-03-20 22:02:04.255736830 +0200
+++ chrome/chrome_browser.gypi 2011-03-20 22:02:04.431736294 +0200
@@ -1237,7 +1237,7 @@
'browser/favicon_service.h',
'browser/file_path_watcher/file_path_watcher.cc',
'browser/file_path_watcher/file_path_watcher.h',
- 'browser/file_path_watcher/file_path_watcher_inotify.cc',
+ #'browser/file_path_watcher/file_path_watcher_inotify.cc',
'browser/file_path_watcher/file_path_watcher_mac.cc',
'browser/file_path_watcher/file_path_watcher_win.cc',
'browser/file_select_helper.cc',
@@ -1266,8 +1266,8 @@
'browser/geolocation/empty_device_data_provider.h',
'browser/geolocation/gateway_data_provider_common.cc',
'browser/geolocation/gateway_data_provider_common.h',
- 'browser/geolocation/gateway_data_provider_linux.cc',
- 'browser/geolocation/gateway_data_provider_linux.h',
+ #'browser/geolocation/gateway_data_provider_linux.cc',
+ #'browser/geolocation/gateway_data_provider_linux.h',
'browser/geolocation/gateway_data_provider_win.cc',
'browser/geolocation/gateway_data_provider_win.h',
'browser/geolocation/geolocation_content_settings_map.cc',
@@ -1307,7 +1307,7 @@
'browser/geolocation/wifi_data_provider_corewlan_mac.mm',
'browser/geolocation/wifi_data_provider_common_win.cc',
'browser/geolocation/wifi_data_provider_common_win.h',
- 'browser/geolocation/wifi_data_provider_linux.cc',
+ #'browser/geolocation/wifi_data_provider_linux.cc',
'browser/geolocation/wifi_data_provider_linux.h',
'browser/geolocation/wifi_data_provider_mac.cc',
'browser/geolocation/wifi_data_provider_mac.h',
@@ -3621,7 +3621,7 @@
['include', '^browser/chromeos/dom_ui/login/'],
],
}],
- ['OS=="linux"', {
+ ['OS=="linux" or OS=="freebsd"', {
'dependencies': [
'../build/linux/system.gyp:dbus-glib',
'../build/linux/system.gyp:gconf',
@@ -4294,7 +4294,7 @@
],
}],
# GTK build only
- ['OS=="linux" and toolkit_views==0', {
+ ['(OS=="linux" or OS=="freebsd") and toolkit_views==0', {
'sources/': [
['include', '^browser/printing/print_dialog_gtk.cc'],
['include', '^browser/printing/print_dialog_gtk.h'],

View file

@ -0,0 +1,17 @@
--- ./chrome/chrome_renderer.gypi.orig 2010-12-16 02:12:13.000000000 +0100
+++ ./chrome/chrome_renderer.gypi 2010-12-20 20:15:08.000000000 +0100
@@ -285,6 +285,14 @@
}],
# BSD-specific rules.
['OS=="openbsd" or OS=="freebsd"', {
+ 'conditions': [
+ [ 'linux_use_tcmalloc==1', {
+ 'dependencies': [
+ '../base/allocator/allocator.gyp:allocator',
+ ],
+ },
+ ],
+ ],
'dependencies': [
'../build/linux/system.gyp:gtk',
],

View file

@ -0,0 +1,179 @@
--- chrome/chrome_tests.gypi.orig 2011-01-06 10:02:02.000000000 +0100
+++ chrome/chrome_tests.gypi 2011-01-09 21:00:16.000000000 +0100
@@ -141,7 +141,7 @@
'test/unit/chrome_test_suite.h',
],
'conditions': [
- ['OS=="linux"', {
+ ['OS=="linux" or OS=="freebsd"', {
'dependencies': [
'../build/linux/system.gyp:gtk',
'../build/linux/system.gyp:nss',
@@ -191,7 +191,7 @@
'test/ui/ui_test_suite.h',
],
'conditions': [
- ['OS=="linux"', {
+ ['OS=="linux" or OS=="freebsd"', {
'dependencies': [
'../build/linux/system.gyp:gtk',
],
@@ -215,7 +215,7 @@
'test/unit/run_all_unittests.cc',
],
'conditions': [
- ['OS=="linux"', {
+ ['OS=="linux" or OS=="freebsd"', {
'dependencies': [
# Needed for the following #include chain:
# test/unit/run_all_unittests.cc
@@ -261,7 +261,7 @@
},
},
},],
- ['OS=="linux"', {
+ ['OS=="linux" or OS=="freebsd"', {
'dependencies': [
'../tools/xdisplaycheck/xdisplaycheck.gyp:xdisplaycheck',
],
@@ -341,7 +341,7 @@
'test/unit/chrome_test_suite.h',
],
'conditions': [
- ['OS=="linux"', {
+ ['OS=="linux" or OS=="freebsd"', {
'dependencies': [
'../build/linux/system.gyp:gtk',
'../build/linux/system.gyp:nss',
@@ -555,12 +555,12 @@
'../webkit/webkit.gyp:copy_npapi_test_plugin',
],
}],
- ['OS=="linux"', {
+ ['OS=="linux" or OS=="freebsd"', {
'dependencies': [
'../build/linux/system.gyp:gtk',
'../tools/xdisplaycheck/xdisplaycheck.gyp:xdisplaycheck',
],
- }, { # else: OS != "linux"
+ }, { # else: OS != "linux" and OS != "freebsd"
'sources!': [
'browser/process_singleton_linux_uitest.cc',
],
@@ -720,7 +720,7 @@
'test/webdriver/commands/webdriver_command.cc',
],
'conditions': [
- ['OS=="linux"', {
+ ['OS=="linux" or OS=="freebsd"', {
'dependencies': [
'../build/linux/system.gyp:gtk',
'../tools/xdisplaycheck/xdisplaycheck.gyp:xdisplaycheck',
@@ -1749,7 +1749,7 @@
['exclude', '^browser/chromeos/'],
],
}],
- ['OS=="linux"', {
+ ['OS=="linux" or OS=="freebsd"', {
'conditions': [
['gcc_version==44', {
# Avoid gcc 4.4 strict aliasing issues in stl_tree.h when
@@ -1786,7 +1786,7 @@
'sources!': [
'browser/printing/print_job_unittest.cc',
],
- }, { # else: OS != "linux"
+ }, { # else: OS != "linux" and OS != "freebsd"
'sources!': [
'browser/gtk/tabs/tab_renderer_gtk_unittest.cc',
'browser/renderer_host/gtk_key_bindings_handler_unittest.cc',
@@ -2265,7 +2265,7 @@
'browser/renderer_host/test/render_view_host_manager_browsertest.cc',
],
}],
- ['OS=="linux"', {
+ ['OS=="linux" or OS=="freebsd"', {
'dependencies': [
'../build/linux/system.gyp:gtk',
'../build/linux/system.gyp:nss',
@@ -2428,7 +2428,7 @@
},
},
},],
- ['OS=="linux"', {
+ ['OS=="linux" or OS=="freebsd"', {
'dependencies': [
'../build/linux/system.gyp:gtk',
'../tools/xdisplaycheck/xdisplaycheck.gyp:xdisplaycheck',
@@ -2529,7 +2529,7 @@
},
},
},],
- ['OS=="linux"', {
+ ['OS=="linux" or OS=="freebsd"', {
'dependencies': [
'../build/linux/system.gyp:gtk',
],
@@ -2566,7 +2566,7 @@
},
},
},],
- ['OS=="linux"', {
+ ['OS=="linux" or OS=="freebsd"', {
'dependencies': [
'../build/linux/system.gyp:gtk',
'../tools/xdisplaycheck/xdisplaycheck.gyp:xdisplaycheck',
@@ -2603,7 +2603,7 @@
'test/tab_switching/tab_switching_test.cc',
],
'conditions': [
- ['OS=="linux"', {
+ ['OS=="linux" or OS=="freebsd"', {
'dependencies': [
'../build/linux/system.gyp:gtk',
'../tools/xdisplaycheck/xdisplaycheck.gyp:xdisplaycheck',
@@ -2637,7 +2637,7 @@
'test/memory_test/memory_test.cc',
],
'conditions': [
- ['OS=="linux"', {
+ ['OS=="linux" or OS=="freebsd"', {
'dependencies': [
'../build/linux/system.gyp:gtk',
'../tools/xdisplaycheck/xdisplaycheck.gyp:xdisplaycheck',
@@ -2790,7 +2790,7 @@
'browser/sync/util/data_encryption_unittest.cc',
],
}],
- ['OS=="linux"', {
+ ['OS=="linux" or OS=="freebsd"', {
'dependencies': [
'../build/linux/system.gyp:gtk',
'../build/linux/system.gyp:nss',
@@ -2908,7 +2908,7 @@
],
'conditions': [
# Plugin code.
- ['OS=="linux" or OS=="win"', {
+ ['OS=="linux" or OS=="freebsd" or OS=="win"', {
'dependencies': [
'plugin',
],
@@ -2916,7 +2916,7 @@
'plugin',
],
}],
- ['OS=="linux"', {
+ ['OS=="linux" or OS=="freebsd"', {
'dependencies': [
'../build/linux/system.gyp:gtk',
'../build/linux/system.gyp:nss',
@@ -3143,7 +3143,7 @@
'test/perf/url_parse_perftest.cc',
],
'conditions': [
- ['OS=="linux"', {
+ ['OS=="linux" or OS=="freebsd"', {
'dependencies': [
'../build/linux/system.gyp:gtk',
'../tools/xdisplaycheck/xdisplaycheck.gyp:xdisplaycheck',

View file

@ -0,0 +1,20 @@
--- chrome/common/chrome_constants.cc.orig 2011-01-06 10:02:01.000000000 +0100
+++ chrome/common/chrome_constants.cc 2011-01-09 20:43:41.000000000 +0100
@@ -27,7 +27,7 @@
#if defined(OS_WIN)
const FilePath::CharType kBrowserProcessExecutableName[] = FPL("chrome.exe");
const FilePath::CharType kHelperProcessExecutableName[] = FPL("chrome.exe");
-#elif defined(OS_LINUX)
+#elif defined(OS_LINUX) || defined(OS_FREEBSD)
const FilePath::CharType kBrowserProcessExecutableName[] = FPL("chrome");
// Helper processes end up with a name of "exe" due to execing via
// /proc/self/exe. See bug 22703.
@@ -40,7 +40,7 @@
#if defined(OS_WIN)
const FilePath::CharType kBrowserProcessExecutablePath[] = FPL("chrome.exe");
const FilePath::CharType kHelperProcessExecutablePath[] = FPL("chrome.exe");
-#elif defined(OS_LINUX)
+#elif defined(OS_LINUX) || defined(OS_FREEBSD)
const FilePath::CharType kBrowserProcessExecutablePath[] = FPL("chrome");
const FilePath::CharType kHelperProcessExecutablePath[] = FPL("chrome");
#elif defined(OS_MACOSX)

View file

@ -0,0 +1,11 @@
--- ./chrome/common/chrome_paths.cc.orig 2010-12-16 02:12:13.000000000 +0100
+++ ./chrome/common/chrome_paths.cc 2010-12-20 20:15:08.000000000 +0100
@@ -164,7 +164,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

View file

@ -0,0 +1,11 @@
--- ./chrome/common/chrome_switches.cc.orig 2010-12-16 02:12:13.000000000 +0100
+++ ./chrome/common/chrome_switches.cc 2010-12-20 20:15:08.000000000 +0100
@@ -1273,7 +1273,7 @@
const char kEnableAdvancedFileSystem[] = "enable-advanced-fs";
#endif
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_FREEBSD)
// Specify the amount the trackpad should scroll by.
const char kScrollPixels[] = "scroll-pixels";
#endif

View file

@ -0,0 +1,11 @@
--- ./chrome/common/chrome_switches.h.orig 2010-12-16 02:12:13.000000000 +0100
+++ ./chrome/common/chrome_switches.h 2010-12-20 20:15:08.000000000 +0100
@@ -361,7 +361,7 @@
extern const char kEnableAdvancedFileSystem[];
#endif
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_FREEBSD)
extern const char kScrollPixels[];
#endif

View file

@ -0,0 +1,11 @@
--- ./chrome/common/gpu_messages_internal.h.orig 2010-12-16 02:12:13.000000000 +0100
+++ ./chrome/common/gpu_messages_internal.h 2010-12-20 20:15:08.000000000 +0100
@@ -82,7 +82,7 @@
IPC_MESSAGE_CONTROL1(GpuHostMsg_GraphicsInfoCollected,
GPUInfo /* GPU logging stats */)
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_FREEBSD)
// Get the XID for a view ID.
IPC_SYNC_MESSAGE_CONTROL1_1(GpuHostMsg_GetViewXID,
gfx::NativeViewId, /* view */

View file

@ -0,0 +1,11 @@
--- chrome/common/multi_process_lock.h.orig 2011-03-20 22:02:04.375736719 +0200
+++ chrome/common/multi_process_lock.h 2011-03-20 22:02:04.485737571 +0200
@@ -18,7 +18,7 @@
// The length of a multi-process lock name is limited on Linux, so
// it is limited it on all platforms for consistency. This length does
// not include a terminator.
- static const size_t MULTI_PROCESS_LOCK_NAME_MAX_LEN = 106;
+ static const size_t MULTI_PROCESS_LOCK_NAME_MAX_LEN = 102;
// Factory method for creating a multi-process lock.
// |name| is the name of the lock. The name has special meaning on Windows

View file

@ -0,0 +1,11 @@
--- chrome/common/native_web_keyboard_event.h.orig 2011-03-20 22:02:04.188736136 +0200
+++ chrome/common/native_web_keyboard_event.h 2011-03-20 22:02:04.394737178 +0200
@@ -60,7 +60,7 @@
// Currently, it's only used by Linux and Mac ports.
bool skip_in_browser;
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_FREEBSD)
// True if the key event matches an edit command. In order to ensure the edit
// command always work in web page, the browser should not pre-handle this key
// event as a reserved accelerator. See http://crbug.com/54573

View file

@ -0,0 +1,38 @@
--- chrome/common/plugin_messages.cc.orig 2011-01-19 12:12:15.000000000 +0100
+++ chrome/common/plugin_messages.cc 2011-01-21 20:46:41.000000000 +0100
@@ -56,7 +56,7 @@
PluginMsg_UpdateGeometry_Param::PluginMsg_UpdateGeometry_Param()
: transparent(false),
-#if !defined(OS_MACOSX)
+#if !defined(OS_MACOSX) && !defined(OS_FREEBSD)
windowless_buffer(TransportDIB::DefaultHandleValue()),
background_buffer(TransportDIB::DefaultHandleValue())
#else
@@ -271,7 +271,7 @@
WriteParam(m, p.windowless_buffer);
WriteParam(m, p.background_buffer);
WriteParam(m, p.transparent);
-#if defined(OS_MACOSX)
+#if defined(OS_MACOSX) || defined(OS_FREEBSD)
WriteParam(m, p.ack_key);
#endif
}
@@ -285,7 +285,7 @@
ReadParam(m, iter, &r->windowless_buffer) &&
ReadParam(m, iter, &r->background_buffer) &&
ReadParam(m, iter, &r->transparent)
-#if defined(OS_MACOSX)
+#if defined(OS_MACOSX) || defined(OS_FREEBSD)
&&
ReadParam(m, iter, &r->ack_key)
#endif
@@ -304,7 +304,7 @@
LogParam(p.background_buffer, l);
l->append(", ");
LogParam(p.transparent, l);
-#if defined(OS_MACOSX)
+#if defined(OS_MACOSX) || defined(OS_FREEBSD)
l->append(", ");
LogParam(p.ack_key, l);
#endif

View file

@ -0,0 +1,11 @@
--- ./chrome/common/plugin_messages.h.orig 2010-12-16 02:12:13.000000000 +0100
+++ ./chrome/common/plugin_messages.h 2010-12-20 20:15:08.000000000 +0100
@@ -116,7 +116,7 @@
TransportDIB::Handle windowless_buffer;
TransportDIB::Handle background_buffer;
-#if defined(OS_MACOSX)
+#if defined(OS_MACOSX) || defined(OS_FREEBSD)
// This field contains a key that the plug-in process is expected to return
// to the renderer in its ACK message, unless the value is -1, in which case
// no ACK message is required. Other than the special -1 value, the values

View file

@ -0,0 +1,11 @@
--- chrome/common/render_messages_internal.h.orig 2011-01-06 10:02:01.000000000 +0100
+++ chrome/common/render_messages_internal.h 2011-01-09 20:47:08.000000000 +0100
@@ -2117,7 +2117,7 @@
std::string /* extension_id */,
std::string /* name */)
-#if defined(OS_MACOSX)
+#if defined(OS_MACOSX) || defined(OS_FREEBSD)
// On OSX, we cannot allocated shared memory from within the sandbox, so
// this call exists for the renderer to ask the browser to allocate memory
// on its behalf. We return a file descriptor to the POSIX shared memory.

View file

@ -0,0 +1,19 @@
--- chrome/common/set_process_title_linux.cc.orig 2011-03-20 22:02:04.226737055 +0200
+++ chrome/common/set_process_title_linux.cc 2011-03-20 22:02:04.407737434 +0200
@@ -48,6 +48,8 @@
extern char** environ;
static char** g_main_argv = NULL;
+
+#if !defined(OS_FREEBSD)
static char* g_orig_argv0 = NULL;
void setproctitle(const char* fmt, ...) {
@@ -100,6 +102,7 @@
va_end(ap);
g_main_argv[1] = NULL;
}
+#endif
// A version of this built into glibc would not need this function, since
// it could stash the argv pointer in __libc_start_main(). But we need it.

View file

@ -0,0 +1,20 @@
--- chrome/common/set_process_title_linux.h.orig 2011-03-20 22:02:04.219736445 +0200
+++ chrome/common/set_process_title_linux.h 2011-03-20 22:02:04.404739287 +0200
@@ -6,6 +6,9 @@
#define CHROME_COMMON_SET_PROCESS_TITLE_LINUX_H_
#pragma once
+#include "build/build_config.h"
+
+#if !defined(OS_FREEBSD)
// Set the process title that will show in "ps" and similar tools. Takes
// printf-style format string and arguments. After calling setproctitle()
// the original main() argv[] array should not be used. By default, the
@@ -15,6 +18,7 @@
// This signature and naming is to be compatible with most other Unix
// implementations of setproctitle().
void setproctitle(const char* fmt, ...);
+#endif
// Initialize state needed for setproctitle() on Linux. Pass the argv pointer
// from main() to setproctitle_init() before calling setproctitle().

View file

@ -0,0 +1,11 @@
--- ./chrome/default_plugin/default_plugin.gyp.orig 2010-12-16 02:12:13.000000000 +0100
+++ ./chrome/default_plugin/default_plugin.gyp 2010-12-20 20:15:08.000000000 +0100
@@ -53,7 +53,7 @@
'plugin_install_job_monitor.h',
],
}],
- ['OS=="linux"', {
+ ['OS=="linux" or OS=="freebsd"', {
'dependencies': [
'<(DEPTH)/build/linux/system.gyp:gtk',
],

View file

@ -0,0 +1,11 @@
--- chrome/gpu/gpu_channel.cc.orig 2011-01-26 10:30:52.000000000 +0100
+++ chrome/gpu/gpu_channel.cc 2011-01-30 14:12:45.000000000 +0100
@@ -139,7 +139,7 @@
// offscreen rendering and the browser provides whichever platform specific
// "render target" the GpuCommandBufferStub targets.
handle = gfx::NativeViewFromId(view_id);
-#elif defined(OS_LINUX)
+#elif defined(OS_LINUX) || defined(OS_FREEBSD)
// Ask the browser for the view's XID.
gpu_thread_->Send(new GpuHostMsg_GetViewXID(view_id, &handle));
#elif defined(OS_MACOSX)

View file

@ -0,0 +1,19 @@
--- ./chrome/gpu/x_util.h.orig 2010-12-16 02:11:58.000000000 +0100
+++ ./chrome/gpu/x_util.h 2010-12-20 20:15:08.000000000 +0100
@@ -12,7 +12,7 @@
#include "build/build_config.h"
#include "chrome/gpu/gpu_config.h"
-#if defined(OS_LINUX)
+#if defined(USE_X11)
// Forward declares ------------------------------------------------------------
//
@@ -42,6 +42,6 @@
void operator()(void* x) const;
};
-#endif // OS_LINUX
+#endif // USE_X11
#endif // CHROME_GPU_X_UTIL_H_

View file

@ -0,0 +1,18 @@
--- ./chrome/plugin/plugin_main_linux.cc.orig 2010-12-16 02:11:58.000000000 +0100
+++ ./chrome/plugin/plugin_main_linux.cc 2010-12-20 20:15:08.000000000 +0100
@@ -5,13 +5,13 @@
#include <signal.h>
#include <string.h>
#include <sys/types.h>
-#include <syscall.h>
+#include <sys/syscall.h>
#include <unistd.h>
#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_FREEBSD)
namespace {

View file

@ -0,0 +1,20 @@
--- ./chrome/plugin/plugin_thread.cc.orig 2010-12-16 02:11:58.000000000 +0100
+++ ./chrome/plugin/plugin_thread.cc 2010-12-20 20:15:08.000000000 +0100
@@ -6,7 +6,7 @@
#include "build/build_config.h"
-#if defined(USE_X11)
+#if defined(TOOLKIT_USES_GTK)
#include <gtk/gtk.h>
#elif defined(OS_MACOSX)
#include <CoreFoundation/CoreFoundation.h>
@@ -57,7 +57,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.

Some files were not shown because too many files have changed in this diff Show more