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

Side by Side Diff: chrome/browser/sync_file_system/drive_backend/sync_engine.cc

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: 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include "chrome/browser/sync_file_system/drive_backend/sync_engine.h" 5 #include "chrome/browser/sync_file_system/drive_backend/sync_engine.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/threading/sequenced_worker_pool.h" 8 #include "base/threading/sequenced_worker_pool.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "chrome/browser/drive/drive_api_service.h" 10 #include "chrome/browser/drive/drive_api_service.h"
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 metadata_database_->IsAppEnabled(app_id) ? "Enabled" : "Disabled"; 232 metadata_database_->IsAppEnabled(app_id) ? "Enabled" : "Disabled";
233 } 233 }
234 } 234 }
235 235
236 scoped_ptr<base::ListValue> SyncEngine::DumpFiles(const GURL& origin) { 236 scoped_ptr<base::ListValue> SyncEngine::DumpFiles(const GURL& origin) {
237 if (!metadata_database_) 237 if (!metadata_database_)
238 return scoped_ptr<base::ListValue>(); 238 return scoped_ptr<base::ListValue>();
239 return metadata_database_->DumpFiles(origin.host()); 239 return metadata_database_->DumpFiles(origin.host());
240 } 240 }
241 241
242 scoped_ptr<base::ListValue> SyncEngine::DumpDatabase() {
243 if (!metadata_database_)
244 return scoped_ptr<base::ListValue>();
245 return metadata_database_->DumpDatabase();
246 }
247
242 void SyncEngine::SetSyncEnabled(bool enabled) { 248 void SyncEngine::SetSyncEnabled(bool enabled) {
243 if (sync_enabled_ == enabled) 249 if (sync_enabled_ == enabled)
244 return; 250 return;
245 251
246 RemoteServiceState old_state = GetCurrentState(); 252 RemoteServiceState old_state = GetCurrentState();
247 sync_enabled_ = enabled; 253 sync_enabled_ = enabled;
248 if (old_state == GetCurrentState()) 254 if (old_state == GetCurrentState())
249 return; 255 return;
250 256
251 const char* status_message = enabled ? "Sync is enabled" : "Sync is disabled"; 257 const char* status_message = enabled ? "Sync is enabled" : "Sync is disabled";
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
596 tracker.tracker_kind() == TRACKER_KIND_APP_ROOT; 602 tracker.tracker_kind() == TRACKER_KIND_APP_ROOT;
597 if (is_app_enabled && !is_app_root_tracker_enabled) 603 if (is_app_enabled && !is_app_root_tracker_enabled)
598 EnableOrigin(origin, base::Bind(&EmptyStatusCallback)); 604 EnableOrigin(origin, base::Bind(&EmptyStatusCallback));
599 else if (!is_app_enabled && is_app_root_tracker_enabled) 605 else if (!is_app_enabled && is_app_root_tracker_enabled)
600 DisableOrigin(origin, base::Bind(&EmptyStatusCallback)); 606 DisableOrigin(origin, base::Bind(&EmptyStatusCallback));
601 } 607 }
602 } 608 }
603 609
604 } // namespace drive_backend 610 } // namespace drive_backend
605 } // namespace sync_file_system 611 } // namespace sync_file_system
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698