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

Side by Side Diff: chrome/browser/chromeos/file_system_provider/operations/get_metadata.h

Issue 1093383002: [WIP] Provided file system from NACL. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved several modules to chromeos folder. Created 5 years, 5 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 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 #ifndef CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_OPERATIONS_GET_METADATA_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_OPERATIONS_GET_METADATA_H_
6 #define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_OPERATIONS_GET_METADATA_H_ 6 #define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_OPERATIONS_GET_METADATA_H_
7 7
8 #include "base/files/file.h" 8 #include "base/files/file.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "chrome/browser/chromeos/file_system_provider/operations/operation.h" 10 #include "chrome/browser/chromeos/file_system_provider/operations/operation.h"
11 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_info .h" 11 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_info .h"
12 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_inte rface.h" 12 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_inte rface.h"
13 #include "chrome/browser/chromeos/file_system_provider/request_value.h" 13 #include "chrome/browser/chromeos/file_system_provider/request_value.h"
14 #include "chrome/common/extensions/api/file_system_provider_internal.h" 14 #include "chrome/common/extensions/api/file_system_provider_internal.h"
15 15
16 namespace base { 16 namespace base {
17 class FilePath; 17 class FilePath;
18 } // namespace base 18 } // namespace base
19 19
20 namespace extensions {
21 class EventRouter;
22 } // namespace extensions
23 20
24 namespace chromeos { 21 namespace chromeos {
25 namespace file_system_provider { 22 namespace file_system_provider {
26 namespace operations { 23 namespace operations {
27 24
28 // Validates the metadata. If it's incorrect (eg. incorrect characters in the 25 // Validates the metadata. If it's incorrect (eg. incorrect characters in the
29 // name or empty for non-root), then returns false. 26 // name or empty for non-root), then returns false.
30 bool ValidateIDLEntryMetadata( 27 bool ValidateIDLEntryMetadata(
31 const extensions::api::file_system_provider::EntryMetadata& metadata, 28 const extensions::api::file_system_provider::EntryMetadata& metadata,
32 bool root_entry); 29 bool root_entry);
33 30
34 // Checks whether the passed name is valid or not. 31 // Checks whether the passed name is valid or not.
35 bool ValidateName(const std::string& name, bool root_entry); 32 bool ValidateName(const std::string& name, bool root_entry);
36 33
37 // Bridge between fileapi get metadata operation and providing extension's get 34 // Bridge between fileapi get metadata operation and providing extension's get
38 // metadata request. Created per request. 35 // metadata request. Created per request.
39 class GetMetadata : public Operation { 36 template <class DestinationPolicy>
37 class GetMetadata : public Operation<DestinationPolicy> {
40 public: 38 public:
41 GetMetadata(extensions::EventRouter* event_router, 39 GetMetadata(typename DestinationPolicy::EventRouterType* event_router,
42 const ProvidedFileSystemInfo& file_system_info, 40 const ProvidedFileSystemInfo& file_system_info,
43 const base::FilePath& entry_path, 41 const base::FilePath& entry_path,
44 ProvidedFileSystemInterface::MetadataFieldMask fields, 42 ProvidedFileSystemInterface::MetadataFieldMask fields,
45 const ProvidedFileSystemInterface::GetMetadataCallback& callback); 43 const ProvidedFileSystemInterface::GetMetadataCallback& callback);
46 ~GetMetadata() override; 44 ~GetMetadata() override;
47 45
48 // Operation overrides. 46 // Operation overrides.
49 bool Execute(int request_id) override; 47 bool Execute(int request_id) override;
50 void OnSuccess(int request_id, 48 void OnSuccess(int request_id,
51 scoped_ptr<RequestValue> result, 49 scoped_ptr<RequestValue> result,
52 bool has_more) override; 50 bool has_more) override;
53 void OnError(int request_id, 51 void OnError(int request_id,
54 scoped_ptr<RequestValue> result, 52 scoped_ptr<RequestValue> result,
55 base::File::Error error) override; 53 base::File::Error error) override;
56 54
57 private: 55 private:
58 base::FilePath entry_path_; 56 base::FilePath entry_path_;
59 ProvidedFileSystemInterface::MetadataFieldMask fields_; 57 ProvidedFileSystemInterface::MetadataFieldMask fields_;
60 const ProvidedFileSystemInterface::GetMetadataCallback callback_; 58 const ProvidedFileSystemInterface::GetMetadataCallback callback_;
61 59
62 DISALLOW_COPY_AND_ASSIGN(GetMetadata); 60 DISALLOW_COPY_AND_ASSIGN(GetMetadata<DestinationPolicy>);
63 }; 61 };
64 62
65 } // namespace operations 63 } // namespace operations
66 } // namespace file_system_provider 64 } // namespace file_system_provider
67 } // namespace chromeos 65 } // namespace chromeos
68 66
69 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_OPERATIONS_GET_METADATA_ H_ 67 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_OPERATIONS_GET_METADATA_ H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698