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

Unified 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: Rename test suite. 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chrome_process_singleton.cc
diff --git a/chrome/browser/chrome_process_singleton.cc b/chrome/browser/chrome_process_singleton.cc
new file mode 100644
index 0000000000000000000000000000000000000000..a6824578df89f69f56a14a980c0d41746717f6af
--- /dev/null
+++ b/chrome/browser/chrome_process_singleton.cc
@@ -0,0 +1,48 @@
+// Copyright (c) 2013 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/chrome_process_singleton.h"
+
+ChromeProcessSingleton::ChromeProcessSingleton(
+ const base::FilePath& user_data_dir,
+ const ProcessSingleton::NotificationCallback& notification_callback)
+ : startup_lock_(notification_callback),
+ modal_dialog_lock_(startup_lock_.AsNotificationCallback()),
+ process_singleton_(user_data_dir,
+ modal_dialog_lock_.AsNotificationCallback()) {
+}
+
+
+ChromeProcessSingleton::ChromeProcessSingleton(
+ const base::FilePath& user_data_dir,
+ const ProcessSingleton::NotificationCallback& notification_callback,
+ const ProcessSingletonModalDialogLock::SetForegroundWindowHandler&
+ set_foreground_window_handler)
+ : startup_lock_(notification_callback),
+ modal_dialog_lock_(startup_lock_.AsNotificationCallback(),
+ set_foreground_window_handler),
+ process_singleton_(user_data_dir,
+ modal_dialog_lock_.AsNotificationCallback()) {
+}
+
+ChromeProcessSingleton::~ChromeProcessSingleton() {
+}
+
+ProcessSingleton::NotifyResult
+ ChromeProcessSingleton::NotifyOtherProcessOrCreate() {
+ return process_singleton_.NotifyOtherProcessOrCreate();
+}
+
+void ChromeProcessSingleton::Cleanup() {
+ process_singleton_.Cleanup();
+}
+
+void ChromeProcessSingleton::SetActiveModalDialog(
+ gfx::NativeWindow active_dialog) {
+ modal_dialog_lock_.SetActiveModalDialog(active_dialog);
+}
+
+void ChromeProcessSingleton::Unlock() {
+ startup_lock_.Unlock();
+}

Powered by Google App Engine
This is Rietveld 408576698