Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1285)

Unified Diff: chrome/browser/extensions/api/system_storage/storage_info_provider.h

Issue 389633002: Move system.* family of APIs to extensions/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/system_storage/storage_info_provider.h
diff --git a/chrome/browser/extensions/api/system_storage/storage_info_provider.h b/chrome/browser/extensions/api/system_storage/storage_info_provider.h
deleted file mode 100644
index b32554d48b3dd258aa1d8d284e20ee6d51a4d618..0000000000000000000000000000000000000000
--- a/chrome/browser/extensions/api/system_storage/storage_info_provider.h
+++ /dev/null
@@ -1,86 +0,0 @@
-// Copyright 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 CHROME_BROWSER_EXTENSIONS_API_SYSTEM_STORAGE_STORAGE_INFO_PROVIDER_H_
-#define CHROME_BROWSER_EXTENSIONS_API_SYSTEM_STORAGE_STORAGE_INFO_PROVIDER_H_
-
-#include <set>
-
-#include "base/lazy_instance.h"
-#include "base/memory/ref_counted.h"
-#include "base/observer_list_threadsafe.h"
-#include "base/timer/timer.h"
-#include "chrome/browser/extensions/api/system_info/system_info_provider.h"
-#include "chrome/common/extensions/api/system_storage.h"
-
-namespace storage_monitor {
-class StorageInfo;
-}
-
-namespace extensions {
-
-namespace systeminfo {
-
-// Build StorageUnitInfo struct from StorageInfo instance. The |unit|
-// parameter is the output value.
-void BuildStorageUnitInfo(const storage_monitor::StorageInfo& info,
- api::system_storage::StorageUnitInfo* unit);
-
-} // namespace systeminfo
-
-typedef std::vector<linked_ptr<
- api::system_storage::StorageUnitInfo> >
- StorageUnitInfoList;
-
-class StorageInfoProvider : public SystemInfoProvider {
- public:
- typedef base::Callback<void(const std::string&, double)>
- GetStorageFreeSpaceCallback;
-
- // Get the single shared instance of StorageInfoProvider.
- static StorageInfoProvider* Get();
-
- // SystemInfoProvider implementations
- virtual void PrepareQueryOnUIThread() OVERRIDE;
- virtual void InitializeProvider(const base::Closure& do_query_info_callback)
- OVERRIDE;
-
- virtual double GetStorageFreeSpaceFromTransientIdOnFileThread(
- const std::string& transient_id);
-
- const StorageUnitInfoList& storage_unit_info_list() const;
-
- static void InitializeForTesting(scoped_refptr<StorageInfoProvider> provider);
-
- protected:
- StorageInfoProvider();
-
- virtual ~StorageInfoProvider();
-
- // Put all available storages' information into |info_|.
- void GetAllStoragesIntoInfoList();
-
- // The last information filled up by QueryInfo and is accessed on multiple
- // threads, but the whole class is being guarded by SystemInfoProvider base
- // class.
- //
- // |info_| is accessed on the UI thread while |is_waiting_for_completion_| is
- // false and on the sequenced worker pool while |is_waiting_for_completion_|
- // is true.
- StorageUnitInfoList info_;
-
- private:
- // SystemInfoProvider implementations.
- // Override to query the available capacity of all known storage devices on
- // the blocking pool, including fixed and removable devices.
- virtual bool QueryInfo() OVERRIDE;
-
- static base::LazyInstance<scoped_refptr<StorageInfoProvider> > provider_;
-
- DISALLOW_COPY_AND_ASSIGN(StorageInfoProvider);
-};
-
-} // namespace extensions
-
-#endif // CHROME_BROWSER_EXTENSIONS_API_SYSTEM_STORAGE_STORAGE_INFO_PROVIDER_H_

Powered by Google App Engine
This is Rietveld 408576698