| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/process_singleton.h" | 5 #include "chrome/browser/process_singleton.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 #include <shellapi.h> | 8 #include <shellapi.h> |
| 9 #include <stddef.h> | 9 #include <stddef.h> |
| 10 | 10 |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 const NotificationCallback& notification_callback) | 262 const NotificationCallback& notification_callback) |
| 263 : notification_callback_(notification_callback), | 263 : notification_callback_(notification_callback), |
| 264 is_virtualized_(false), | 264 is_virtualized_(false), |
| 265 lock_file_(INVALID_HANDLE_VALUE), | 265 lock_file_(INVALID_HANDLE_VALUE), |
| 266 user_data_dir_(user_data_dir), | 266 user_data_dir_(user_data_dir), |
| 267 should_kill_remote_process_callback_( | 267 should_kill_remote_process_callback_( |
| 268 base::Bind(&DisplayShouldKillMessageBox)) { | 268 base::Bind(&DisplayShouldKillMessageBox)) { |
| 269 } | 269 } |
| 270 | 270 |
| 271 ProcessSingleton::~ProcessSingleton() { | 271 ProcessSingleton::~ProcessSingleton() { |
| 272 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); |
| 272 if (lock_file_ != INVALID_HANDLE_VALUE) | 273 if (lock_file_ != INVALID_HANDLE_VALUE) |
| 273 ::CloseHandle(lock_file_); | 274 ::CloseHandle(lock_file_); |
| 274 } | 275 } |
| 275 | 276 |
| 276 // Code roughly based on Mozilla. | 277 // Code roughly based on Mozilla. |
| 277 ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcess() { | 278 ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcess() { |
| 278 if (is_virtualized_) | 279 if (is_virtualized_) |
| 279 return PROCESS_NOTIFIED; // We already spawned the process in this case. | 280 return PROCESS_NOTIFIED; // We already spawned the process in this case. |
| 280 if (lock_file_ == INVALID_HANDLE_VALUE && !remote_window_) { | 281 if (lock_file_ == INVALID_HANDLE_VALUE && !remote_window_) { |
| 281 return LOCK_ERROR; | 282 return LOCK_ERROR; |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 return window_.hwnd() != NULL; | 423 return window_.hwnd() != NULL; |
| 423 } | 424 } |
| 424 | 425 |
| 425 void ProcessSingleton::Cleanup() { | 426 void ProcessSingleton::Cleanup() { |
| 426 } | 427 } |
| 427 | 428 |
| 428 void ProcessSingleton::OverrideShouldKillRemoteProcessCallbackForTesting( | 429 void ProcessSingleton::OverrideShouldKillRemoteProcessCallbackForTesting( |
| 429 const ShouldKillRemoteProcessCallback& display_dialog_callback) { | 430 const ShouldKillRemoteProcessCallback& display_dialog_callback) { |
| 430 should_kill_remote_process_callback_ = display_dialog_callback; | 431 should_kill_remote_process_callback_ = display_dialog_callback; |
| 431 } | 432 } |
| OLD | NEW |