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

Unified Diff: webkit/fileapi/media/mtp_device_map_service.cc

Issue 14247034: Move Media Galleries FileAPI code out of webkit. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cr-14352004
Patch Set: Add android ifdef. Created 7 years, 8 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
« no previous file with comments | « webkit/fileapi/media/mtp_device_map_service.h ('k') | webkit/fileapi/media/native_media_file_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/fileapi/media/mtp_device_map_service.cc
diff --git a/webkit/fileapi/media/mtp_device_map_service.cc b/webkit/fileapi/media/mtp_device_map_service.cc
deleted file mode 100644
index a4c4bea0a7c0231ee8186d6034dddb43b6fb6caf..0000000000000000000000000000000000000000
--- a/webkit/fileapi/media/mtp_device_map_service.cc
+++ /dev/null
@@ -1,73 +0,0 @@
-// Copyright (c) 2012 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.
-
-#include "webkit/fileapi/media/mtp_device_map_service.h"
-
-#include <string>
-#include <utility>
-
-#include "base/stl_util.h"
-#include "webkit/fileapi/isolated_context.h"
-#include "webkit/fileapi/media/mtp_device_async_delegate.h"
-
-namespace fileapi {
-
-namespace {
-
-base::LazyInstance<MTPDeviceMapService> g_mtp_device_map_service =
- LAZY_INSTANCE_INITIALIZER;
-
-} // namespace
-
-// static
-MTPDeviceMapService* MTPDeviceMapService::GetInstance() {
- return g_mtp_device_map_service.Pointer();
-}
-
-/////////////////////////////////////////////////////////////////////////////
-// Following methods are used to manage MTPDeviceAsyncDelegate objects. //
-/////////////////////////////////////////////////////////////////////////////
-void MTPDeviceMapService::AddAsyncDelegate(
- const base::FilePath::StringType& device_location,
- MTPDeviceAsyncDelegate* delegate) {
- DCHECK(thread_checker_.CalledOnValidThread());
- DCHECK(delegate);
- DCHECK(!device_location.empty());
- if (ContainsKey(async_delegate_map_, device_location))
- return;
- async_delegate_map_[device_location] = delegate;
-}
-
-void MTPDeviceMapService::RemoveAsyncDelegate(
- const base::FilePath::StringType& device_location) {
- DCHECK(thread_checker_.CalledOnValidThread());
- AsyncDelegateMap::iterator it = async_delegate_map_.find(device_location);
- DCHECK(it != async_delegate_map_.end());
- it->second->CancelPendingTasksAndDeleteDelegate();
- async_delegate_map_.erase(it);
-}
-
-MTPDeviceAsyncDelegate* MTPDeviceMapService::GetMTPDeviceAsyncDelegate(
- const std::string& filesystem_id) {
- DCHECK(thread_checker_.CalledOnValidThread());
- base::FilePath device_path;
- if (!IsolatedContext::GetInstance()->GetRegisteredPath(filesystem_id,
- &device_path)) {
- return NULL;
- }
-
- const base::FilePath::StringType& device_location = device_path.value();
- DCHECK(!device_location.empty());
- AsyncDelegateMap::const_iterator it =
- async_delegate_map_.find(device_location);
- return (it != async_delegate_map_.end()) ? it->second : NULL;
-}
-
-
-MTPDeviceMapService::MTPDeviceMapService() {
-}
-
-MTPDeviceMapService::~MTPDeviceMapService() {}
-
-} // namespace fileapi
« no previous file with comments | « webkit/fileapi/media/mtp_device_map_service.h ('k') | webkit/fileapi/media/native_media_file_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698