Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(353)

Side by Side Diff: chrome/browser/chrome_process_singleton.cc

Issue 12096114: Extract locking behaviour from ProcessSingleton. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Restrict chrome_process_singleton_unittest to WIN for now. Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/chrome_process_singleton.h"
6
7 ChromeProcessSingleton::ChromeProcessSingleton(
8 const base::FilePath& user_data_dir,
9 const ProcessSingleton::NotificationCallback& notification_callback)
10 : startup_lock_(notification_callback),
11 modal_dialog_lock_(startup_lock_.AsNotificationCallback()),
12 process_singleton_(user_data_dir,
13 modal_dialog_lock_.AsNotificationCallback()) {
14 }
15
16
17 ChromeProcessSingleton::ChromeProcessSingleton(
18 const base::FilePath& user_data_dir,
19 const ProcessSingleton::NotificationCallback& notification_callback,
20 const ProcessSingletonModalDialogLock::SetForegroundWindowHandler&
21 set_foreground_window_handler)
22 : startup_lock_(notification_callback),
23 modal_dialog_lock_(startup_lock_.AsNotificationCallback(),
24 set_foreground_window_handler),
25 process_singleton_(user_data_dir,
26 modal_dialog_lock_.AsNotificationCallback()) {
27 }
28
29 ChromeProcessSingleton::~ChromeProcessSingleton() {
30 }
31
32 ProcessSingleton::NotifyResult
33 ChromeProcessSingleton::NotifyOtherProcessOrCreate() {
34 return process_singleton_.NotifyOtherProcessOrCreate();
35 }
36
37 void ChromeProcessSingleton::Cleanup() {
38 process_singleton_.Cleanup();
39 }
40
41 void ChromeProcessSingleton::SetActiveModalDialog(
42 gfx::NativeWindow active_dialog) {
43 modal_dialog_lock_.SetActiveModalDialog(active_dialog);
44 }
45
46 void ChromeProcessSingleton::Unlock() {
47 startup_lock_.Unlock();
48 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698