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

Unified Diff: chrome/browser/chromeos/file_manager/volume_manager.h

Issue 2707193005: Some linked_ptr removal in chromeos file_browser_handler. (Closed)
Patch Set: sync Created 3 years, 10 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/chromeos/file_manager/volume_manager.h
diff --git a/chrome/browser/chromeos/file_manager/volume_manager.h b/chrome/browser/chromeos/file_manager/volume_manager.h
index 46014dafddc98f333961a37635049a9e691f1ccb..1658d14962c9e1d1a99b9e448127607611ec677c 100644
--- a/chrome/browser/chromeos/file_manager/volume_manager.h
+++ b/chrome/browser/chromeos/file_manager/volume_manager.h
@@ -14,7 +14,6 @@
#include "base/files/file.h"
#include "base/files/file_path.h"
#include "base/macros.h"
-#include "base/memory/linked_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/observer_list.h"
#include "chrome/browser/chromeos/arc/arc_session_manager.h"
@@ -80,25 +79,29 @@ class Volume : public base::SupportsWeakPtr<Volume> {
~Volume();
// Factory static methods for different volume types.
- static Volume* CreateForDrive(Profile* profile);
- static Volume* CreateForDownloads(const base::FilePath& downloads_path);
- static Volume* CreateForRemovable(
+ static std::unique_ptr<Volume> CreateForDrive(Profile* profile);
+ static std::unique_ptr<Volume> CreateForDownloads(
+ const base::FilePath& downloads_path);
+ static std::unique_ptr<Volume> CreateForRemovable(
const chromeos::disks::DiskMountManager::MountPointInfo& mount_point,
const chromeos::disks::DiskMountManager::Disk* disk);
- static Volume* CreateForProvidedFileSystem(
+ static std::unique_ptr<Volume> CreateForProvidedFileSystem(
const chromeos::file_system_provider::ProvidedFileSystemInfo&
file_system_info,
MountContext mount_context);
- static Volume* CreateForMTP(const base::FilePath& mount_path,
- const std::string& label,
- bool read_only);
- static Volume* CreateForMediaView(const std::string& root_document_id);
- static Volume* CreateForTesting(const base::FilePath& path,
- VolumeType volume_type,
- chromeos::DeviceType device_type,
- bool read_only);
- static Volume* CreateForTesting(const base::FilePath& device_path,
- const base::FilePath& mount_path);
+ static std::unique_ptr<Volume> CreateForMTP(const base::FilePath& mount_path,
+ const std::string& label,
+ bool read_only);
+ static std::unique_ptr<Volume> CreateForMediaView(
+ const std::string& root_document_id);
+ static std::unique_ptr<Volume> CreateForTesting(
+ const base::FilePath& path,
+ VolumeType volume_type,
+ chromeos::DeviceType device_type,
+ bool read_only);
+ static std::unique_ptr<Volume> CreateForTesting(
+ const base::FilePath& device_path,
+ const base::FilePath& mount_path);
// Getters for all members. See below for details.
const std::string& volume_id() const { return volume_id_; }
@@ -270,7 +273,7 @@ class VolumeManager : public KeyedService,
bool read_only);
// For testing purpose, adds the volume info to the volume manager.
- void AddVolumeForTesting(const linked_ptr<Volume>& volume);
+ void AddVolumeForTesting(std::unique_ptr<Volume> volume);
// drive::DriveIntegrationServiceObserver overrides.
void OnFileSystemMounted() override;
@@ -322,9 +325,8 @@ class VolumeManager : public KeyedService,
void OnDiskMountManagerRefreshed(bool success);
void OnStorageMonitorInitialized();
void DoMountEvent(chromeos::MountError error_code,
- const linked_ptr<Volume>& volume);
- void DoUnmountEvent(chromeos::MountError error_code,
- const linked_ptr<Volume>& volume);
+ std::unique_ptr<Volume> volume);
+ void DoUnmountEvent(chromeos::MountError error_code, const Volume& volume);
void OnExternalStorageDisabledChangedUnmountCallback(
chromeos::MountError error_code);
@@ -336,7 +338,7 @@ class VolumeManager : public KeyedService,
chromeos::file_system_provider::Service*
file_system_provider_service_; // Not owned by this class.
GetMtpStorageInfoCallback get_mtp_storage_info_callback_;
- std::map<std::string, linked_ptr<Volume>> mounted_volumes_;
+ std::map<std::string, std::unique_ptr<Volume>> mounted_volumes_;
std::unique_ptr<SnapshotManager> snapshot_manager_;
bool arc_volumes_mounted_ = false;

Powered by Google App Engine
This is Rietveld 408576698