<commit_before>// Copyright (c) 2011 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.

// When each service is created, we set a flag indicating this. At this point,
// the service initialization could fail or succeed. This allows us to remember
// if we tried to create a service, and not try creating it over and over if
// the creation failed.

#ifndef CHROME_BROWSER_BROWSER_PROCESS_IMPL_H_
#define CHROME_BROWSER_BROWSER_PROCESS_IMPL_H_
#pragma once

#include <string>

#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "base/message_loop.h"
#include "base/threading/non_thread_safe.h"
#include "base/timer.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/download/download_status_updater.h"
#include "chrome/browser/prefs/pref_change_registrar.h"
#include "chrome/browser/prefs/pref_member.h"
#include "chrome/browser/tab_contents/thumbnail_generator.h"
#include "content/common/notification_observer.h"
#include "content/common/notification_registrar.h"
#include "ipc/ipc_message.h"

class ChromeNetLog;
class ChromeResourceDispatcherHostDelegate;
class CommandLine;
class DevToolsHttpProtocolHandler;
class DevToolsProtocolHandler;
class FilePath;
class NotificationService;
class PluginDataRemover;
class TabCloseableStateWatcher;

namespace policy{
class BrowserPolicyConnector;
};

// Real implementation of BrowserProcess that creates and returns the services.
class BrowserProcessImpl : public BrowserProcess,
                           public base::NonThreadSafe,
                           public NotificationObserver {
 public:
  explicit BrowserProcessImpl(const CommandLine& command_line);
  virtual ~BrowserProcessImpl();

  virtual void EndSession();

  // BrowserProcess methods
  virtual ResourceDispatcherHost* resource_dispatcher_host();
  virtual MetricsService* metrics_service();
  virtual IOThread* io_thread();
  virtual base::Thread* file_thread();
  virtual base::Thread* db_thread();
  virtual base::Thread* process_launcher_thread();
  virtual base::Thread* cache_thread();
  virtual WatchDogThread* watchdog_thread();
#if defined(OS_CHROMEOS)
  virtual base::Thread* web_socket_proxy_thread();
#endif
  virtual ProfileManager* profile_manager();
  virtual PrefService* local_state();
  virtual DevToolsManager* devtools_manager();
  virtual SidebarManager* sidebar_manager();
  virtual ui::Clipboard* clipboard();
  virtual net::URLRequestContextGetter* system_request_context();
#if defined(OS_CHROMEOS)
  virtual chromeos::ProxyConfigServiceImpl*
      chromeos_proxy_config_service_impl();
#endif  // defined(OS_CHROMEOS)
  virtual ExtensionEventRouterForwarder* extension_event_router_forwarder();
  virtual NotificationUIManager* notification_ui_manager();
  virtual policy::BrowserPolicyConnector* browser_policy_connector();
  virtual IconManager* icon_manager();
  virtual ThumbnailGenerator* GetThumbnailGenerator();
  virtual AutomationProviderList* InitAutomationProviderList();
  virtual void InitDevToolsHttpProtocolHandler(
      const std::string& ip,
      int port,
      const std::string& frontend_url);
  virtual void InitDevToolsLegacyProtocolHandler(int port);
  virtual unsigned int AddRefModule();
  virtual unsigned int ReleaseModule();
  virtual bool IsShuttingDown();
  virtual printing::PrintJobManager* print_job_manager();
  virtual printing::PrintPreviewTabController* print_preview_tab_controller();
  virtual printing::BackgroundPrintingManager* background_printing_manager();
  virtual GoogleURLTracker* google_url_tracker();
  virtual IntranetRedirectDetector* intranet_redirect_detector();
  virtual const std::string& GetApplicationLocale();
  virtual void SetApplicationLocale(const std::string& locale);
  virtual DownloadStatusUpdater* download_status_updater();
  virtual TabCloseableStateWatcher* tab_closeable_state_watcher();
  virtual BackgroundModeManager* background_mode_manager();
  virtual StatusTray* status_tray();
  virtual SafeBrowsingService* safe_browsing_service();
  virtual safe_browsing::ClientSideDetectionService*
      safe_browsing_detection_service();
  virtual bool plugin_finder_disabled() const;

  // NotificationObserver methods
  virtual void Observe(int type,
                       const NotificationSource& source,
                       const NotificationDetails& details);

#if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS)
  virtual void StartAutoupdateTimer();
#endif

  virtual ChromeNetLog* net_log();

  virtual prerender::PrerenderTracker* prerender_tracker();

#if defined(IPC_MESSAGE_LOG_ENABLED)
  virtual void SetIPCLoggingEnabled(bool enable);
#endif

  virtual MHTMLGenerationManager* mhtml_generation_manager();

 private:
  void CreateResourceDispatcherHost();
  void CreateMetricsService();

  void CreateIOThread();
  static void CleanupOnIOThread();

  void WaitForPluginDataRemoverToFinish();

  void CreateFileThread();
  void CreateDBThread();
  void CreateProcessLauncherThread();
  void CreateCacheThread();
  void CreateGpuThread();
  void CreateWatchdogThread();
#if defined(OS_CHROMEOS)
  void CreateWebSocketProxyThread();
#endif
  void CreateTemplateURLService();<commit_msg>Removing a leftover function definition (see http://codereview.chromium.org/7230052 for the removal of the function code).<commit_after>// Copyright (c) 2011 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.

// When each service is created, we set a flag indicating this. At this point,
// the service initialization could fail or succeed. This allows us to remember
// if we tried to create a service, and not try creating it over and over if
// the creation failed.

#ifndef CHROME_BROWSER_BROWSER_PROCESS_IMPL_H_
#define CHROME_BROWSER_BROWSER_PROCESS_IMPL_H_
#pragma once

#include <string>

#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "base/message_loop.h"
#include "base/threading/non_thread_safe.h"
#include "base/timer.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/download/download_status_updater.h"
#include "chrome/browser/prefs/pref_change_registrar.h"
#include "chrome/browser/prefs/pref_member.h"
#include "chrome/browser/tab_contents/thumbnail_generator.h"
#include "content/common/notification_observer.h"
#include "content/common/notification_registrar.h"
#include "ipc/ipc_message.h"

class ChromeNetLog;
class ChromeResourceDispatcherHostDelegate;
class CommandLine;
class DevToolsHttpProtocolHandler;
class DevToolsProtocolHandler;
class FilePath;
class NotificationService;
class PluginDataRemover;
class TabCloseableStateWatcher;

namespace policy{
class BrowserPolicyConnector;
};

// Real implementation of BrowserProcess that creates and returns the services.
class BrowserProcessImpl : public BrowserProcess,
                           public base::NonThreadSafe,
                           public NotificationObserver {
 public:
  explicit BrowserProcessImpl(const CommandLine& command_line);
  virtual ~BrowserProcessImpl();

  virtual void EndSession();

  // BrowserProcess methods
  virtual ResourceDispatcherHost* resource_dispatcher_host();
  virtual MetricsService* metrics_service();
  virtual IOThread* io_thread();
  virtual base::Thread* file_thread();
  virtual base::Thread* db_thread();
  virtual base::Thread* process_launcher_thread();
  virtual base::Thread* cache_thread();
  virtual WatchDogThread* watchdog_thread();
#if defined(OS_CHROMEOS)
  virtual base::Thread* web_socket_proxy_thread();
#endif
  virtual ProfileManager* profile_manager();
  virtual PrefService* local_state();
  virtual DevToolsManager* devtools_manager();
  virtual SidebarManager* sidebar_manager();
  virtual ui::Clipboard* clipboard();
  virtual net::URLRequestContextGetter* system_request_context();
#if defined(OS_CHROMEOS)
  virtual chromeos::ProxyConfigServiceImpl*
      chromeos_proxy_config_service_impl();
#endif  // defined(OS_CHROMEOS)
  virtual ExtensionEventRouterForwarder* extension_event_router_forwarder();
  virtual NotificationUIManager* notification_ui_manager();
  virtual policy::BrowserPolicyConnector* browser_policy_connector();
  virtual IconManager* icon_manager();
  virtual ThumbnailGenerator* GetThumbnailGenerator();
  virtual AutomationProviderList* InitAutomationProviderList();
  virtual void InitDevToolsHttpProtocolHandler(
      const std::string& ip,
      int port,
      const std::string& frontend_url);
  virtual void InitDevToolsLegacyProtocolHandler(int port);
  virtual unsigned int AddRefModule();
  virtual unsigned int ReleaseModule();
  virtual bool IsShuttingDown();
  virtual printing::PrintJobManager* print_job_manager();
  virtual printing::PrintPreviewTabController* print_preview_tab_controller();
  virtual printing::BackgroundPrintingManager* background_printing_manager();
  virtual GoogleURLTracker* google_url_tracker();
  virtual IntranetRedirectDetector* intranet_redirect_detector();
  virtual const std::string& GetApplicationLocale();
  virtual void SetApplicationLocale(const std::string& locale);
  virtual DownloadStatusUpdater* download_status_updater();
  virtual TabCloseableStateWatcher* tab_closeable_state_watcher();
  virtual BackgroundModeManager* background_mode_manager();
  virtual StatusTray* status_tray();
  virtual SafeBrowsingService* safe_browsing_service();
  virtual safe_browsing::ClientSideDetectionService*
      safe_browsing_detection_service();
  virtual bool plugin_finder_disabled() const;

  // NotificationObserver methods
  virtual void Observe(int type,
                       const NotificationSource& source,
                       const NotificationDetails& details);

#if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS)
  virtual void StartAutoupdateTimer();
#endif

  virtual ChromeNetLog* net_log();

  virtual prerender::PrerenderTracker* prerender_tracker();

#if defined(IPC_MESSAGE_LOG_ENABLED)
  virtual void SetIPCLoggingEnabled(bool enable);
#endif

  virtual MHTMLGenerationManager* mhtml_generation_manager();

 private:
  void CreateResourceDispatcherHost();
  void CreateMetricsService();

  void CreateIOThread();
  static void CleanupOnIOThread();

  void CreateFileThread();
  void CreateDBThread();
  void CreateProcessLauncherThread();
  void CreateCacheThread();
  void CreateGpuThread();
  void CreateWatchdogThread();
#if defined(OS_CHROMEOS)
  void CreateWebSocketProxyThread();
#endif
  void CreateTemplateURLService();
{'fraction_non_alphanumeric': 0.0851625058878945, 'fraction_numerical': 0.001413094677343382, 'mean_word_length': 6.12961719274681, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2476026', 'n_tokens_mistral': 2986, 'n_tokens_neox': 2888, 'n_words': 754}