pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
chromium-new: Implement two more NetBSD specific functions
Module Name: pkgsrc-wip
Committed By: Ryo ONODERA <ryoon%NetBSD.org@localhost>
Pushed By: ryoon
Date: Fri Jul 22 12:51:20 2016 +0900
Changeset: 9c9980590bf1995dbb2017bbd51ecd0976a8955a
Modified Files:
chromium-new/Makefile
chromium-new/distinfo
chromium-new/patches/patch-base_base.gypi
chromium-new/patches/patch-base_process_process__info__linux.cc
Added Files:
chromium-new/patches/patch-base_process_process__handle__netbsd.cc
Log Message:
chromium-new: Implement two more NetBSD specific functions
* These two functions are not compiled yet
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=9c9980590bf1995dbb2017bbd51ecd0976a8955a
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
chromium-new/Makefile | 4 +-
chromium-new/distinfo | 5 +-
chromium-new/patches/patch-base_base.gypi | 18 ++++--
.../patch-base_process_process__handle__netbsd.cc | 72 ++++++++++++++++++++++
.../patch-base_process_process__info__linux.cc | 17 ++---
5 files changed, 100 insertions(+), 16 deletions(-)
diffs:
diff --git a/chromium-new/Makefile b/chromium-new/Makefile
index fd99320..bffac3a 100644
--- a/chromium-new/Makefile
+++ b/chromium-new/Makefile
@@ -60,8 +60,8 @@ CFLAGS+= -fno-stack-protector
# for #include <glib-2.0/gmodule.h>
CFLAGS+= -I${BUILDLINK_DIR}/include/glib
-BUILDTYPE= Release
-#BUILDTYPE= Debug
+#BUILDTYPE= Release
+BUILDTYPE= Debug
MAKE_ENV+= BUILDTYPE=${BUILDTYPE}
MAKE_ENV+= GPERF=${PREFIX}/bin/gperf
diff --git a/chromium-new/distinfo b/chromium-new/distinfo
index 8709f27..1854ed9 100644
--- a/chromium-new/distinfo
+++ b/chromium-new/distinfo
@@ -5,7 +5,7 @@ RMD160 (chromium-51.0.2704.106.tar.xz) = 7de0ee47b71dbd8e39f4259590e04e5c10ac7c6
SHA512 (chromium-51.0.2704.106.tar.xz) = 2afd73ae6942f7d3092e54d2f24bf251baa28bd40b66604fab7a5f854ccfc55b839f7860b2c2c09e35174da66f24e0fef2cb1f6d2e1733ad8da1f6cdb4a4e308
Size (chromium-51.0.2704.106.tar.xz) = 448656636 bytes
SHA1 (patch-base_base.gyp) = 8bcdefdacfc1cb979c6330eecbe3a4ee33c0aff8
-SHA1 (patch-base_base.gypi) = b0900d5b87964590f83c53cf1901c902120540b0
+SHA1 (patch-base_base.gypi) = 73e23947ac399b79d22fa99550285b4e95a18803
SHA1 (patch-base_base__paths__posix.cc) = e8c08666412f6cc9e08e58356a651a47befe290f
SHA1 (patch-base_debug_debugger__posix.cc) = b1983a4bb3a9429394b5bc0665eb66b14f228204
SHA1 (patch-base_debug_stack__trace__posix.cc) = 08dc7ad292480c3a07787df7e837266c730c10fb
@@ -24,7 +24,8 @@ SHA1 (patch-base_process_memory.cc) = cad48073d6cc898872c99c13a862694c0ce92269
SHA1 (patch-base_process_memory.h) = 089a781ab84221113c130c44d2e77446cc6f1240
SHA1 (patch-base_process_memory__stubs.cc) = 35909eff800e990b4275f27cf7c6d5d349828542
SHA1 (patch-base_process_memory__unittest.cc) = cda374fec64d4ed8da56fd2468ce332fb961f575
-SHA1 (patch-base_process_process__info__linux.cc) = 943fdb9b1e3810d51c1a8692d60f83ba6b9d6e0e
+SHA1 (patch-base_process_process__handle__netbsd.cc) = 9b236290890123473a07150fafb2b813a50e2419
+SHA1 (patch-base_process_process__info__linux.cc) = 8c6808e7143673310ec2936edb3bcbe27442498c
SHA1 (patch-base_process_process__iterator.h) = 8de7e317b4c95308ac689e2191074fc8ada3e27a
SHA1 (patch-base_process_process__iterator__freebsd.cc) = b24cf46d4b59e9f4dd4336d9288a6ba75bf55e4f
SHA1 (patch-base_process_process__iterator__netbsd.cc) = c893f74e881c9f916cdd6ce641ae764d00a2c3e7
diff --git a/chromium-new/patches/patch-base_base.gypi b/chromium-new/patches/patch-base_base.gypi
index 6aa17fc..3204e18 100644
--- a/chromium-new/patches/patch-base_base.gypi
+++ b/chromium-new/patches/patch-base_base.gypi
@@ -2,7 +2,15 @@ $NetBSD$
--- base/base.gypi.orig 2016-06-24 01:02:08.000000000 +0000
+++ base/base.gypi
-@@ -514,6 +514,7 @@
+@@ -502,6 +502,7 @@
+ 'process/process_handle_freebsd.cc',
+ 'process/process_handle_linux.cc',
+ 'process/process_handle_mac.cc',
++ 'process/process_handle_netbsd.cc',
+ 'process/process_handle_openbsd.cc',
+ 'process/process_handle_posix.cc',
+ 'process/process_handle_win.cc',
+@@ -514,6 +515,7 @@
'process/process_iterator_freebsd.cc',
'process/process_iterator_linux.cc',
'process/process_iterator_mac.cc',
@@ -10,7 +18,7 @@ $NetBSD$
'process/process_iterator_openbsd.cc',
'process/process_iterator_win.cc',
'process/process_linux.cc',
-@@ -524,6 +525,7 @@
+@@ -524,6 +526,7 @@
'process/process_metrics_linux.cc',
'process/process_metrics_mac.cc',
'process/process_metrics_nacl.cc',
@@ -18,7 +26,7 @@ $NetBSD$
'process/process_metrics_openbsd.cc',
'process/process_metrics_posix.cc',
'process/process_metrics_win.cc',
-@@ -627,6 +629,7 @@
+@@ -627,6 +630,7 @@
'sys_info_ios.mm',
'sys_info_linux.cc',
'sys_info_mac.mm',
@@ -26,7 +34,7 @@ $NetBSD$
'sys_info_openbsd.cc',
'sys_info_posix.cc',
'sys_info_win.cc',
-@@ -971,6 +974,10 @@
+@@ -971,6 +975,10 @@
'sources/': [ ['exclude', '_openbsd\\.cc$'] ],
},
],
@@ -37,7 +45,7 @@ $NetBSD$
['OS == "win" and >(nacl_untrusted_build)==0', {
'include_dirs': [
'<(DEPTH)/third_party/wtl/include',
-@@ -1021,11 +1028,16 @@
+@@ -1021,11 +1029,16 @@
'process/memory_stubs.cc',
],
'sources/': [
diff --git a/chromium-new/patches/patch-base_process_process__handle__netbsd.cc b/chromium-new/patches/patch-base_process_process__handle__netbsd.cc
new file mode 100644
index 0000000..a4cbd25
--- /dev/null
+++ b/chromium-new/patches/patch-base_process_process__handle__netbsd.cc
@@ -0,0 +1,72 @@
+$NetBSD$
+
+--- base/process/process_handle_netbsd.cc.orig 2016-07-22 03:20:51.176420341 +0000
++++ base/process/process_handle_netbsd.cc
+@@ -0,0 +1,67 @@
++// Copyright (c) 2011 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/macros.h"
++#include "base/process/process_handle.h"
++
++#include <stddef.h>
++#include <sys/sysctl.h>
++#include <sys/types.h>
++#include <unistd.h>
++
++namespace base {
++
++ProcessId GetParentProcessId(ProcessHandle process) {
++ struct kinfo_proc2 info;
++ size_t info_size = sizeof(struct kinfo_proc2);
++ int mib[6];
++ int ret;
++
++ mib[0] = CTL_KERN;
++ mib[1] = KERN_PROC2;
++ mib[2] = KERN_PROC_PID;
++ mib[3] = process;
++ mib[4] = info_size;
++ mib[5] = 1;
++
++ ret = sysctl(mib, 6, &info, &info_size, NULL, 0);
++ if (ret == -1) {
++ return -1;
++ }
++ if (info_size == 0) {
++ return -1;
++ }
++
++ return info.p_ppid;
++}
++
++FilePath GetProcessExecutablePath(ProcessHandle process) {
++ struct kinfo_proc2 info;
++ size_t size = sizeof(struct kinfo_proc2);
++ int mib[4];
++ int ret;
++ char pathname[MAXPATHLEN];
++
++ mib[0] = CTL_KERN;
++ mib[1] = KERN_PROC_ARGS;
++ mib[2] = process;
++ mib[3] = KERN_PROC_PATHNAME;
++
++ ret = sysctl(mib, 4, NULL, &size, NULL, 0);
++ if (ret == -1) {
++ return FilePath();
++ }
++
++ ret = sysctl(mib, 4, pathname, &size, NULL, 0);
++ if (ret == -1) {
++ return FilePath();
++ }
++ if (size == 0 || strlen(pathname) == 0) {
++ return FilePath();
++ }
++
++ return FilePath(pathname);
++}
++
++} // namespace base
diff --git a/chromium-new/patches/patch-base_process_process__info__linux.cc b/chromium-new/patches/patch-base_process_process__info__linux.cc
index 62b95b7..3dab0b7 100644
--- a/chromium-new/patches/patch-base_process_process__info__linux.cc
+++ b/chromium-new/patches/patch-base_process_process__info__linux.cc
@@ -2,11 +2,11 @@ $NetBSD$
--- base/process/process_info_linux.cc.orig 2016-06-24 01:02:08.000000000 +0000
+++ base/process/process_info_linux.cc
-@@ -11,10 +11,58 @@
+@@ -11,10 +11,61 @@
#include "base/process/process_handle.h"
#include "base/time/time.h"
-+#if defined(__FreeBSD__) || defined(__DragonFly__)
++#if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__)
+#include <sys/types.h>
+#include <sys/sysctl.h>
+#include <sys/user.h>
@@ -27,13 +27,17 @@ $NetBSD$
+#else
+ return Time::FromTimeVal(proc.ki_start);
+#endif
-+#if defined(__NetBSD__)
++#elif defined(__NetBSD__)
+ struct kinfo_proc2 kproc;
+ size_t esize = sizeof(kinfo_proc2);
++ size_t size;
+ int st;
+ int mib[6];
+ struct timeval tv;
+
++ tv.tv_sec = 0;
++ tv.tv_usec = 0;
++
+ mib[0] = CTL_KERN;
+ mib[1] = KERN_PROC2;
+ mib[2] = KERN_PROC_PID;
@@ -43,25 +47,24 @@ $NetBSD$
+
+ st = sysctl(mib, 6, NULL, &size, NULL, (size_t)0);
+ if (st == -1) {
-+ return NULL;
++ return Time::FromTimeVal(tv);
+ }
+
+ mib[5] = (int)(size / esize);
+ st = sysctl(mib, 6, &kproc, &size, NULL, (size_t)0);
+ if (st == -1) {
-+ return NULL;
++ return Time::FromTimeVal(tv);
+ }
+
+ tv.tv_sec = kproc.p_ustart_sec;
+ tv.tv_usec = kproc.p_ustart_usec;
+
+ return Time::FromTimeVal(tv);
-+#endif
+#else
ProcessHandle pid = GetCurrentProcessHandle();
int64_t start_ticks =
internal::ReadProcStatsAndGetFieldAsInt64(pid, internal::VM_STARTTIME);
-@@ -23,6 +71,7 @@ const Time CurrentProcessInfo::CreationT
+@@ -23,6 +74,7 @@ const Time CurrentProcessInfo::CreationT
Time boot_time = internal::GetBootTime();
DCHECK(!boot_time.is_null());
return Time(boot_time + start_offset);
Home |
Main Index |
Thread Index |
Old Index