Skip to content

Commit c55ed7e

Browse files
committed
chromium queda como en OpenBSD 6.4 pero con llaves de pdJ
1 parent 8520342 commit c55ed7e

File tree

38 files changed

+1036
-0
lines changed

38 files changed

+1036
-0
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
$OpenBSD: patch-base_sys_info_openbsd_cc,v 1.13 2017/10/29 14:36:53 robert Exp $
2+
3+
Index: base/sys_info_openbsd.cc
4+
--- base/sys_info_openbsd.cc.orig
5+
+++ base/sys_info_openbsd.cc
6+
@@ -29,6 +29,10 @@ int64_t AmountOfMemory(int pages_name) {
7+
8+
namespace base {
9+
10+
+// pledge(2)
11+
+int64_t aofpmem = 0;
12+
+int64_t aofapmem = 0;
13+
+
14+
// static
15+
int SysInfo::NumberOfProcessors() {
16+
int mib[] = { CTL_HW, HW_NCPU };
17+
@@ -43,26 +47,20 @@ int SysInfo::NumberOfProcessors() {
18+
19+
// static
20+
int64_t SysInfo::AmountOfPhysicalMemoryImpl() {
21+
- return AmountOfMemory(_SC_PHYS_PAGES);
22+
+ // pledge(2)
23+
+ if (!aofpmem)
24+
+ aofpmem = AmountOfMemory(_SC_PHYS_PAGES);
25+
+ return aofpmem;
26+
}
27+
28+
// static
29+
int64_t SysInfo::AmountOfAvailablePhysicalMemoryImpl() {
30+
// We should add inactive file-backed memory also but there is no such
31+
// information from OpenBSD unfortunately.
32+
- return AmountOfMemory(_SC_AVPHYS_PAGES);
33+
-}
34+
-
35+
-// static
36+
-uint64_t SysInfo::MaxSharedMemorySize() {
37+
- int mib[] = { CTL_KERN, KERN_SHMINFO, KERN_SHMINFO_SHMMAX };
38+
- size_t limit;
39+
- size_t size = sizeof(limit);
40+
- if (sysctl(mib, arraysize(mib), &limit, &size, NULL, 0) < 0) {
41+
- NOTREACHED();
42+
- return 0;
43+
- }
44+
- return static_cast<uint64_t>(limit);
45+
+ // pledge(2)
46+
+ if (!aofapmem)
47+
+ aofapmem = AmountOfMemory(_SC_AVPHYS_PAGES);
48+
+ return aofapmem;
49+
}
50+
51+
// static
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
$OpenBSD: patch-base_sys_info_posix_cc,v 1.12 2018/09/12 19:10:34 robert Exp $
2+
Index: base/sys_info_posix.cc
3+
--- base/sys_info_posix.cc.orig
4+
+++ base/sys_info_posix.cc
5+
@@ -146,7 +146,20 @@ int64_t SysInfo::AmountOfVirtualMemory() {
6+
}
7+
#endif
8+
9+
+#if !defined(OS_BSD)
10+
// static
11+
+int64_t SysInfo::AmountOfAvailablePhysicalMemory() {
12+
+ long available_pages = sysconf(_SC_AVPHYS_PAGES);
13+
+ long page_size = sysconf(_SC_PAGE_SIZE);
14+
+ if (available_pages == -1 || page_size == -1) {
15+
+ NOTREACHED();
16+
+ return 0;
17+
+ }
18+
+ return static_cast<int64_t>(available_pages) * page_size;
19+
+}
20+
+#endif
21+
+
22+
+// static
23+
int64_t SysInfo::AmountOfFreeDiskSpace(const FilePath& path) {
24+
AssertBlockingAllowed();
25+
26+
@@ -226,6 +239,8 @@ std::string SysInfo::OperatingSystemArchitecture() {
27+
arch = "x86";
28+
} else if (arch == "amd64") {
29+
arch = "x86_64";
30+
+ } else if (arch == "arm64") {
31+
+ arch = "aarch64";
32+
} else if (std::string(info.sysname) == "AIX") {
33+
arch = "ppc64";
34+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
$OpenBSD: patch-chrome_browser_extensions_api_music_manager_private_device_id_linux_cc,v 1.5 2017/10/25 13:47:07 robert Exp $
2+
Index: chrome/browser/extensions/api/music_manager_private/device_id_linux.cc
3+
--- chrome/browser/extensions/api/music_manager_private/device_id_linux.cc.orig
4+
+++ chrome/browser/extensions/api/music_manager_private/device_id_linux.cc
5+
@@ -4,6 +4,15 @@
6+
7+
#include "chrome/browser/extensions/api/music_manager_private/device_id.h"
8+
9+
+#include "build/build_config.h"
10+
+
11+
+#if defined(OS_BSD)
12+
+#include <sys/types.h>
13+
+#include <net/if_dl.h>
14+
+#include <netinet/in.h>
15+
+#include <sys/socket.h>
16+
+#endif
17+
+
18+
#include <ifaddrs.h>
19+
#include <net/if.h>
20+
#include <stddef.h>
21+
@@ -106,11 +115,33 @@ class MacAddressProcessor {
22+
const char* const prefixes[],
23+
size_t prefixes_count) {
24+
const int MAC_LENGTH = 6;
25+
+#if defined(OS_BSD)
26+
+ struct ifaddrs *ifap, *ifinfo;
27+
+#else
28+
struct ifreq ifinfo;
29+
+#endif
30+
31+
memset(&ifinfo, 0, sizeof(ifinfo));
32+
- strncpy(ifinfo.ifr_name, ifaddr->ifa_name, sizeof(ifinfo.ifr_name) - 1);
33+
34+
+#if defined(OS_BSD)
35+
+ int result = getifaddrs(&ifap);
36+
+ if (result != 0)
37+
+ return true;
38+
+ result = 1; // no MAC found yet
39+
+ for (ifinfo = ifap; ifinfo != NULL; ifinfo = ifinfo->ifa_next) {
40+
+ struct sockaddr* sa = ifinfo->ifa_addr;
41+
+ if (sa->sa_family == AF_LINK &&
42+
+ !strncmp(ifinfo->ifa_name, ifaddr->ifa_name,
43+
+ sizeof(ifinfo->ifa_name) - 1)) {
44+
+ result = 0;
45+
+ break;
46+
+ }
47+
+ }
48+
+
49+
+ char mac_address[6];
50+
+ strncpy(mac_address, (const char*)LLADDR((struct sockaddr_dl*)ifinfo->ifa_addr), sizeof(mac_address));
51+
+#else
52+
+ strncpy(ifinfo.ifr_name, ifaddr->ifa_name, sizeof(ifinfo.ifr_name) - 1);
53+
int sd = socket(AF_INET, SOCK_DGRAM, 0);
54+
int result = ioctl(sd, SIOCGIFHWADDR, &ifinfo);
55+
close(sd);
56+
@@ -120,11 +151,17 @@ class MacAddressProcessor {
57+
58+
const char* mac_address =
59+
static_cast<const char*>(ifinfo.ifr_hwaddr.sa_data);
60+
+#endif
61+
if (!is_valid_mac_address_.Run(mac_address, MAC_LENGTH))
62+
return true;
63+
64+
+#if defined(OS_BSD)
65+
+ if (!IsValidPrefix(ifinfo->ifa_name, prefixes, prefixes_count))
66+
+ return true;
67+
+#else
68+
if (!IsValidPrefix(ifinfo.ifr_name, prefixes, prefixes_count))
69+
return true;
70+
+#endif
71+
72+
// Got one!
73+
found_mac_address_ =
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
$OpenBSD: patch-chrome_browser_media_router_providers_wired_display_wired_display_media_route_provider_cc,v 1.1 2018/04/23 15:00:16 robert Exp $
2+
3+
Index: chrome/browser/media/router/providers/wired_display/wired_display_media_route_provider.cc
4+
--- chrome/browser/media/router/providers/wired_display/wired_display_media_route_provider.cc.orig
5+
+++ chrome/browser/media/router/providers/wired_display/wired_display_media_route_provider.cc
6+
@@ -111,6 +111,11 @@ void WiredDisplayMediaRouteProvider::CreateRoute(
7+
bool incognito,
8+
CreateRouteCallback callback) {
9+
DCHECK(!base::ContainsKey(presentations_, presentation_id));
10+
+#if defined(OS_BSD) // XXX
11+
+ std::move(callback).Run(base::nullopt, std::string("Not implemented"),
12+
+ RouteRequestResult::UNKNOWN_ERROR);
13+
+ return;
14+
+#else
15+
base::Optional<Display> display = GetDisplayBySinkId(sink_id);
16+
if (!display) {
17+
std::move(callback).Run(base::nullopt, std::string("Display not found"),
18+
@@ -135,6 +140,7 @@ void WiredDisplayMediaRouteProvider::CreateRoute(
19+
presentation.receiver()->Start(presentation_id, GURL(media_source));
20+
std::move(callback).Run(route, base::nullopt, RouteRequestResult::OK);
21+
NotifyRouteObservers();
22+
+#endif
23+
}
24+
25+
void WiredDisplayMediaRouteProvider::JoinRoute(
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
$OpenBSD: patch-chrome_browser_notifications_message_center_notification_manager_cc,v 1.17 2018/06/02 17:19:23 robert Exp $
2+
Index: chrome/browser/notifications/message_center_notification_manager.cc
3+
--- chrome/browser/notifications/message_center_notification_manager.cc.orig
4+
+++ chrome/browser/notifications/message_center_notification_manager.cc
5+
@@ -45,7 +45,7 @@ MessageCenterNotificationManager::MessageCenterNotific
6+
std::make_unique<FullscreenNotificationBlocker>(message_center));
7+
#endif
8+
9+
-#if defined(OS_WIN) || defined(OS_MACOSX) \
10+
+#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_BSD) \
11+
|| (defined(OS_LINUX) && !defined(OS_CHROMEOS))
12+
// On Windows, Linux and Mac, the notification manager owns the tray icon and
13+
// views.Other platforms have global ownership and Create will return NULL.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
$OpenBSD: patch-chrome_browser_signin_account_consistency_mode_manager_cc,v 1.1 2018/09/27 06:36:18 robert Exp $
2+
3+
Index: chrome/browser/signin/account_consistency_mode_manager.cc
4+
--- chrome/browser/signin/account_consistency_mode_manager.cc.orig
5+
+++ chrome/browser/signin/account_consistency_mode_manager.cc
6+
@@ -20,7 +20,7 @@
7+
#include "content/public/browser/browser_thread.h"
8+
#include "google_apis/google_api_keys.h"
9+
10+
-#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX)
11+
+#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_BSD)
12+
#include "ui/base/ui_base_features.h"
13+
#endif
14+
15+
@@ -258,7 +258,7 @@ AccountConsistencyModeManager::ComputeAccountConsisten
16+
AccountConsistencyMethod method =
17+
AccountConsistencyMethod::kDicePrepareMigration;
18+
19+
-#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX)
20+
+#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_BSD)
21+
if (base::FeatureList::IsEnabled(features::kExperimentalUi))
22+
method = AccountConsistencyMethod::kDiceMigration;
23+
#endif
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
$OpenBSD: patch-chrome_browser_speech_tts_controller_impl_cc,v 1.11 2018/09/12 17:08:22 robert Exp $
2+
Index: chrome/browser/speech/tts_controller_impl.cc
3+
--- chrome/browser/speech/tts_controller_impl.cc.orig
4+
+++ chrome/browser/speech/tts_controller_impl.cc
5+
@@ -449,9 +449,13 @@ int TtsControllerImpl::QueueSize() {
6+
}
7+
8+
TtsPlatformImpl* TtsControllerImpl::GetPlatformImpl() {
9+
+#if defined(OS_BSD)
10+
+ return NULL;
11+
+#else
12+
if (!platform_impl_)
13+
platform_impl_ = TtsPlatformImpl::GetInstance();
14+
return platform_impl_;
15+
+#endif
16+
}
17+
18+
int TtsControllerImpl::GetMatchingVoice(
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
$OpenBSD: patch-chrome_browser_ui_browser_commands_cc,v 1.1 2018/09/27 06:36:18 robert Exp $
2+
3+
Index: chrome/browser/ui/browser_commands.cc
4+
--- chrome/browser/ui/browser_commands.cc.orig
5+
+++ chrome/browser/ui/browser_commands.cc
6+
@@ -1228,7 +1228,7 @@ bool CanViewSource(const Browser* browser) {
7+
CanViewSource();
8+
}
9+
10+
-#if defined(OS_WIN) || (defined(OS_LINUX) && !defined(OS_CHROMEOS))
11+
+#if defined(OS_BSD) || defined(OS_WIN) || (defined(OS_LINUX) && !defined(OS_CHROMEOS))
12+
void ToggleConfirmToQuitOption(Browser* browser) {
13+
PrefService* pref_service = browser->profile()->GetPrefs();
14+
bool enabled = pref_service->GetBoolean(prefs::kConfirmToQuitEnabled);
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
$OpenBSD: patch-chrome_browser_ui_browser_commands_h,v 1.1 2018/09/27 06:36:18 robert Exp $
2+
3+
Index: chrome/browser/ui/browser_commands.h
4+
--- chrome/browser/ui/browser_commands.h.orig
5+
+++ chrome/browser/ui/browser_commands.h
6+
@@ -148,7 +148,7 @@ bool IsDebuggerAttachedToCurrentTab(Browser* browser);
7+
void CopyURL(Browser* browser);
8+
void OpenInChrome(Browser* browser);
9+
bool CanViewSource(const Browser* browser);
10+
-#if defined(OS_WIN) || (defined(OS_LINUX) && !defined(OS_CHROMEOS))
11+
+#if defined(OS_BSD) || defined(OS_WIN) || (defined(OS_LINUX) && !defined(OS_CHROMEOS))
12+
void ToggleConfirmToQuitOption(Browser* browser);
13+
#endif
14+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
$OpenBSD: patch-chrome_browser_ui_views_apps_chrome_native_app_window_views_aura_cc,v 1.9 2017/09/09 19:16:43 robert Exp $
2+
3+
Index: chrome/browser/ui/views/apps/chrome_native_app_window_views_aura.cc
4+
--- chrome/browser/ui/views/apps/chrome_native_app_window_views_aura.cc.orig
5+
+++ chrome/browser/ui/views/apps/chrome_native_app_window_views_aura.cc
6+
@@ -19,7 +19,7 @@
7+
#include "ui/gfx/image/image_skia.h"
8+
#include "ui/views/widget/widget.h"
9+
10+
-#if defined(OS_LINUX)
11+
+#if defined(OS_LINUX) || defined(OS_BSD)
12+
#include "chrome/browser/shell_integration_linux.h"
13+
#endif
14+

0 commit comments

Comments
 (0)