Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(378)

Side by Side Diff: content/browser/browser_main_loop.cc

Issue 16206002: Add more support for FreeBSD (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use os_posix and exclude other platforms as needed Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/browser_main_loop.h" 5 #include "content/browser/browser_main_loop.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 #include <commctrl.h> 71 #include <commctrl.h>
72 #include <shellapi.h> 72 #include <shellapi.h>
73 73
74 #include "base/win/text_services_message_filter.h" 74 #include "base/win/text_services_message_filter.h"
75 #include "content/browser/system_message_window_win.h" 75 #include "content/browser/system_message_window_win.h"
76 #include "content/common/sandbox_win.h" 76 #include "content/common/sandbox_win.h"
77 #include "net/base/winsock_init.h" 77 #include "net/base/winsock_init.h"
78 #include "ui/base/l10n/l10n_util_win.h" 78 #include "ui/base/l10n/l10n_util_win.h"
79 #endif 79 #endif
80 80
81 #if defined(OS_LINUX) || defined(OS_OPENBSD) 81 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) && \
82 !defined(OS_NACL)
82 #include <glib-object.h> 83 #include <glib-object.h>
83 #endif 84 #endif
84 85
85 #if defined(OS_LINUX) 86 #if defined(OS_LINUX)
86 #include "content/browser/device_monitor_linux.h" 87 #include "content/browser/device_monitor_linux.h"
87 #elif defined(OS_MACOSX) && !defined(OS_IOS) 88 #elif defined(OS_MACOSX) && !defined(OS_IOS)
88 #include "content/browser/device_monitor_mac.h" 89 #include "content/browser/device_monitor_mac.h"
89 #endif 90 #endif
90 91
91 #if defined(TOOLKIT_GTK) 92 #if defined(TOOLKIT_GTK)
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 if (want_setuid_sandbox && sandbox_binary) { 159 if (want_setuid_sandbox && sandbox_binary) {
159 sandbox_cmd = sandbox_binary; 160 sandbox_cmd = sandbox_binary;
160 } 161 }
161 162
162 // Tickle the sandbox host and zygote host so they fork now. 163 // Tickle the sandbox host and zygote host so they fork now.
163 RenderSandboxHostLinux::GetInstance()->Init(sandbox_cmd); 164 RenderSandboxHostLinux::GetInstance()->Init(sandbox_cmd);
164 ZygoteHostImpl::GetInstance()->Init(sandbox_cmd); 165 ZygoteHostImpl::GetInstance()->Init(sandbox_cmd);
165 } 166 }
166 #endif 167 #endif
167 168
168 #if defined(OS_LINUX) || defined(OS_OPENBSD) 169 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) && \
170 !defined(OS_NACL)
169 static void GLibLogHandler(const gchar* log_domain, 171 static void GLibLogHandler(const gchar* log_domain,
170 GLogLevelFlags log_level, 172 GLogLevelFlags log_level,
171 const gchar* message, 173 const gchar* message,
172 gpointer userdata) { 174 gpointer userdata) {
173 if (!log_domain) 175 if (!log_domain)
174 log_domain = "<unknown>"; 176 log_domain = "<unknown>";
175 if (!message) 177 if (!message)
176 message = "<no message>"; 178 message = "<no message>";
177 179
178 if (strstr(message, "Loading IM context type") || 180 if (strstr(message, "Loading IM context type") ||
(...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after
896 return result_code_; 898 return result_code_;
897 } 899 }
898 900
899 void BrowserMainLoop::InitializeToolkit() { 901 void BrowserMainLoop::InitializeToolkit() {
900 TRACE_EVENT0("startup", "BrowserMainLoop::InitializeToolkit") 902 TRACE_EVENT0("startup", "BrowserMainLoop::InitializeToolkit")
901 // TODO(evan): this function is rather subtle, due to the variety 903 // TODO(evan): this function is rather subtle, due to the variety
902 // of intersecting ifdefs we have. To keep it easy to follow, there 904 // of intersecting ifdefs we have. To keep it easy to follow, there
903 // are no #else branches on any #ifs. 905 // are no #else branches on any #ifs.
904 // TODO(stevenjb): Move platform specific code into platform specific Parts 906 // TODO(stevenjb): Move platform specific code into platform specific Parts
905 // (Need to add InitializeToolkit stage to BrowserParts). 907 // (Need to add InitializeToolkit stage to BrowserParts).
906 #if defined(OS_LINUX) || defined(OS_OPENBSD) 908 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) && \
909 !defined(OS_NACL)
907 // g_type_init will be deprecated in 2.36. 2.35 is the development 910 // g_type_init will be deprecated in 2.36. 2.35 is the development
908 // version for 2.36, hence do not call g_type_init starting 2.35. 911 // version for 2.36, hence do not call g_type_init starting 2.35.
909 // http://developer.gnome.org/gobject/unstable/gobject-Type-Information.html#g -type-init 912 // http://developer.gnome.org/gobject/unstable/gobject-Type-Information.html#g -type-init
910 #if !GLIB_CHECK_VERSION(2, 35, 0) 913 #if !GLIB_CHECK_VERSION(2, 35, 0)
911 // Glib type system initialization. Needed at least for gconf, 914 // Glib type system initialization. Needed at least for gconf,
912 // used in net/proxy/proxy_config_service_linux.cc. Most likely 915 // used in net/proxy/proxy_config_service_linux.cc. Most likely
913 // this is superfluous as gtk_init() ought to do this. It's 916 // this is superfluous as gtk_init() ought to do this. It's
914 // definitely harmless, so retained as a reminder of this 917 // definitely harmless, so retained as a reminder of this
915 // requirement for gconf. 918 // requirement for gconf.
916 g_type_init(); 919 g_type_init();
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
951 if (parameters_.ui_task) 954 if (parameters_.ui_task)
952 base::MessageLoopForUI::current()->PostTask(FROM_HERE, 955 base::MessageLoopForUI::current()->PostTask(FROM_HERE,
953 *parameters_.ui_task); 956 *parameters_.ui_task);
954 957
955 base::RunLoop run_loop; 958 base::RunLoop run_loop;
956 run_loop.Run(); 959 run_loop.Run();
957 #endif 960 #endif
958 } 961 }
959 962
960 } // namespace content 963 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698