summaryrefslogtreecommitdiffstats
path: root/chrome/app/chrome_dll_main.cc
diff options
context:
space:
mode:
authorpinkerton@google.com <pinkerton@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-16 17:47:57 +0000
committerpinkerton@google.com <pinkerton@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-16 17:47:57 +0000
commit1bcdb53dbddb785f5538cb7081b073db90c822d1 (patch)
tree9b67e0a51f98ff2d0f0bb3462f530a08a8b7e6c4 /chrome/app/chrome_dll_main.cc
parent091db5d0615084d28dfbb78d8dd6c0e169b510a4 (diff)
downloadchromium_src-1bcdb53dbddb785f5538cb7081b073db90c822d1.zip
chromium_src-1bcdb53dbddb785f5538cb7081b073db90c822d1.tar.gz
chromium_src-1bcdb53dbddb785f5538cb7081b073db90c822d1.tar.bz2
mac bootstrapping of browser main and app startup bits
Review URL: http://codereview.chromium.org/18112 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8185 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/app/chrome_dll_main.cc')
-rw-r--r--chrome/app/chrome_dll_main.cc15
1 files changed, 8 insertions, 7 deletions
diff --git a/chrome/app/chrome_dll_main.cc b/chrome/app/chrome_dll_main.cc
index 3fd4fc7..05fd8b7 100644
--- a/chrome/app/chrome_dll_main.cc
+++ b/chrome/app/chrome_dll_main.cc
@@ -22,6 +22,7 @@
#include "base/message_loop.h"
#include "base/path_service.h"
#include "base/process_util.h"
+#include "base/scoped_nsautorelease_pool.h"
#include "base/stats_table.h"
#include "base/string_util.h"
#if defined(OS_WIN)
@@ -195,6 +196,13 @@ int ChromeMain(int argc, const char** argv) {
// The exit manager is in charge of calling the dtors of singleton objects.
base::AtExitManager exit_manager;
+ // TODO(pinkerton): We need this pool here for all the objects created
+ // before we get to the UI event loop, but we don't want to leave them
+ // hanging around until the app quits. We should add a "flush" to the class
+ // which just cycles the pool under the covers and then call that just
+ // before we invoke the main UI loop near the bottom of this function.
+ base::ScopedNSAutoreleasePool autorelease_pool;
+
// Initialize the command line.
#if defined(OS_POSIX)
CommandLine::SetArgcArgv(argc, argv);
@@ -304,13 +312,6 @@ int ChromeMain(int argc, const char** argv) {
NOTREACHED() << "Unknown process type";
}
- // TODO(pinkerton): nothing after this point will be hit on Mac if this is the
- // browser process, as NSApplicationMain doesn't return. There are a couple of
- // possible solutions, including breaking this up into pre/post code (won't
- // work for stack-based objects) or making sure we fall out of the runloop
- // ourselves, then manually call |-NSApp terminate:|. We'll most likely
- // need to do the latter.
-
if (!process_type.empty()) {
#if defined(OS_WIN)
// TODO(port): enable when we figure out resource bundle issues