Skip to content

Commit

Permalink
Make storage_monitor a component
Browse files Browse the repository at this point in the history
Move storage_monitor to the components directory and:

- Make the unit tests part of the components unit tests.
- Update the include headers for both chrome and storage_monitor code.
- Update the buildsystem dependencies and paths.
- Update the DEPS files for both chrome and storage_monitor with the new
restrictions.

[email protected],[email protected]
BUG=

Review URL: https://codereview.chromium.org/152343005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@251699 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
[email protected] committed Feb 17, 2014
1 parent 3eb2011 commit e4c5f97
Show file tree
Hide file tree
Showing 118 changed files with 587 additions and 551 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ Taylor Price <[email protected]>
Ted Vessenes <[email protected]>
Teodora Novkovic <[email protected]>
Thiago Farina <[email protected]>
Thiago Marcos P. Santos <[email protected]>
Tiago Vignatti <[email protected]>
Tim Ansell <[email protected]>
Timo Reimann <[email protected]>
Expand Down
1 change: 1 addition & 0 deletions chrome/browser/DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ include_rules = [
"+components/sessions",
"+components/signin",
"+components/startup_metric_utils",
"+components/storage_monitor",
"+components/translate/content/browser",
"+components/translate/core/browser",
"+components/translate/core/common",
Expand Down
3 changes: 0 additions & 3 deletions chrome/browser/browser_process.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ class Profile;
class ProfileManager;
class SafeBrowsingService;
class StatusTray;
class StorageMonitor;
class WatchDogThread;
#if defined(ENABLE_WEBRTC)
class WebRtcLogUploader;
Expand Down Expand Up @@ -216,8 +215,6 @@ class BrowserProcess {

virtual MediaFileSystemRegistry* media_file_system_registry() = 0;

virtual StorageMonitor* storage_monitor() = 0;

virtual bool created_local_state() const = 0;

#if defined(ENABLE_WEBRTC)
Expand Down
27 changes: 6 additions & 21 deletions chrome/browser/browser_process_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
#include "chrome/browser/safe_browsing/safe_browsing_service.h"
#include "chrome/browser/shell_integration.h"
#include "chrome/browser/status_icons/status_tray.h"
#include "chrome/browser/storage_monitor/storage_monitor.h"
#include "chrome/browser/ui/bookmarks/bookmark_prompt_controller.h"
#include "chrome/browser/ui/browser_dialogs.h"
#include "chrome/browser/ui/browser_finder.h"
Expand Down Expand Up @@ -112,6 +111,7 @@

#if !defined(OS_ANDROID) && !defined(OS_IOS)
#include "chrome/browser/media_galleries/media_file_system_registry.h"
#include "components/storage_monitor/storage_monitor.h"
#endif

#if defined(ENABLE_PLUGIN_INSTALLATION)
Expand Down Expand Up @@ -263,11 +263,11 @@ void BrowserProcessImpl::StartTearDown() {

#if !defined(OS_ANDROID) && !defined(OS_IOS)
media_file_system_registry_.reset();
// Delete |storage_monitor_| now. Otherwise the FILE thread would be gone
// when we try to release it in the dtor and Valgrind would report a
// leak on almost every single browser_test.
// Remove the global instance of the Storage Monitor now. Otherwise the
// FILE thread would be gone when we try to release it in the dtor and
// Valgrind would report a leak on almost every single browser_test.
// TODO(gbillock): Make this unnecessary.
storage_monitor_.reset();
StorageMonitor::Destroy();
#endif

message_center::MessageCenter::Shutdown();
Expand Down Expand Up @@ -644,21 +644,6 @@ BookmarkPromptController* BrowserProcessImpl::bookmark_prompt_controller() {
#endif
}

StorageMonitor* BrowserProcessImpl::storage_monitor() {
#if defined(OS_ANDROID) || defined(OS_IOS)
return NULL;
#else
return storage_monitor_.get();
#endif
}

void BrowserProcessImpl::set_storage_monitor_for_test(
scoped_ptr<StorageMonitor> monitor) {
#if !defined(OS_ANDROID) && !defined(OS_IOS)
storage_monitor_ = monitor.Pass();
#endif
}

MediaFileSystemRegistry* BrowserProcessImpl::media_file_system_registry() {
#if defined(OS_ANDROID) || defined(OS_IOS)
return NULL;
Expand Down Expand Up @@ -970,7 +955,7 @@ void BrowserProcessImpl::PreMainMessageLoopRun() {
#endif

#if !defined(OS_ANDROID) && !defined(OS_IOS)
storage_monitor_.reset(StorageMonitor::Create());
StorageMonitor::Create();
#endif

platform_part_->PreMainMessageLoopRun();
Expand Down
4 changes: 0 additions & 4 deletions chrome/browser/browser_process_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,6 @@ class BrowserProcessImpl : public BrowserProcess,
virtual component_updater::PnaclComponentInstaller*
pnacl_component_installer() OVERRIDE;
virtual BookmarkPromptController* bookmark_prompt_controller() OVERRIDE;
virtual StorageMonitor* storage_monitor() OVERRIDE;
void set_storage_monitor_for_test(scoped_ptr<StorageMonitor> monitor);
virtual MediaFileSystemRegistry* media_file_system_registry() OVERRIDE;
virtual bool created_local_state() const OVERRIDE;
#if defined(ENABLE_WEBRTC)
Expand Down Expand Up @@ -203,8 +201,6 @@ class BrowserProcessImpl : public BrowserProcess,
#endif

#if !defined(OS_ANDROID) && !defined(OS_IOS)
scoped_ptr<StorageMonitor> storage_monitor_;

scoped_ptr<MediaFileSystemRegistry> media_file_system_registry_;
#endif

Expand Down
1 change: 0 additions & 1 deletion chrome/browser/chrome_browser_main_linux.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#include "components/breakpad/app/breakpad_linux.h"

#if !defined(OS_CHROMEOS)
#include "chrome/browser/storage_monitor/storage_monitor_linux.h"
#include "chrome/browser/sxs_linux.h"
#include "content/public/browser/browser_thread.h"
#endif
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/chromeos/camera_detector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "base/strings/string_util.h"
#include "base/task_runner_util.h"
#include "base/threading/sequenced_worker_pool.h"
#include "chrome/browser/storage_monitor/udev_util_linux.h"
#include "components/storage_monitor/udev_util_linux.h"
#include "content/public/browser/browser_thread.h"

namespace chromeos {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#define CHROME_BROWSER_EXTENSIONS_API_IMAGE_WRITER_PRIVATE_REMOVABLE_STORAGE_PROVIDER_H_

#include "base/callback.h"
#include "chrome/browser/storage_monitor/storage_info.h"
#include "chrome/common/extensions/api/image_writer_private.h"
#include "chrome/common/ref_counted_util.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@
#include "chrome/browser/media_galleries/media_scan_manager.h"
#include "chrome/browser/platform_util.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/storage_monitor/storage_info.h"
#include "chrome/browser/ui/chrome_select_file_policy.h"
#include "chrome/common/extensions/api/media_galleries.h"
#include "chrome/common/extensions/permissions/media_galleries_permission.h"
#include "chrome/common/pref_names.h"
#include "components/storage_monitor/storage_info.h"
#include "components/web_modal/web_contents_modal_dialog_manager.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/child_process_security_policy.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
#include "chrome/browser/extensions/chrome_extension_function.h"
#include "chrome/browser/media_galleries/media_file_system_registry.h"
#include "chrome/browser/media_galleries/media_scan_manager_observer.h"
#include "chrome/browser/storage_monitor/media_storage_util.h"
#include "chrome/common/extensions/api/media_galleries.h"
#include "components/storage_monitor/media_storage_util.h"

namespace MediaGalleries = extensions::api::media_galleries;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
#include "chrome/browser/media_galleries/media_galleries_preferences.h"
#include "chrome/browser/media_galleries/media_galleries_test_util.h"
#include "chrome/browser/media_galleries/media_scan_manager.h"
#include "chrome/browser/storage_monitor/storage_info.h"
#include "chrome/browser/storage_monitor/storage_monitor.h"
#include "chrome/common/chrome_paths.h"
#include "components/storage_monitor/storage_info.h"
#include "components/storage_monitor/storage_monitor.h"
#include "content/public/test/test_utils.h"
#include "extensions/browser/extension_system.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include "chrome/browser/media_galleries/media_file_system_registry.h"
#include "chrome/browser/media_galleries/media_galleries_preferences.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/storage_monitor/storage_monitor.h"
#include "chrome/common/extensions/api/media_galleries_private/media_galleries_handler.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_view_host.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
#include "chrome/browser/extensions/extension_apitest.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/extension_test_message_listener.h"
#include "chrome/browser/storage_monitor/storage_info.h"
#include "chrome/browser/storage_monitor/storage_monitor.h"
#include "chrome/browser/storage_monitor/test_storage_monitor.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/test/base/ui_test_utils.h"
#include "components/storage_monitor/storage_info.h"
#include "components/storage_monitor/storage_monitor.h"
#include "components/storage_monitor/test_storage_monitor.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/test/browser_test_utils.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
#include "base/values.h"
#include "chrome/browser/extensions/event_names.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/storage_monitor/storage_monitor.h"
#include "chrome/common/extensions/api/media_galleries_private.h"
#include "components/storage_monitor/storage_monitor.h"
#include "content/public/browser/browser_thread.h"
#include "extensions/browser/event_router.h"
#include "extensions/browser/extension_system.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "chrome/browser/media_galleries/media_galleries_preferences.h"
#include "chrome/browser/storage_monitor/removable_storage_observer.h"
#include "components/storage_monitor/removable_storage_observer.h"

class Profile;

Expand Down
6 changes: 3 additions & 3 deletions chrome/browser/extensions/api/system_info/system_info_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
#include "chrome/browser/browser_process.h"
#include "chrome/browser/extensions/api/system_storage/storage_info_provider.h"
#include "chrome/browser/extensions/event_router_forwarder.h"
#include "chrome/browser/storage_monitor/removable_storage_observer.h"
#include "chrome/browser/storage_monitor/storage_info.h"
#include "chrome/browser/storage_monitor/storage_monitor.h"
#include "chrome/common/extensions/api/system_display.h"
#include "chrome/common/extensions/api/system_storage.h"
#include "components/storage_monitor/removable_storage_observer.h"
#include "components/storage_monitor/storage_info.h"
#include "components/storage_monitor/storage_monitor.h"
#include "content/public/browser/browser_thread.h"
#include "extensions/browser/extension_system.h"
#include "ui/gfx/display_observer.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <vector>

#include "chrome/browser/extensions/api/system_storage/storage_info_provider.h"
#include "chrome/browser/storage_monitor/storage_info.h"
#include "components/storage_monitor/storage_info.h"

namespace extensions {
namespace test {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "base/strings/utf_string_conversions.h"
#include "base/sys_info.h"
#include "base/threading/sequenced_worker_pool.h"
#include "chrome/browser/storage_monitor/storage_monitor.h"
#include "components/storage_monitor/storage_monitor.h"
#include "content/public/browser/browser_thread.h"

namespace extensions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,8 @@
#include "base/observer_list_threadsafe.h"
#include "base/timer/timer.h"
#include "chrome/browser/extensions/api/system_info/system_info_provider.h"
#include "chrome/browser/storage_monitor/removable_storage_observer.h"
#include "chrome/browser/storage_monitor/storage_info.h"
#include "chrome/common/extensions/api/system_storage.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "components/storage_monitor/storage_info.h"

namespace extensions {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#define CHROME_BROWSER_EXTENSIONS_API_SYSTEM_STORAGE_SYSTEM_STORAGE_API_H_

#include "chrome/browser/extensions/api/system_storage/storage_info_provider.h"
#include "chrome/browser/storage_monitor/storage_monitor.h"
#include "components/storage_monitor/storage_monitor.h"
#include "extensions/browser/extension_function.h"

namespace extensions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
#include "chrome/browser/extensions/api/system_storage/storage_info_provider.h"
#include "chrome/browser/extensions/extension_apitest.h"
#include "chrome/browser/extensions/extension_test_message_listener.h"
#include "chrome/browser/storage_monitor/storage_info.h"
#include "chrome/browser/storage_monitor/storage_monitor.h"
#include "chrome/browser/storage_monitor/test_storage_monitor.h"
#include "components/storage_monitor/storage_info.h"
#include "components/storage_monitor/storage_monitor.h"
#include "components/storage_monitor/test_storage_monitor.h"

namespace {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
#include "chrome/browser/extensions/api/system_storage/storage_info_provider.h"
#include "chrome/browser/extensions/extension_apitest.h"
#include "chrome/browser/extensions/extension_test_message_listener.h"
#include "chrome/browser/storage_monitor/storage_info.h"
#include "chrome/browser/storage_monitor/storage_monitor.h"
#include "chrome/browser/storage_monitor/test_storage_monitor.h"
#include "components/storage_monitor/storage_info.h"
#include "components/storage_monitor/storage_monitor.h"
#include "components/storage_monitor/test_storage_monitor.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/test/test_utils.h"
#include "extensions/browser/extension_system.h"
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/media_galleries/fileapi/iapps_finder_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "base/callback.h"
#include "base/files/file_path.h"
#include "chrome/browser/media_galleries/fileapi/iapps_finder.h"
#include "chrome/browser/storage_monitor/storage_info.h"
#include "components/storage_monitor/storage_info.h"

#if defined(OS_MACOSX)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
#import "base/mac/scoped_nsobject.h"
#include "base/strings/sys_string_conversions.h"
#include "base/time/time.h"
#include "chrome/browser/storage_monitor/storage_info.h"
#include "components/policy/core/common/preferences_mac.h"
#include "components/storage_monitor/storage_info.h"
#include "content/public/browser/browser_thread.h"

using base::mac::CFCast;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
#include "base/path_service.h"
#include "chrome/browser/media_galleries/fileapi/iapps_finder.h"
#include "chrome/browser/media_galleries/fileapi/safe_itunes_pref_parser_win.h"
#include "chrome/browser/storage_monitor/storage_info.h"
#include "chrome/common/chrome_paths.h"
#include "components/storage_monitor/storage_info.h"
#include "content/public/browser/browser_thread.h"

namespace iapps {
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/media_galleries/fileapi/picasa_finder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
#include "base/file_util.h"
#include "base/path_service.h"
#include "base/strings/string16.h"
#include "chrome/browser/storage_monitor/storage_info.h"
#include "chrome/common/media_galleries/picasa_types.h"
#include "components/storage_monitor/storage_info.h"
#include "content/public/browser/browser_thread.h"

#if defined(OS_WIN)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "chrome/browser/media_galleries/linux/mtp_device_object_enumerator.h"
#include "chrome/browser/media_galleries/linux/mtp_read_file_worker.h"
#include "chrome/browser/media_galleries/linux/snapshot_file_details.h"
#include "chrome/browser/storage_monitor/storage_monitor.h"
#include "components/storage_monitor/storage_monitor.h"
#include "content/public/browser/browser_thread.h"
#include "device/media_transfer_protocol/media_transfer_protocol_manager.h"
#include "net/base/io_buffer.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "base/files/file_path.h"
#include "base/numerics/safe_conversions.h"
#include "chrome/browser/media_galleries/linux/snapshot_file_details.h"
#include "chrome/browser/storage_monitor/storage_monitor.h"
#include "components/storage_monitor/storage_monitor.h"
#include "content/public/browser/browser_thread.h"
#include "device/media_transfer_protocol/media_transfer_protocol_manager.h"
#include "third_party/cros_system_api/dbus/service_constants.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

#include "base/mac/scoped_nsobject.h"
#include "base/threading/sequenced_worker_pool.h"
#include "chrome/browser/storage_monitor/image_capture_device.h"
#include "chrome/browser/storage_monitor/image_capture_device_manager.h"
#include "components/storage_monitor/image_capture_device.h"
#include "components/storage_monitor/image_capture_device_manager.h"
#include "content/public/browser/browser_thread.h"
#include "webkit/browser/fileapi/async_file_util.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
#include "base/test/sequenced_worker_pool_owner.h"
#include "base/threading/sequenced_worker_pool.h"
#include "chrome/browser/media_galleries/mac/mtp_device_delegate_impl_mac.h"
#include "chrome/browser/storage_monitor/image_capture_device_manager.h"
#include "chrome/browser/storage_monitor/test_storage_monitor.h"
#include "components/storage_monitor/image_capture_device_manager.h"
#include "components/storage_monitor/test_storage_monitor.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/test/test_browser_thread.h"
#include "testing/gtest/include/gtest/gtest.h"
Expand Down Expand Up @@ -190,7 +190,7 @@ virtual void TearDown() OVERRIDE {

delegate_->CancelPendingTasksAndDeleteDelegate();

TestStorageMonitor::RemoveSingleton();
TestStorageMonitor::Destroy();

io_thread_->Stop();
}
Expand Down
4 changes: 2 additions & 2 deletions chrome/browser/media_galleries/media_file_system_registry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
#include "chrome/browser/media_galleries/media_galleries_preferences_factory.h"
#include "chrome/browser/media_galleries/media_scan_manager.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/storage_monitor/media_storage_util.h"
#include "chrome/browser/storage_monitor/storage_monitor.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/extensions/extension_constants.h"
#include "chrome/common/pref_names.h"
#include "components/storage_monitor/media_storage_util.h"
#include "components/storage_monitor/storage_monitor.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/navigation_details.h"
#include "content/public/browser/render_process_host.h"
Expand Down
Loading

0 comments on commit e4c5f97

Please sign in to comment.