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

Side by Side Diff: components/browser_sync/profile_sync_service.cc

Issue 2475043002: [Sync] Sync client should to exponential backoff when receive partial failure (Closed)
Patch Set: rebase Created 4 years, 1 month 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
« no previous file with comments | « no previous file | components/sync/engine/sync_status.h » ('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 #include "components/browser_sync/profile_sync_service.h" 5 #include "components/browser_sync/profile_sync_service.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <cstddef> 9 #include <cstddef>
10 #include <map> 10 #include <map>
(...skipping 1848 matching lines...) Expand 10 before | Expand all | Expand 10 after
1859 it != routing_info.end(); ++it) { 1859 it != routing_info.end(); ++it) {
1860 if (it->second == syncer::GROUP_PASSIVE) { 1860 if (it->second == syncer::GROUP_PASSIVE) {
1861 passive_types.Put(it->first); 1861 passive_types.Put(it->first);
1862 } else { 1862 } else {
1863 active_types.Put(it->first); 1863 active_types.Put(it->first);
1864 } 1864 }
1865 } 1865 }
1866 1866
1867 SyncBackendHost::Status detailed_status = backend_->GetDetailedStatus(); 1867 SyncBackendHost::Status detailed_status = backend_->GetDetailedStatus();
1868 ModelTypeSet& throttled_types(detailed_status.throttled_types); 1868 ModelTypeSet& throttled_types(detailed_status.throttled_types);
1869 ModelTypeSet& backed_off_types(detailed_status.backed_off_types);
1869 ModelTypeSet registered = GetRegisteredDataTypes(); 1870 ModelTypeSet registered = GetRegisteredDataTypes();
1870 std::unique_ptr<base::DictionaryValue> type_status_header( 1871 std::unique_ptr<base::DictionaryValue> type_status_header(
1871 new base::DictionaryValue()); 1872 new base::DictionaryValue());
1872 1873
1873 type_status_header->SetString("name", "Model Type"); 1874 type_status_header->SetString("name", "Model Type");
1874 type_status_header->SetString("status", "header"); 1875 type_status_header->SetString("status", "header");
1875 type_status_header->SetString("value", "Group Type"); 1876 type_status_header->SetString("value", "Group Type");
1876 type_status_header->SetString("num_entries", "Total Entries"); 1877 type_status_header->SetString("num_entries", "Total Entries");
1877 type_status_header->SetString("num_live", "Live Entries"); 1878 type_status_header->SetString("num_live", "Live Entries");
1878 result->Append(std::move(type_status_header)); 1879 result->Append(std::move(type_status_header));
(...skipping 24 matching lines...) Expand all
1903 break; 1904 break;
1904 } 1905 }
1905 } else if (syncer::IsProxyType(type) && passive_types.Has(type)) { 1906 } else if (syncer::IsProxyType(type) && passive_types.Has(type)) {
1906 // Show a proxy type in "ok" state unless it is disabled by user. 1907 // Show a proxy type in "ok" state unless it is disabled by user.
1907 DCHECK(!throttled_types.Has(type)); 1908 DCHECK(!throttled_types.Has(type));
1908 type_status->SetString("status", "ok"); 1909 type_status->SetString("status", "ok");
1909 type_status->SetString("value", "Passive"); 1910 type_status->SetString("value", "Passive");
1910 } else if (throttled_types.Has(type) && passive_types.Has(type)) { 1911 } else if (throttled_types.Has(type) && passive_types.Has(type)) {
1911 type_status->SetString("status", "warning"); 1912 type_status->SetString("status", "warning");
1912 type_status->SetString("value", "Passive, Throttled"); 1913 type_status->SetString("value", "Passive, Throttled");
1914 } else if (backed_off_types.Has(type) && passive_types.Has(type)) {
1915 type_status->SetString("status", "warning");
1916 type_status->SetString("value", "Passive, Backed off");
1913 } else if (passive_types.Has(type)) { 1917 } else if (passive_types.Has(type)) {
1914 type_status->SetString("status", "warning"); 1918 type_status->SetString("status", "warning");
1915 type_status->SetString("value", "Passive"); 1919 type_status->SetString("value", "Passive");
1916 } else if (throttled_types.Has(type)) { 1920 } else if (throttled_types.Has(type)) {
1917 type_status->SetString("status", "warning"); 1921 type_status->SetString("status", "warning");
1918 type_status->SetString("value", "Throttled"); 1922 type_status->SetString("value", "Throttled");
1923 } else if (backed_off_types.Has(type)) {
1924 type_status->SetString("status", "warning");
1925 type_status->SetString("value", "Backed off");
1919 } else if (active_types.Has(type)) { 1926 } else if (active_types.Has(type)) {
1920 type_status->SetString("status", "ok"); 1927 type_status->SetString("status", "ok");
1921 type_status->SetString( 1928 type_status->SetString(
1922 "value", "Active: " + ModelSafeGroupToString(routing_info[type])); 1929 "value", "Active: " + ModelSafeGroupToString(routing_info[type]));
1923 } else { 1930 } else {
1924 type_status->SetString("status", "warning"); 1931 type_status->SetString("status", "warning");
1925 type_status->SetString("value", "Disabled by User"); 1932 type_status->SetString("value", "Disabled by User");
1926 } 1933 }
1927 1934
1928 const auto& dtc_iter = data_type_controllers_.find(type); 1935 const auto& dtc_iter = data_type_controllers_.find(type);
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after
2525 2532
2526 DCHECK(startup_controller_->IsSetupInProgress()); 2533 DCHECK(startup_controller_->IsSetupInProgress());
2527 startup_controller_->SetSetupInProgress(false); 2534 startup_controller_->SetSetupInProgress(false);
2528 2535
2529 if (IsBackendInitialized()) 2536 if (IsBackendInitialized())
2530 ReconfigureDatatypeManager(); 2537 ReconfigureDatatypeManager();
2531 NotifyObservers(); 2538 NotifyObservers();
2532 } 2539 }
2533 2540
2534 } // namespace browser_sync 2541 } // namespace browser_sync
OLDNEW
« no previous file with comments | « no previous file | components/sync/engine/sync_status.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698