summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-23 22:01:17 +0000
committerthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-23 22:01:17 +0000
commitde9e0b5949b3a512787ae174137714e0effb7546 (patch)
treec0be42c51ac8009fd9b8ffdbf64a242124bce783 /chrome
parent36ee0327a9acf37dd445918029015994d88fb6f0 (diff)
downloadchromium_src-de9e0b5949b3a512787ae174137714e0effb7546.zip
chromium_src-de9e0b5949b3a512787ae174137714e0effb7546.tar.gz
chromium_src-de9e0b5949b3a512787ae174137714e0effb7546.tar.bz2
Mac: Unbreak --no-gpu-sandbox.
This regressed when I moved CrApplication out of base. BUG=none TEST=none Review URL: http://codereview.chromium.org/6065007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70102 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/common/chrome_application_mac.h13
-rw-r--r--chrome/common/chrome_application_mac.mm4
-rw-r--r--chrome/common/sandbox_mac.mm4
-rw-r--r--chrome/gpu/gpu_main.cc5
4 files changed, 21 insertions, 5 deletions
diff --git a/chrome/common/chrome_application_mac.h b/chrome/common/chrome_application_mac.h
index 585601d8..2ea557c 100644
--- a/chrome/common/chrome_application_mac.h
+++ b/chrome/common/chrome_application_mac.h
@@ -6,6 +6,8 @@
#define CHROME_COMMON_CHROME_APPLICATION_MAC_H_
#pragma once
+#if defined(__OBJC__)
+
#import <AppKit/AppKit.h>
#include "base/basictypes.h"
@@ -55,6 +57,15 @@ class ScopedSendingEvent {
DISALLOW_COPY_AND_ASSIGN(ScopedSendingEvent);
};
-} // chrome_application_mac
+} // namespace chrome_application_mac
+
+#endif // defined(__OBJC__)
+
+namespace chrome_application_mac {
+
+// To be used to instantiate CrApplication from C++ code.
+void RegisterCrApp();
+
+} // namespace chrome_application_mac
#endif // CHROME_COMMON_CHROME_APPLICATION_MAC_H_
diff --git a/chrome/common/chrome_application_mac.mm b/chrome/common/chrome_application_mac.mm
index 9bd9f67..3c1b013 100644
--- a/chrome/common/chrome_application_mac.mm
+++ b/chrome/common/chrome_application_mac.mm
@@ -69,4 +69,8 @@ ScopedSendingEvent::~ScopedSendingEvent() {
[app_ setHandlingSendEvent:handling_];
}
+void RegisterCrApp() {
+ [CrApplication sharedApplication];
+}
+
} // namespace chrome_application_mac
diff --git a/chrome/common/sandbox_mac.mm b/chrome/common/sandbox_mac.mm
index 56ad0b1..b5f9d22 100644
--- a/chrome/common/sandbox_mac.mm
+++ b/chrome/common/sandbox_mac.mm
@@ -263,10 +263,6 @@ void Sandbox::SandboxWarmup(SandboxProcessType sandbox_type) {
// Access to /dev/random is required for the field trial code.
GetUrandomFD();
}
-
- { // Without this, the GPU process dies during [CrApplication init].
- [CrApplication sharedApplication];
- }
break;
default:
diff --git a/chrome/gpu/gpu_main.cc b/chrome/gpu/gpu_main.cc
index e370ce3..2464c2f 100644
--- a/chrome/gpu/gpu_main.cc
+++ b/chrome/gpu/gpu_main.cc
@@ -25,6 +25,7 @@
#endif
#if defined(OS_MACOSX)
+#include "chrome/common/chrome_application_mac.h"
#include "chrome/common/sandbox_mac.h"
#endif
@@ -75,6 +76,10 @@ int GpuMain(const MainFunctionParams& parameters) {
ChildProcess::WaitForDebugger(L"Gpu");
}
+#if defined(OS_MACOSX)
+ chrome_application_mac::RegisterCrApp();
+#endif
+
MessageLoop main_message_loop(MessageLoop::TYPE_UI);
PlatformThread::SetName("CrGpuMain");