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

Side by Side Diff: chrome/browser/media_galleries/fileapi/mtp_device_map_service.cc

Issue 442383002: Move storage-related files from webkit/ to new top-level directory storage/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/media_galleries/fileapi/mtp_device_map_service.h" 5 #include "chrome/browser/media_galleries/fileapi/mtp_device_map_service.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
11 #include "chrome/browser/media_galleries/fileapi/mtp_device_async_delegate.h" 11 #include "chrome/browser/media_galleries/fileapi/mtp_device_async_delegate.h"
12 #include "content/public/browser/browser_thread.h" 12 #include "content/public/browser/browser_thread.h"
13 #include "webkit/browser/fileapi/external_mount_points.h" 13 #include "storage/browser/fileapi/external_mount_points.h"
14 14
15 namespace { 15 namespace {
16 16
17 base::LazyInstance<MTPDeviceMapService> g_mtp_device_map_service = 17 base::LazyInstance<MTPDeviceMapService> g_mtp_device_map_service =
18 LAZY_INSTANCE_INITIALIZER; 18 LAZY_INSTANCE_INITIALIZER;
19 19
20 } // namespace 20 } // namespace
21 21
22 // static 22 // static
23 MTPDeviceMapService* MTPDeviceMapService::GetInstance() { 23 MTPDeviceMapService* MTPDeviceMapService::GetInstance() {
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 AsyncDelegateMap::iterator it = async_delegate_map_.find(device_location); 78 AsyncDelegateMap::iterator it = async_delegate_map_.find(device_location);
79 DCHECK(it != async_delegate_map_.end()); 79 DCHECK(it != async_delegate_map_.end());
80 it->second->CancelPendingTasksAndDeleteDelegate(); 80 it->second->CancelPendingTasksAndDeleteDelegate();
81 async_delegate_map_.erase(it); 81 async_delegate_map_.erase(it);
82 } 82 }
83 83
84 MTPDeviceAsyncDelegate* MTPDeviceMapService::GetMTPDeviceAsyncDelegate( 84 MTPDeviceAsyncDelegate* MTPDeviceMapService::GetMTPDeviceAsyncDelegate(
85 const std::string& filesystem_id) { 85 const std::string& filesystem_id) {
86 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); 86 DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
87 base::FilePath device_path; 87 base::FilePath device_path;
88 if (!fileapi::ExternalMountPoints::GetSystemInstance()->GetRegisteredPath( 88 if (!storage::ExternalMountPoints::GetSystemInstance()->GetRegisteredPath(
89 filesystem_id, &device_path)) { 89 filesystem_id, &device_path)) {
90 return NULL; 90 return NULL;
91 } 91 }
92 92
93 const base::FilePath::StringType& device_location = device_path.value(); 93 const base::FilePath::StringType& device_location = device_path.value();
94 DCHECK(!device_location.empty()); 94 DCHECK(!device_location.empty());
95 AsyncDelegateMap::const_iterator it = 95 AsyncDelegateMap::const_iterator it =
96 async_delegate_map_.find(device_location); 96 async_delegate_map_.find(device_location);
97 return (it != async_delegate_map_.end()) ? it->second : NULL; 97 return (it != async_delegate_map_.end()) ? it->second : NULL;
98 } 98 }
99 99
100 MTPDeviceMapService::MTPDeviceMapService() { 100 MTPDeviceMapService::MTPDeviceMapService() {
101 } 101 }
102 102
103 MTPDeviceMapService::~MTPDeviceMapService() { 103 MTPDeviceMapService::~MTPDeviceMapService() {
104 DCHECK(mtp_device_usage_map_.empty()); 104 DCHECK(mtp_device_usage_map_.empty());
105 } 105 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698