Commit e25fb50f authored by xzhan96's avatar xzhan96 Committed by Commit Bot

Remove linked_ptr from c/b/media_galleries

Use std::unique_ptr instead of deprecated linked_ptr.

BUG=556939

Change-Id: Icf51f7747b2467afe7ffe3995cd7d4e749b31e11
Reviewed-on: https://chromium-review.googlesource.com/578302
Commit-Queue: Xiaofeng Zhang <xiaofeng.zhang@intel.com>
Reviewed-by: default avatarReilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#488587}
parent ff2f8fe0
......@@ -79,8 +79,8 @@ class GalleryWatchManager::FileWatchManager {
base::WeakPtr<FileWatchManager> GetWeakPtr();
private:
typedef std::map<base::FilePath, linked_ptr<base::FilePathWatcher> >
WatcherMap;
using WatcherMap =
std::map<base::FilePath, std::unique_ptr<base::FilePathWatcher>>;
void OnFilePathChanged(const base::FilePath& path, bool error);
......@@ -116,14 +116,14 @@ void GalleryWatchManager::FileWatchManager::AddFileWatch(
return;
}
linked_ptr<base::FilePathWatcher> watcher(new base::FilePathWatcher);
auto watcher = base::MakeUnique<base::FilePathWatcher>();
bool success = watcher->Watch(path,
true /*recursive*/,
base::Bind(&FileWatchManager::OnFilePathChanged,
weak_factory_.GetWeakPtr()));
if (success)
watchers_[path] = watcher;
watchers_[path] = std::move(watcher);
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
base::BindOnce(callback, success));
......
......@@ -13,7 +13,6 @@
#include "base/files/file_path.h"
#include "base/files/file_path_watcher.h"
#include "base/macros.h"
#include "base/memory/linked_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/time/time.h"
#include "chrome/browser/media_galleries/media_galleries_preferences.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment