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

Side by Side Diff: chrome/app/chrome_main.cc

Issue 6771012: Read ChromeOS version numbers from file before sandboxing and cache them. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « base/sys_info_chromeos.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/app/chrome_main.h" 5 #include "chrome/app/chrome_main.h"
6 6
7 #include "app/app_paths.h" 7 #include "app/app_paths.h"
8 #include "base/at_exit.h" 8 #include "base/at_exit.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/debugger.h" 10 #include "base/debug/debugger.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 #include "third_party/WebKit/Source/WebKit/mac/WebCoreSupport/WebSystemInterface .h" 65 #include "third_party/WebKit/Source/WebKit/mac/WebCoreSupport/WebSystemInterface .h"
66 #include "ui/base/l10n/l10n_util_mac.h" 66 #include "ui/base/l10n/l10n_util_mac.h"
67 #endif 67 #endif
68 68
69 #if defined(OS_POSIX) 69 #if defined(OS_POSIX)
70 #include <locale.h> 70 #include <locale.h>
71 #include <signal.h> 71 #include <signal.h>
72 #endif 72 #endif
73 73
74 #if defined(OS_CHROMEOS) 74 #if defined(OS_CHROMEOS)
75 #include "base/sys_info.h"
75 #include "chrome/browser/chromeos/boot_times_loader.h" 76 #include "chrome/browser/chromeos/boot_times_loader.h"
76 #endif 77 #endif
77 78
78 #if defined(USE_X11) 79 #if defined(USE_X11)
79 #include <gdk/gdk.h> 80 #include <gdk/gdk.h>
80 #include <glib.h> 81 #include <glib.h>
81 #include <gtk/gtk.h> 82 #include <gtk/gtk.h>
82 #include <stdlib.h> 83 #include <stdlib.h>
83 #include <string.h> 84 #include <string.h>
84 #include "ui/base/x/x11_util.h" 85 #include "ui/base/x/x11_util.h"
(...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after
732 #if defined(OS_MACOSX) 733 #if defined(OS_MACOSX)
733 // Update the process name (need resources to get the strings, so 734 // Update the process name (need resources to get the strings, so
734 // only do this when ResourcesBundle has been initialized). 735 // only do this when ResourcesBundle has been initialized).
735 SetMacProcessName(process_type); 736 SetMacProcessName(process_type);
736 #endif // defined(OS_MACOSX) 737 #endif // defined(OS_MACOSX)
737 } 738 }
738 739
739 if (!process_type.empty()) 740 if (!process_type.empty())
740 CommonSubprocessInit(process_type); 741 CommonSubprocessInit(process_type);
741 742
743 #if defined(OS_CHROMEOS)
744 {
745 // Read and cache ChromeOS version from file,
746 // to be used from inside the sandbox.
747 int32 major_version, minor_version, bugfix_version;
748 base::SysInfo::OperatingSystemVersionNumbers(
749 &major_version, &minor_version, &bugfix_version);
750 }
751 #endif
752
742 // Initialize the sandbox for this process. 753 // Initialize the sandbox for this process.
743 SandboxInitWrapper sandbox_wrapper; 754 SandboxInitWrapper sandbox_wrapper;
744 bool initialize_sandbox = true; 755 bool initialize_sandbox = true;
745 756
746 #if defined(OS_WIN) 757 #if defined(OS_WIN)
747 sandbox_wrapper.SetServices(sandbox_info); 758 sandbox_wrapper.SetServices(sandbox_info);
748 #elif defined(OS_MACOSX) 759 #elif defined(OS_MACOSX)
749 // On OS X the renderer sandbox needs to be initialized later in the startup 760 // On OS X the renderer sandbox needs to be initialized later in the startup
750 // sequence in RendererMainPlatformDelegate::EnableSandbox(). 761 // sequence in RendererMainPlatformDelegate::EnableSandbox().
751 // Same goes for NaClLoader, in NaClMainPlatformDelegate::EnableSandbox(), 762 // Same goes for NaClLoader, in NaClMainPlatformDelegate::EnableSandbox(),
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
788 799
789 if (SubprocessNeedsResourceBundle(process_type)) 800 if (SubprocessNeedsResourceBundle(process_type))
790 ResourceBundle::CleanupSharedInstance(); 801 ResourceBundle::CleanupSharedInstance();
791 802
792 logging::CleanupChromeLogging(); 803 logging::CleanupChromeLogging();
793 804
794 chrome_main::LowLevelShutdown(); 805 chrome_main::LowLevelShutdown();
795 806
796 return exit_code; 807 return exit_code;
797 } 808 }
OLDNEW
« no previous file with comments | « base/sys_info_chromeos.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698