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

Side by Side Diff: chrome/browser/chromeos/gdata/gdata_file_system.h

Issue 10800092: Database support for GDataDirectoryService. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: comments Created 8 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 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_
6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ 6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 19 matching lines...) Expand all
30 } // namespace base 30 } // namespace base
31 31
32 namespace gdata { 32 namespace gdata {
33 33
34 class DocumentsServiceInterface; 34 class DocumentsServiceInterface;
35 class DriveWebAppsRegistryInterface; 35 class DriveWebAppsRegistryInterface;
36 class GDataWapiFeedLoader; 36 class GDataWapiFeedLoader;
37 struct GetDocumentsParams; 37 struct GetDocumentsParams;
38 struct UploadFileInfo; 38 struct UploadFileInfo;
39 39
40 namespace {
41 struct LoadRootFeedParams;
42 } // namespace
43
44 // Callback run as a response to LoadFromServer. 40 // Callback run as a response to LoadFromServer.
45 // 41 //
46 // TODO(satorux): Move this to a new file: crbug.com/138268 42 // TODO(satorux): Move this to a new file: crbug.com/138268
47 typedef base::Callback<void(GetDocumentsParams* params, 43 typedef base::Callback<void(GetDocumentsParams* params,
48 GDataFileError error)> 44 GDataFileError error)>
49 LoadDocumentFeedCallback; 45 LoadDocumentFeedCallback;
50 46
51 // GDataWapiFeedLoader is used to load feeds from WAPI (codename for 47 // GDataWapiFeedLoader is used to load feeds from WAPI (codename for
52 // Documents List API) and load the cached proto file. 48 // Documents List API) and load the cached proto file.
53 // 49 //
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 // |start_changestamp| and |root_feed_changestamp|. 131 // |start_changestamp| and |root_feed_changestamp|.
136 GDataFileError UpdateFromFeed( 132 GDataFileError UpdateFromFeed(
137 const std::vector<DocumentFeed*>& feed_list, 133 const std::vector<DocumentFeed*>& feed_list,
138 int start_changestamp, 134 int start_changestamp,
139 int root_feed_changestamp); 135 int root_feed_changestamp);
140 136
141 private: 137 private:
142 // Callback for handling root directory refresh from the cache. 138 // Callback for handling root directory refresh from the cache.
143 void OnProtoLoaded(LoadRootFeedParams* params); 139 void OnProtoLoaded(LoadRootFeedParams* params);
144 140
141 // Continues handling root directory refresh after the directory service
142 // is fully loaded.
143 void ContinueWithInitializedDirectoryService(LoadRootFeedParams* params,
144 GDataFileError error);
145
145 // Helper callback for handling results of metadata retrieval initiated from 146 // Helper callback for handling results of metadata retrieval initiated from
146 // ReloadFeedFromServerIfNeeded(). This method makes a decision about fetching 147 // ReloadFeedFromServerIfNeeded(). This method makes a decision about fetching
147 // the content of the root feed during the root directory refresh process. 148 // the content of the root feed during the root directory refresh process.
148 void OnGetAccountMetadata( 149 void OnGetAccountMetadata(
149 ContentOrigin initial_origin, 150 ContentOrigin initial_origin,
150 int local_changestamp, 151 int local_changestamp,
151 const FilePath& search_file_path, 152 const FilePath& search_file_path,
152 const FindEntryCallback& callback, 153 const FindEntryCallback& callback,
153 GDataErrorCode status, 154 GDataErrorCode status,
154 scoped_ptr<base::Value> feed_data); 155 scoped_ptr<base::Value> feed_data);
155 156
156 // Callback for handling feed content fetching while searching for file info. 157 // Callback for handling feed content fetching while searching for file info.
157 // This callback is invoked after async feed fetch operation that was 158 // This callback is invoked after async feed fetch operation that was
158 // invoked by StartDirectoryRefresh() completes. This callback will update 159 // invoked by StartDirectoryRefresh() completes. This callback will update
159 // the content of the refreshed directory object and continue initially 160 // the content of the refreshed directory object and continue initially
160 // started FindEntryByPath() request. 161 // started FindEntryByPath() request.
161 void OnFeedFromServerLoaded(GetDocumentsParams* params, 162 void OnFeedFromServerLoaded(GetDocumentsParams* params,
162 GDataFileError error); 163 GDataFileError error);
163 164
164 // Callback for handling response from |GDataDocumentsService::GetDocuments|. 165 // Callback for handling response from |GDataDocumentsService::GetDocuments|.
165 // Invokes |callback| when done. 166 // Invokes |callback| when done.
166 void OnGetDocuments( 167 void OnGetDocuments(
167 ContentOrigin initial_origin, 168 ContentOrigin initial_origin,
168 const LoadDocumentFeedCallback& callback, 169 const LoadDocumentFeedCallback& callback,
169 GetDocumentsParams* params, 170 GetDocumentsParams* params,
170 base::TimeTicks start_time, 171 base::TimeTicks start_time,
171 GDataErrorCode status, 172 GDataErrorCode status,
172 scoped_ptr<base::Value> data); 173 scoped_ptr<base::Value> data);
173 174
174 // Save filesystem as proto file. 175 // Save filesystem to disk.
175 void SaveFileSystemAsProto(); 176 void SaveFileSystem();
176 177
177 GDataDirectoryService* directory_service_; // Not owned. 178 GDataDirectoryService* directory_service_; // Not owned.
178 DocumentsServiceInterface* documents_service_; // Not owned. 179 DocumentsServiceInterface* documents_service_; // Not owned.
179 DriveWebAppsRegistryInterface* webapps_registry_; // Not owned. 180 DriveWebAppsRegistryInterface* webapps_registry_; // Not owned.
180 GDataCache* cache_; // Not owned. 181 GDataCache* cache_; // Not owned.
181 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; 182 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_;
182 ObserverList<Observer> observers_; 183 ObserverList<Observer> observers_;
183 184
184 // Note: This should remain the last member so it'll be destroyed and 185 // Note: This should remain the last member so it'll be destroyed and
185 // invalidate its weak pointers before any other members are destroyed. 186 // invalidate its weak pointers before any other members are destroyed.
(...skipping 777 matching lines...) Expand 10 before | Expand all | Expand 10 after
963 // invalidate the weak pointers before any other members are destroyed. 964 // invalidate the weak pointers before any other members are destroyed.
964 base::WeakPtrFactory<GDataFileSystem> ui_weak_ptr_factory_; 965 base::WeakPtrFactory<GDataFileSystem> ui_weak_ptr_factory_;
965 // Unlike other classes, we need this as we need this to redirect a task 966 // Unlike other classes, we need this as we need this to redirect a task
966 // from IO thread to UI thread. 967 // from IO thread to UI thread.
967 base::WeakPtr<GDataFileSystem> ui_weak_ptr_; 968 base::WeakPtr<GDataFileSystem> ui_weak_ptr_;
968 }; 969 };
969 970
970 } // namespace gdata 971 } // namespace gdata
971 972
972 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ 973 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698