summaryrefslogtreecommitdiffstats
path: root/chrome/browser/process_singleton.cc
blob: dcda573e404dc2de2a6986ef33cb5c313e28e4e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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();
}