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

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: rebase 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/gdata/gdata_file_system.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 20 matching lines...) Expand all
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 GetDocumentsUiState; 38 struct GetDocumentsUiState;
39 struct UploadFileInfo; 39 struct UploadFileInfo;
40 40
41 namespace {
42 struct LoadRootFeedParams;
43 } // namespace
44
45 // Callback run as a response to LoadFromServer. 41 // Callback run as a response to LoadFromServer.
46 // 42 //
47 // TODO(satorux): Move this to a new file: crbug.com/138268 43 // TODO(satorux): Move this to a new file: crbug.com/138268
48 typedef base::Callback<void(GetDocumentsParams* params, 44 typedef base::Callback<void(GetDocumentsParams* params,
49 GDataFileError error)> 45 GDataFileError error)>
50 LoadDocumentFeedCallback; 46 LoadDocumentFeedCallback;
51 47
52 // GDataWapiFeedLoader is used to load feeds from WAPI (codename for 48 // GDataWapiFeedLoader is used to load feeds from WAPI (codename for
53 // Documents List API) and load the cached proto file. 49 // Documents List API) and load the cached proto file.
54 // 50 //
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 // |start_changestamp| and |root_feed_changestamp|. 132 // |start_changestamp| and |root_feed_changestamp|.
137 GDataFileError UpdateFromFeed( 133 GDataFileError UpdateFromFeed(
138 const std::vector<DocumentFeed*>& feed_list, 134 const std::vector<DocumentFeed*>& feed_list,
139 int start_changestamp, 135 int start_changestamp,
140 int root_feed_changestamp); 136 int root_feed_changestamp);
141 137
142 private: 138 private:
143 // Callback for handling root directory refresh from the cache. 139 // Callback for handling root directory refresh from the cache.
144 void OnProtoLoaded(LoadRootFeedParams* params); 140 void OnProtoLoaded(LoadRootFeedParams* params);
145 141
142 // Continues handling root directory refresh after the directory service
143 // is fully loaded.
144 void ContinueWithInitializedDirectoryService(LoadRootFeedParams* params,
145 GDataFileError error);
146
146 // Helper callback for handling results of metadata retrieval initiated from 147 // Helper callback for handling results of metadata retrieval initiated from
147 // ReloadFeedFromServerIfNeeded(). This method makes a decision about fetching 148 // ReloadFeedFromServerIfNeeded(). This method makes a decision about fetching
148 // the content of the root feed during the root directory refresh process. 149 // the content of the root feed during the root directory refresh process.
149 void OnGetAccountMetadata( 150 void OnGetAccountMetadata(
150 ContentOrigin initial_origin, 151 ContentOrigin initial_origin,
151 int local_changestamp, 152 int local_changestamp,
152 const FilePath& search_file_path, 153 const FilePath& search_file_path,
153 const FindEntryCallback& callback, 154 const FindEntryCallback& callback,
154 GDataErrorCode status, 155 GDataErrorCode status,
155 scoped_ptr<base::Value> feed_data); 156 scoped_ptr<base::Value> feed_data);
156 157
157 // Callback for handling feed content fetching while searching for file info. 158 // Callback for handling feed content fetching while searching for file info.
158 // This callback is invoked after async feed fetch operation that was 159 // This callback is invoked after async feed fetch operation that was
159 // invoked by StartDirectoryRefresh() completes. This callback will update 160 // invoked by StartDirectoryRefresh() completes. This callback will update
160 // the content of the refreshed directory object and continue initially 161 // the content of the refreshed directory object and continue initially
161 // started FindEntryByPath() request. 162 // started FindEntryByPath() request.
162 void OnFeedFromServerLoaded(GetDocumentsParams* params, 163 void OnFeedFromServerLoaded(GetDocumentsParams* params,
163 GDataFileError error); 164 GDataFileError error);
164 165
165 // Callback for handling response from |GDataDocumentsService::GetDocuments|. 166 // Callback for handling response from |GDataDocumentsService::GetDocuments|.
166 // Invokes |callback| when done. 167 // Invokes |callback| when done.
167 void OnGetDocuments( 168 void OnGetDocuments(
168 ContentOrigin initial_origin, 169 ContentOrigin initial_origin,
169 const LoadDocumentFeedCallback& callback, 170 const LoadDocumentFeedCallback& callback,
170 GetDocumentsParams* params, 171 GetDocumentsParams* params,
171 base::TimeTicks start_time, 172 base::TimeTicks start_time,
172 GDataErrorCode status, 173 GDataErrorCode status,
173 scoped_ptr<base::Value> data); 174 scoped_ptr<base::Value> data);
174 175
176 // Save filesystem to disk.
177 void SaveFileSystem();
178
175 // Callback for handling UI updates caused by document fetching. 179 // Callback for handling UI updates caused by document fetching.
176 void OnNotifyDocumentFeedFetched( 180 void OnNotifyDocumentFeedFetched(
177 base::WeakPtr<GetDocumentsUiState> ui_state); 181 base::WeakPtr<GetDocumentsUiState> ui_state);
178 182
179 // Save filesystem as proto file.
180 void SaveFileSystemAsProto();
181
182 GDataDirectoryService* directory_service_; // Not owned. 183 GDataDirectoryService* directory_service_; // Not owned.
183 DocumentsServiceInterface* documents_service_; // Not owned. 184 DocumentsServiceInterface* documents_service_; // Not owned.
184 DriveWebAppsRegistryInterface* webapps_registry_; // Not owned. 185 DriveWebAppsRegistryInterface* webapps_registry_; // Not owned.
185 GDataCache* cache_; // Not owned. 186 GDataCache* cache_; // Not owned.
186 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; 187 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_;
187 ObserverList<Observer> observers_; 188 ObserverList<Observer> observers_;
188 189
189 // Note: This should remain the last member so it'll be destroyed and 190 // Note: This should remain the last member so it'll be destroyed and
190 // invalidate its weak pointers before any other members are destroyed. 191 // invalidate its weak pointers before any other members are destroyed.
191 base::WeakPtrFactory<GDataWapiFeedLoader> weak_ptr_factory_; 192 base::WeakPtrFactory<GDataWapiFeedLoader> weak_ptr_factory_;
(...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after
970 // invalidate the weak pointers before any other members are destroyed. 971 // invalidate the weak pointers before any other members are destroyed.
971 base::WeakPtrFactory<GDataFileSystem> ui_weak_ptr_factory_; 972 base::WeakPtrFactory<GDataFileSystem> ui_weak_ptr_factory_;
972 // Unlike other classes, we need this as we need this to redirect a task 973 // Unlike other classes, we need this as we need this to redirect a task
973 // from IO thread to UI thread. 974 // from IO thread to UI thread.
974 base::WeakPtr<GDataFileSystem> ui_weak_ptr_; 975 base::WeakPtr<GDataFileSystem> ui_weak_ptr_;
975 }; 976 };
976 977
977 } // namespace gdata 978 } // namespace gdata
978 979
979 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ 980 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/gdata/gdata_file_system.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698