summaryrefslogtreecommitdiffstats
path: root/chrome/browser/process_singleton.cc
diff options
context:
space:
mode:
authormarja@chromium.org <marja@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-23 09:47:43 +0000
committermarja@chromium.org <marja@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-23 09:47:43 +0000
commitedf04b511b79370896d726a099db2bcb9a0e676d (patch)
tree40eb8f87e9284c8900078e91896589e956a5f5dc /chrome/browser/process_singleton.cc
parentb22906a28fe3311bd2f60985d8050b0db6dbc557 (diff)
downloadchromium_src-edf04b511b79370896d726a099db2bcb9a0e676d.zip
chromium_src-edf04b511b79370896d726a099db2bcb9a0e676d.tar.gz
chromium_src-edf04b511b79370896d726a099db2bcb9a0e676d.tar.bz2
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 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=122065 Review URL: https://chromiumcodereview.appspot.com/9365049 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@123209 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/process_singleton.cc')
-rw-r--r--chrome/browser/process_singleton.cc24
1 files changed, 24 insertions, 0 deletions
diff --git a/chrome/browser/process_singleton.cc b/chrome/browser/process_singleton.cc
new file mode 100644
index 0000000..dcda573
--- /dev/null
+++ b/chrome/browser/process_singleton.cc
@@ -0,0 +1,24 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/process_singleton.h"
+
+void ProcessSingleton::Unlock() {
+ DCHECK(CalledOnValidThread());
+ locked_ = false;
+ foreground_window_ = NULL;
+ // Replay the command lines of the messages which were received while the
+ // ProcessSingleton was locked. Only replay each message once.
+ std::set<DelayedStartupMessage> replayed_messages;
+ for (std::vector<DelayedStartupMessage>::const_iterator it =
+ saved_startup_messages_.begin();
+ it != saved_startup_messages_.end(); ++it) {
+ if (replayed_messages.find(*it) !=
+ replayed_messages.end())
+ continue;
+ ProcessCommandLine(CommandLine(it->first), it->second);
+ replayed_messages.insert(*it);
+ }
+ saved_startup_messages_.clear();
+}