default_session_.Reset(isolate(), handle.ToV8());
if (process_singleton_.get()) {
- process_singleton_->Unlock();
+ process_singleton_startup_lock_->Unlock();
}
Emit("ready");
if (!process_singleton_.get()) {
auto browser = Browser::Get();
- process_singleton_.reset(new AtomProcessSingleton(userDir, callback));
+ process_singleton_startup_lock_.reset(
+ new ProcessSingletonStartupLock(callback));
+
+ process_singleton_.reset(
+ new ProcessSingleton(
+ userDir,
+ process_singleton_startup_lock_->AsNotificationCallback()));
if (browser->is_ready()) {
- process_singleton_->Unlock();
+ process_singleton_startup_lock_->Unlock();
}
process_notify_result_ = process_singleton_->NotifyOtherProcessOrCreate();
#include <string>
#include "atom/browser/api/event_emitter.h"
-#include "atom/browser/atom_process_singleton.h"
#include "atom/browser/browser_observer.h"
#include "atom/common/native_mate_converters/callback.h"
#include "chrome/browser/process_singleton.h"
+#include "chrome/browser/process_singleton_startup_lock.h"
#include "content/public/browser/gpu_data_manager_observer.h"
#include "native_mate/handle.h"
v8::Global<v8::Value> default_session_;
- scoped_ptr<AtomProcessSingleton> process_singleton_;
+ scoped_ptr<ProcessSingleton> process_singleton_;
+ scoped_ptr<ProcessSingletonStartupLock> process_singleton_startup_lock_;
ProcessSingleton::NotifyResult process_notify_result_;
DISALLOW_COPY_AND_ASSIGN(App);
+++ /dev/null
-// 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 "atom/browser/atom_process_singleton.h"
-
-AtomProcessSingleton::AtomProcessSingleton(
- const base::FilePath& user_data_dir,
- const ProcessSingleton::NotificationCallback& notification_callback)
- : startup_lock_(notification_callback),
- process_singleton_(user_data_dir,
- startup_lock_.AsNotificationCallback()) {
-}
-
-AtomProcessSingleton::~AtomProcessSingleton() {
-}
-
-ProcessSingleton::NotifyResult
- AtomProcessSingleton::NotifyOtherProcessOrCreate() {
- return process_singleton_.NotifyOtherProcessOrCreate();
-}
-
-void AtomProcessSingleton::Cleanup() {
- process_singleton_.Cleanup();
-}
-
-void AtomProcessSingleton::Unlock() {
- startup_lock_.Unlock();
-}
+++ /dev/null
-// 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.
-
-#ifndef ATOM_BROWSER_ATOM_PROCESS_SINGLETON_H_
-#define ATOM_BROWSER_ATOM_PROCESS_SINGLETON_H_
-
-#include "base/basictypes.h"
-#include "base/files/file_path.h"
-#include "chrome/browser/process_singleton.h"
-#include "chrome/browser/process_singleton_startup_lock.h"
-
-// Composes a basic ProcessSingleton with ProcessSingletonStartupLock
-class AtomProcessSingleton {
- public:
- AtomProcessSingleton(
- const base::FilePath& user_data_dir,
- const ProcessSingleton::NotificationCallback& notification_callback);
-
- ~AtomProcessSingleton();
-
- // Notify another process, if available. Otherwise sets ourselves as the
- // singleton instance. Returns PROCESS_NONE if we became the singleton
- // instance. Callers are guaranteed to either have notified an existing
- // process or have grabbed the singleton (unless the profile is locked by an
- // unreachable process).
- ProcessSingleton::NotifyResult NotifyOtherProcessOrCreate();
-
- // Clear any lock state during shutdown.
- void Cleanup();
-
- // Executes previously queued command-line invocations and allows future
- // invocations to be executed immediately.
- // This only has an effect the first time it is called.
- void Unlock();
-
- private:
- // We compose these two locks with the client-supplied notification callback.
- // First |modal_dialog_lock_| will discard any notifications that arrive while
- // a modal dialog is active. Otherwise, it will pass the notification to
- // |startup_lock_|, which will queue notifications until |Unlock()| is called.
- // Notifications passing through both locks are finally delivered to our
- // client.
- ProcessSingletonStartupLock startup_lock_;
-
- // The basic ProcessSingleton
- ProcessSingleton process_singleton_;
-
- DISALLOW_COPY_AND_ASSIGN(AtomProcessSingleton);
-};
-
-#endif // ATOM_BROWSER_ATOM_PROCESS_SINGLETON_H_
'atom/browser/atom_browser_main_parts_posix.cc',
'atom/browser/atom_javascript_dialog_manager.cc',
'atom/browser/atom_javascript_dialog_manager.h',
- 'atom/browser/atom_process_singleton.cc',
'atom/browser/atom_quota_permission_context.cc',
'atom/browser/atom_quota_permission_context.h',
'atom/browser/atom_resource_dispatcher_host_delegate.cc',