summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authormal@chromium.org <mal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-15 07:33:02 +0000
committermal@chromium.org <mal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-15 07:33:02 +0000
commit6dbe70a869066be70513583872242602bd652075 (patch)
tree5a48e50f864b5681c847d6cc027b38ec3c67e618 /chrome/browser
parented16129adbdd6d8c1613863e2498e4a804035db1 (diff)
downloadchromium_src-6dbe70a869066be70513583872242602bd652075.zip
chromium_src-6dbe70a869066be70513583872242602bd652075.tar.gz
chromium_src-6dbe70a869066be70513583872242602bd652075.tar.bz2
Rollback r9835 and r9837: Mac build broken.
r9835: Make browser_shutdown.cc compile on Posix. Review URL: http://codereview.chromium.org/20384 r9837: Fix the mac build. Add a stubbed ResourceBundle::CleanupSharedInstance. Review URL: http://codereview.chromium.org/20387 TBR= jhawkins Review URL: http://codereview.chromium.org/21385 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9840 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/browser.scons1
-rw-r--r--chrome/browser/browser_shutdown.cc28
2 files changed, 12 insertions, 17 deletions
diff --git a/chrome/browser/browser.scons b/chrome/browser/browser.scons
index 57a1149..73d6356 100644
--- a/chrome/browser/browser.scons
+++ b/chrome/browser/browser.scons
@@ -676,6 +676,7 @@ if not env.Bit('windows'):
'bookmarks/bookmark_utils.cc',
'browser_accessibility.cc',
'browser_accessibility_manager.cc',
+ 'browser_shutdown.cc',
'chrome_plugin_host.cc',
'dock_info.cc',
'dom_ui/dom_ui_contents.cc',
diff --git a/chrome/browser/browser_shutdown.cc b/chrome/browser/browser_shutdown.cc
index d3d1b98..c1c57ff 100644
--- a/chrome/browser/browser_shutdown.cc
+++ b/chrome/browser/browser_shutdown.cc
@@ -4,7 +4,6 @@
#include "chrome/browser/browser_shutdown.h"
-#include "base/file_path.h"
#include "base/file_util.h"
#include "base/histogram.h"
#include "base/path_service.h"
@@ -16,6 +15,8 @@
#include "chrome/browser/first_run.h"
#include "chrome/browser/jankometer.h"
#include "chrome/browser/metrics/metrics_service.h"
+#include "chrome/browser/plugin_process_host.h"
+#include "chrome/browser/plugin_service.h"
#include "chrome/browser/renderer_host/render_process_host.h"
#include "chrome/browser/renderer_host/render_view_host.h"
#include "chrome/browser/renderer_host/render_widget_host.h"
@@ -25,16 +26,8 @@
#include "chrome/common/pref_service.h"
#include "chrome/common/chrome_plugin_lib.h"
#include "chrome/common/resource_bundle.h"
-#include "net/dns_global.h"
-
-// TODO(port): Get rid of this section and finish porting.
-#if defined(OS_WIN)
-#include "chrome/browser/plugin_process_host.h"
#include "chrome/browser/plugin_service.h"
-#else
-#include "chrome/common/temp_scaffolding_stubs.h"
-#endif
-
+#include "net/dns_global.h"
using base::Time;
using base::TimeDelta;
@@ -48,7 +41,7 @@ int shutdown_num_processes_slow_;
bool delete_resources_on_shutdown = true;
-const char* const kShutdownMsFile = "chrome_shutdown_ms.txt";
+const wchar_t* const kShutdownMsFile = L"chrome_shutdown_ms.txt";
void RegisterPrefs(PrefService* local_state) {
local_state->RegisterIntegerPref(prefs::kShutdownType, NOT_VALID);
@@ -85,10 +78,11 @@ void OnShutdownStarting(ShutdownType type) {
}
}
-FilePath GetShutdownMsPath() {
- FilePath shutdown_ms_file;
+std::wstring GetShutdownMsPath() {
+ std::wstring shutdown_ms_file;
PathService::Get(base::DIR_TEMP, &shutdown_ms_file);
- return shutdown_ms_file.AppendASCII(kShutdownMsFile);
+ file_util::AppendToPath(&shutdown_ms_file, kShutdownMsFile);
+ return shutdown_ms_file;
}
void Shutdown() {
@@ -158,7 +152,7 @@ void Shutdown() {
TimeDelta shutdown_delta = Time::Now() - shutdown_started_;
std::string shutdown_ms = Int64ToString(shutdown_delta.InMilliseconds());
int len = static_cast<int>(shutdown_ms.length()) + 1;
- FilePath shutdown_ms_file = GetShutdownMsPath();
+ std::wstring shutdown_ms_file = GetShutdownMsPath();
file_util::WriteFile(shutdown_ms_file, shutdown_ms.c_str(), len);
}
@@ -166,12 +160,12 @@ void Shutdown() {
}
void ReadLastShutdownInfo() {
- FilePath shutdown_ms_file = GetShutdownMsPath();
+ std::wstring shutdown_ms_file = GetShutdownMsPath();
std::string shutdown_ms_str;
int64 shutdown_ms = 0;
if (file_util::ReadFileToString(shutdown_ms_file, &shutdown_ms_str))
shutdown_ms = StringToInt64(shutdown_ms_str);
- file_util::Delete(shutdown_ms_file, false);
+ DeleteFile(shutdown_ms_file.c_str());
PrefService* prefs = g_browser_process->local_state();
ShutdownType type =