summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarja@chromium.org <marja@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-15 15:44:31 +0000
committermarja@chromium.org <marja@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-15 15:44:31 +0000
commit6aae28d4394aa30785f31530e20c6a259ef39e01 (patch)
treeae25dec3f9bb36b72ba0297e5e108a786ae2c6ea
parentf4c912ad64cf85099fee7b8c94603eb2bb061524 (diff)
downloadchromium_src-6aae28d4394aa30785f31530e20c6a259ef39e01.zip
chromium_src-6aae28d4394aa30785f31530e20c6a259ef39e01.tar.gz
chromium_src-6aae28d4394aa30785f31530e20c6a259ef39e01.tar.bz2
Revert 122079 - Revert 122077 - Revert 122065 - Fix attempt for the double-SessionRestoreImpl problem.
The problem is that BrowserInit::ProcessCommandLineAlreadyRunning gets called too early, before launching the first profile during normal startup. BUG=111238 TEST=NONE Review URL: http://codereview.chromium.org/9365049 TBR=marja@chromium.org Review URL: https://chromiumcodereview.appspot.com/9402007 TBR=marja@chromium.org Review URL: https://chromiumcodereview.appspot.com/9409001 TBR=marja@chromium.org Review URL: https://chromiumcodereview.appspot.com/9403015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@122088 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/chrome_browser_main.cc5
-rw-r--r--chrome/browser/first_run/try_chrome_dialog_view.cc10
-rw-r--r--chrome/browser/process_singleton.h6
-rw-r--r--chrome/browser/process_singleton_win.cc2
4 files changed, 5 insertions, 18 deletions
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc
index 0667508..14c3e6e 100644
--- a/chrome/browser/chrome_browser_main.cc
+++ b/chrome/browser/chrome_browser_main.cc
@@ -1141,9 +1141,6 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() {
#endif
process_singleton_.reset(new ProcessSingleton(user_data_dir_));
- // Ensure ProcessSingleton won't process messages too early. It will be
- // unlocked in PostBrowserStart().
- process_singleton_->Lock(NULL);
is_first_run_ = first_run::IsChromeFirstRun() ||
parsed_command_line().HasSwitch(switches::kFirstRun);
@@ -1375,8 +1372,6 @@ void ChromeBrowserMainParts::PreBrowserStart() {
void ChromeBrowserMainParts::PostBrowserStart() {
for (size_t i = 0; i < chrome_extra_parts_.size(); ++i)
chrome_extra_parts_[i]->PostBrowserStart();
- // Allow ProcessSingleton to process messages.
- process_singleton_->Unlock();
}
int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
diff --git a/chrome/browser/first_run/try_chrome_dialog_view.cc b/chrome/browser/first_run/try_chrome_dialog_view.cc
index 71135a7..f1da73d 100644
--- a/chrome/browser/first_run/try_chrome_dialog_view.cc
+++ b/chrome/browser/first_run/try_chrome_dialog_view.cc
@@ -227,14 +227,12 @@ TryChromeDialogView::Result TryChromeDialogView::ShowModal(
SetToastRegion(popup_->GetNativeView(),
preferred.width(), preferred.height());
- // Time to show the window in a modal loop. The ProcessSingleton should
- // already be locked and it will not process WM_COPYDATA requests. Change the
- // window to bring to foreground if a request arrives.
- CHECK(process_singleton->locked());
- process_singleton->SetForegroundWindow(popup_->GetNativeView());
+ // Time to show the window in a modal loop. We don't want this chrome
+ // instance trying to serve WM_COPYDATA requests, as we'll surely crash.
+ process_singleton->Lock(popup_->GetNativeView());
popup_->Show();
MessageLoop::current()->Run();
- process_singleton->SetForegroundWindow(NULL);
+ process_singleton->Unlock();
return result_;
}
diff --git a/chrome/browser/process_singleton.h b/chrome/browser/process_singleton.h
index 34d3dbd..a3b6ca1 100644
--- a/chrome/browser/process_singleton.h
+++ b/chrome/browser/process_singleton.h
@@ -106,12 +106,6 @@ class ProcessSingleton : public base::NonThreadSafe {
foreground_window_ = foreground_window;
}
- // Changes the foreground window without changing the locked state.
- void SetForegroundWindow(gfx::NativeWindow foreground_window) {
- DCHECK(CalledOnValidThread());
- foreground_window_ = foreground_window;
- }
-
// Allows the dispatch of CopyData messages.
void Unlock() {
DCHECK(CalledOnValidThread());
diff --git a/chrome/browser/process_singleton_win.cc b/chrome/browser/process_singleton_win.cc
index 4272c2c..4d20415 100644
--- a/chrome/browser/process_singleton_win.cc
+++ b/chrome/browser/process_singleton_win.cc
@@ -268,7 +268,7 @@ LRESULT ProcessSingleton::OnCopyData(HWND hwnd, const COPYDATASTRUCT* cds) {
NOTIMPLEMENTED();
#else
// Attempt to place ourselves in the foreground / flash the task bar.
- if (foreground_window_ != NULL && IsWindow(foreground_window_))
+ if (IsWindow(foreground_window_))
SetForegroundWindow(foreground_window_);
#endif
return TRUE;