| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/service/service_process.h" | 5 #include "chrome/service/service_process.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "base/environment.h" | 11 #include "base/environment.h" |
| 12 #include "base/i18n/rtl.h" | 12 #include "base/i18n/rtl.h" |
| 13 #include "base/memory/singleton.h" | 13 #include "base/memory/singleton.h" |
| 14 #include "base/path_service.h" | 14 #include "base/path_service.h" |
| 15 #include "base/string16.h" | 15 #include "base/string16.h" |
| 16 #include "base/utf_string_conversions.h" | 16 #include "base/utf_string_conversions.h" |
| 17 #include "base/values.h" | 17 #include "base/values.h" |
| 18 #include "chrome/common/chrome_constants.h" | 18 #include "chrome/common/chrome_constants.h" |
| 19 #include "chrome/common/chrome_paths.h" | 19 #include "chrome/common/chrome_paths.h" |
| 20 #include "chrome/common/chrome_switches.h" | 20 #include "chrome/common/chrome_switches.h" |
| 21 #include "chrome/common/env_vars.h" | 21 #include "chrome/common/env_vars.h" |
| 22 #include "chrome/common/pref_names.h" | 22 #include "chrome/common/pref_names.h" |
| 23 #include "chrome/common/service_process_util.h" | 23 #include "chrome/common/service_process_util.h" |
| 24 #include "chrome/service/cloud_print/cloud_print_proxy.h" | 24 #include "chrome/service/cloud_print/cloud_print_proxy.h" |
| 25 #include "chrome/service/net/service_url_request_context.h" | 25 #include "chrome/service/net/service_url_request_context.h" |
| 26 #include "chrome/service/service_ipc_server.h" | 26 #include "chrome/service/service_ipc_server.h" |
| 27 #include "chrome/service/service_process_prefs.h" | 27 #include "chrome/service/service_process_prefs.h" |
| 28 #include "content/common/net/url_fetcher.h" | 28 #include "content/public/common/url_fetcher.h" |
| 29 #include "grit/chromium_strings.h" | 29 #include "grit/chromium_strings.h" |
| 30 #include "grit/generated_resources.h" | 30 #include "grit/generated_resources.h" |
| 31 #include "net/base/network_change_notifier.h" | 31 #include "net/base/network_change_notifier.h" |
| 32 #include "ui/base/l10n/l10n_util.h" | 32 #include "ui/base/l10n/l10n_util.h" |
| 33 #include "ui/base/resource/resource_bundle.h" | 33 #include "ui/base/resource/resource_bundle.h" |
| 34 #include "ui/base/ui_base_switches.h" | 34 #include "ui/base/ui_base_switches.h" |
| 35 | 35 |
| 36 #if defined(TOOLKIT_USES_GTK) | 36 #if defined(TOOLKIT_USES_GTK) |
| 37 #include "ui/gfx/gtk_util.h" | 37 #include "ui/gfx/gtk_util.h" |
| 38 #include <gtk/gtk.h> | 38 #include <gtk/gtk.h> |
| (...skipping 22 matching lines...) Expand all Loading... |
| 61 }; | 61 }; |
| 62 | 62 |
| 63 ServiceIOThread::ServiceIOThread(const char* name) : base::Thread(name) {} | 63 ServiceIOThread::ServiceIOThread(const char* name) : base::Thread(name) {} |
| 64 ServiceIOThread::~ServiceIOThread() { | 64 ServiceIOThread::~ServiceIOThread() { |
| 65 // We cannot rely on our base class to stop the thread since we want our | 65 // We cannot rely on our base class to stop the thread since we want our |
| 66 // CleanUp function to run. | 66 // CleanUp function to run. |
| 67 Stop(); | 67 Stop(); |
| 68 } | 68 } |
| 69 | 69 |
| 70 void ServiceIOThread::CleanUp() { | 70 void ServiceIOThread::CleanUp() { |
| 71 URLFetcher::CancelAll(); | 71 content::URLFetcher::CancelAll(); |
| 72 } | 72 } |
| 73 | 73 |
| 74 // Prepares the localized strings that are going to be displayed to | 74 // Prepares the localized strings that are going to be displayed to |
| 75 // the user if the service process dies. These strings are stored in the | 75 // the user if the service process dies. These strings are stored in the |
| 76 // environment block so they are accessible in the early stages of the | 76 // environment block so they are accessible in the early stages of the |
| 77 // chrome executable's lifetime. | 77 // chrome executable's lifetime. |
| 78 void PrepareRestartOnCrashEnviroment( | 78 void PrepareRestartOnCrashEnviroment( |
| 79 const CommandLine &parsed_command_line) { | 79 const CommandLine &parsed_command_line) { |
| 80 scoped_ptr<base::Environment> env(base::Environment::Create()); | 80 scoped_ptr<base::Environment> env(base::Environment::Create()); |
| 81 // Clear this var so child processes don't show the dialog by default. | 81 // Clear this var so child processes don't show the dialog by default. |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 } else { | 362 } else { |
| 363 Shutdown(); | 363 Shutdown(); |
| 364 } | 364 } |
| 365 } | 365 } |
| 366 } | 366 } |
| 367 | 367 |
| 368 ServiceProcess::~ServiceProcess() { | 368 ServiceProcess::~ServiceProcess() { |
| 369 Teardown(); | 369 Teardown(); |
| 370 g_service_process = NULL; | 370 g_service_process = NULL; |
| 371 } | 371 } |
| OLD | NEW |