1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_LOCAL_DISCOVERY_STORAGE_PRIVET_FILESYSTEM_ATTRIBUTE_CACHE_H_
6 #define CHROME_BROWSER_LOCAL_DISCOVERY_STORAGE_PRIVET_FILESYSTEM_ATTRIBUTE_CACHE_H_
10 #include "base/files/file.h"
11 #include "base/values.h"
13 namespace local_discovery
{
15 class PrivetFileSystemAttributeCache
{
17 PrivetFileSystemAttributeCache();
18 ~PrivetFileSystemAttributeCache();
20 // Get File info for a path in the filesystem. Returns NULL if not found.
21 const base::File::Info
* GetFileInfo(const base::FilePath
& full_path
);
23 // Add file info from the result of a /privet/storage/list request.
24 void AddFileInfoFromJSON(const base::FilePath
& full_path
,
25 const base::DictionaryValue
* json
);
28 typedef std::map
<base::FilePath
, base::File::Info
> FileInfoMap
;
30 void AddEntryInfoFromJSON(const base::FilePath
& full_path
,
31 const base::DictionaryValue
* json
);
33 FileInfoMap file_info_map_
;
36 } // namespace local_discovery
38 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_STORAGE_PRIVET_FILESYSTEM_ATTRIBUTE_CACHE_H_