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

Side by Side Diff: chrome/browser/sync_file_system/sync_file_system_service.h

Issue 107743002: Add 'Dump Database' tab to syncfs-internals (only for v2 for now) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: regular -> Regular, added app_id Created 7 years 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_SYNC_FILE_SYSTEM_SYNC_FILE_SYSTEM_SERVICE_H_ 5 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_SYNC_FILE_SYSTEM_SERVICE_H_
6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_SYNC_FILE_SYSTEM_SERVICE_H_ 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_SYNC_FILE_SYSTEM_SERVICE_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "base/callback_forward.h" 12 #include "base/callback_forward.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "base/memory/scoped_vector.h" 14 #include "base/memory/scoped_vector.h"
15 #include "base/memory/weak_ptr.h" 15 #include "base/memory/weak_ptr.h"
16 #include "base/observer_list.h" 16 #include "base/observer_list.h"
17 #include "base/timer/timer.h" 17 #include "base/timer/timer.h"
18 #include "chrome/browser/sync/profile_sync_service_observer.h" 18 #include "chrome/browser/sync/profile_sync_service_observer.h"
19 #include "chrome/browser/sync_file_system/conflict_resolution_policy.h" 19 #include "chrome/browser/sync_file_system/conflict_resolution_policy.h"
20 #include "chrome/browser/sync_file_system/file_status_observer.h" 20 #include "chrome/browser/sync_file_system/file_status_observer.h"
21 #include "chrome/browser/sync_file_system/local/local_file_sync_service.h"
22 #include "chrome/browser/sync_file_system/remote_file_sync_service.h" 21 #include "chrome/browser/sync_file_system/remote_file_sync_service.h"
23 #include "chrome/browser/sync_file_system/sync_callbacks.h" 22 #include "chrome/browser/sync_file_system/sync_callbacks.h"
24 #include "chrome/browser/sync_file_system/sync_service_state.h" 23 #include "chrome/browser/sync_file_system/sync_service_state.h"
25 #include "components/browser_context_keyed_service/browser_context_keyed_service .h" 24 #include "components/browser_context_keyed_service/browser_context_keyed_service .h"
26 #include "content/public/browser/notification_observer.h" 25 #include "content/public/browser/notification_observer.h"
27 #include "content/public/browser/notification_registrar.h" 26 #include "content/public/browser/notification_registrar.h"
28 #include "url/gurl.h" 27 #include "url/gurl.h"
29 28
29 class Profile;
30 class ProfileSyncServiceBase; 30 class ProfileSyncServiceBase;
31 31
32 namespace fileapi { 32 namespace fileapi {
33 class FileSystemContext; 33 class FileSystemContext;
34 } 34 }
35 35
36 namespace sync_file_system { 36 namespace sync_file_system {
37 37
38 class LocalFileSyncService;
38 class LocalSyncRunner; 39 class LocalSyncRunner;
39 class RemoteSyncRunner; 40 class RemoteSyncRunner;
40 class SyncEventObserver; 41 class SyncEventObserver;
41 class SyncProcessRunner; 42 class SyncProcessRunner;
42 43
43 class SyncFileSystemService 44 class SyncFileSystemService
44 : public BrowserContextKeyedService, 45 : public BrowserContextKeyedService,
45 public ProfileSyncServiceObserver, 46 public ProfileSyncServiceObserver,
46 public FileStatusObserver, 47 public FileStatusObserver,
47 public content::NotificationObserver, 48 public content::NotificationObserver,
48 public base::SupportsWeakPtr<SyncFileSystemService> { 49 public base::SupportsWeakPtr<SyncFileSystemService> {
49 public: 50 public:
50 typedef base::Callback<void(const base::ListValue* files)> DumpFilesCallback; 51 typedef base::Callback<void(const base::ListValue* files)> DumpFilesCallback;
51 52
52 // BrowserContextKeyedService overrides. 53 // BrowserContextKeyedService overrides.
53 virtual void Shutdown() OVERRIDE; 54 virtual void Shutdown() OVERRIDE;
54 55
55 void InitializeForApp( 56 void InitializeForApp(
56 fileapi::FileSystemContext* file_system_context, 57 fileapi::FileSystemContext* file_system_context,
57 const GURL& app_origin, 58 const GURL& app_origin,
58 const SyncStatusCallback& callback); 59 const SyncStatusCallback& callback);
59 60
60 SyncServiceState GetSyncServiceState(); 61 SyncServiceState GetSyncServiceState();
61 void GetExtensionStatusMap(std::map<GURL, std::string>* status_map); 62 void GetExtensionStatusMap(std::map<GURL, std::string>* status_map);
62 void DumpFiles(const GURL& origin, const DumpFilesCallback& callback); 63 void DumpFiles(const GURL& origin, const DumpFilesCallback& callback);
64 scoped_ptr<base::ListValue> DumpDatabase();
63 65
64 // Returns the file |url|'s sync status. 66 // Returns the file |url|'s sync status.
65 void GetFileSyncStatus( 67 void GetFileSyncStatus(
66 const fileapi::FileSystemURL& url, 68 const fileapi::FileSystemURL& url,
67 const SyncFileStatusCallback& callback); 69 const SyncFileStatusCallback& callback);
68 70
69 void AddSyncEventObserver(SyncEventObserver* observer); 71 void AddSyncEventObserver(SyncEventObserver* observer);
70 void RemoveSyncEventObserver(SyncEventObserver* observer); 72 void RemoveSyncEventObserver(SyncEventObserver* observer);
71 73
72 ConflictResolutionPolicy GetConflictResolutionPolicy() const; 74 ConflictResolutionPolicy GetConflictResolutionPolicy() const;
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 bool sync_enabled_; 165 bool sync_enabled_;
164 166
165 ObserverList<SyncEventObserver> observers_; 167 ObserverList<SyncEventObserver> observers_;
166 168
167 DISALLOW_COPY_AND_ASSIGN(SyncFileSystemService); 169 DISALLOW_COPY_AND_ASSIGN(SyncFileSystemService);
168 }; 170 };
169 171
170 } // namespace sync_file_system 172 } // namespace sync_file_system
171 173
172 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_SYNC_FILE_SYSTEM_SERVICE_H_ 174 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_SYNC_FILE_SYSTEM_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698