diff options
-rw-r--r-- | base/gfx/jpeg_codec.cc | 4 | ||||
-rw-r--r-- | chrome/VERSION | 4 | ||||
-rw-r--r-- | chrome/app/breakpad_linux.cc | 2 | ||||
-rw-r--r-- | chrome/browser/download/download_file.cc | 2 | ||||
-rw-r--r-- | chrome/browser/download/save_file_manager.cc | 2 | ||||
-rw-r--r-- | chrome/common/platform_util_linux.cc | 6 | ||||
-rw-r--r-- | chrome/common/process_watcher.h | 8 | ||||
-rw-r--r-- | chrome/common/process_watcher_posix.cc | 34 |
8 files changed, 50 insertions, 12 deletions
diff --git a/base/gfx/jpeg_codec.cc b/base/gfx/jpeg_codec.cc index f2e82c2..da0611d 100644 --- a/base/gfx/jpeg_codec.cc +++ b/base/gfx/jpeg_codec.cc @@ -247,13 +247,13 @@ bool JPEGCodec::Encode(const unsigned char* input, ColorFormat format, } // output row after converting - unsigned char* row = new unsigned char[w * 3]; + scoped_array<unsigned char> row_data(new unsigned char[w * 3]); + unsigned char* row = row_data.get(); while (cinfo.next_scanline < cinfo.image_height) { converter(&input[cinfo.next_scanline * row_byte_width], w, row); jpeg_write_scanlines(&cinfo, &row, 1); } - delete[] row; } jpeg_finish_compress(&cinfo); diff --git a/chrome/VERSION b/chrome/VERSION index e2eed41..11582fb 100644 --- a/chrome/VERSION +++ b/chrome/VERSION @@ -1,4 +1,4 @@ -MAJOR=3 +MAJOR=2 MINOR=0 -BUILD=194 +BUILD=100 PATCH=0 diff --git a/chrome/app/breakpad_linux.cc b/chrome/app/breakpad_linux.cc index 6f73d81..d39273d 100644 --- a/chrome/app/breakpad_linux.cc +++ b/chrome/app/breakpad_linux.cc @@ -25,7 +25,7 @@ #include "chrome/installer/util/google_update_settings.h" static const char kUploadURL[] = - "https://clients2.google.com/cr/report"; + "http://crash-staging-collector.corp.google.com:3841/cr/report"; // Writes the value |v| as 16 hex characters to the memory pointed at by // |output|. diff --git a/chrome/browser/download/download_file.cc b/chrome/browser/download/download_file.cc index 6d8b675..79c7bf1 100644 --- a/chrome/browser/download/download_file.cc +++ b/chrome/browser/download/download_file.cc @@ -528,7 +528,9 @@ void DownloadFileManager::OnDownloadUrl(const GURL& url, // TODO(paulg): File 'stat' operations. void DownloadFileManager::OnShowDownloadInShell(const FilePath& full_path) { DCHECK(MessageLoop::current() == file_loop_); + LOG(ERROR) << "AAA"; platform_util::ShowItemInFolder(full_path); + LOG(ERROR) << "AAA2"; } // Launches the selected download using ShellExecute 'open' verb. For windows, diff --git a/chrome/browser/download/save_file_manager.cc b/chrome/browser/download/save_file_manager.cc index 83106a2..6159256 100644 --- a/chrome/browser/download/save_file_manager.cc +++ b/chrome/browser/download/save_file_manager.cc @@ -513,7 +513,9 @@ void SaveFileManager::OnDeleteDirectoryOrFile(const FilePath& full_path, // We run on this thread to avoid blocking the UI with slow Shell operations. void SaveFileManager::OnShowSavedFileInShell(const FilePath full_path) { DCHECK(MessageLoop::current() == GetSaveLoop()); + LOG(ERROR) << "BBB"; platform_util::ShowItemInFolder(full_path); + LOG(ERROR) << "BBB2"; } void SaveFileManager::RenameAllFiles( diff --git a/chrome/common/platform_util_linux.cc b/chrome/common/platform_util_linux.cc index 988de92..b13033c 100644 --- a/chrome/common/platform_util_linux.cc +++ b/chrome/common/platform_util_linux.cc @@ -6,10 +6,10 @@ #include <gtk/gtk.h> -#include "base/file_path.h" #include "base/file_util.h" #include "base/process_util.h" #include "base/string_util.h" +#include "chrome/common/process_watcher.h" namespace { @@ -18,7 +18,9 @@ void XDGOpen(const FilePath& path) { argv.push_back("xdg-open"); argv.push_back(path.value()); base::file_handle_mapping_vector no_files; - base::LaunchApp(argv, no_files, false, NULL); + base::ProcessHandle handle; + if (base::LaunchApp(argv, no_files, false, &handle)) + ProcessWatcher::EnsureProcessGetsReaped(handle); } } // namespace diff --git a/chrome/common/process_watcher.h b/chrome/common/process_watcher.h index 3242984..a1f909c 100644 --- a/chrome/common/process_watcher.h +++ b/chrome/common/process_watcher.h @@ -5,6 +5,8 @@ #ifndef CHROME_COMMON_PROCESS_WATCHER_H_ #define CHROME_COMMON_PROCESS_WATCHER_H_ +#include "build/build_config.h" + #include "base/basictypes.h" #include "base/process_util.h" @@ -25,6 +27,12 @@ class ProcessWatcher { // static void EnsureProcessTerminated(base::ProcessHandle process_handle); +#if defined(OS_POSIX) + // The nicer version of EnsureProcessTerminated() that is patient and will + // wait for |process_handle| to finish and then reap it. + static void EnsureProcessGetsReaped(base::ProcessHandle process_handle); +#endif + private: // Do not instantiate this class. ProcessWatcher(); diff --git a/chrome/common/process_watcher_posix.cc b/chrome/common/process_watcher_posix.cc index f1ae4f4..a583fde 100644 --- a/chrome/common/process_watcher_posix.cc +++ b/chrome/common/process_watcher_posix.cc @@ -30,8 +30,9 @@ static bool IsChildDead(pid_t child) { // If the child doesn't exit within a couple of seconds, kill it. class BackgroundReaper : public PlatformThread::Delegate { public: - explicit BackgroundReaper(pid_t child) - : child_(child) { + explicit BackgroundReaper(pid_t child, unsigned timeout) + : child_(child), + timeout_(timeout) { } void ThreadMain() { @@ -43,8 +44,17 @@ class BackgroundReaper : public PlatformThread::Delegate { // There's no good way to wait for a specific child to exit in a timed // fashion. (No kqueue on Linux), so we just loop and sleep. - // Waits 0.5 * 4 = 2 seconds. - for (unsigned i = 0; i < 4; ++i) { + // Wait forever case. + if (timeout_ == 0) { + while (1) { + PlatformThread::Sleep(5000); // 5 seconds, not in a hurry. + if (IsChildDead(child_)) + return; + } + } + + // Waits 0.5 * timeout_ seconds + for (unsigned i = 0; i < timeout_; ++i) { PlatformThread::Sleep(500); // 0.5 seconds if (IsChildDead(child_)) return; @@ -62,6 +72,9 @@ class BackgroundReaper : public PlatformThread::Delegate { private: const pid_t child_; + // Number of 0.5 seconds intervals to wait, if 0 then wait forever and do + // not attempt to kill |child_|. + const unsigned timeout_; DISALLOW_COPY_AND_ASSIGN(BackgroundReaper); }; @@ -72,6 +85,17 @@ void ProcessWatcher::EnsureProcessTerminated(base::ProcessHandle process) { if (IsChildDead(process)) return; - BackgroundReaper* reaper = new BackgroundReaper(process); + const unsigned timeout = 4; // 4 * 0.5 seconds = 2 seconds + BackgroundReaper* reaper = new BackgroundReaper(process, timeout); + PlatformThread::CreateNonJoinable(0, reaper); +} + +// static +void ProcessWatcher::EnsureProcessGetsReaped(base::ProcessHandle process) { + // If the child is already dead, then there's nothing to do + if (IsChildDead(process)) + return; + + BackgroundReaper* reaper = new BackgroundReaper(process, 0); PlatformThread::CreateNonJoinable(0, reaper); } |