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

Side by Side Diff: chrome/browser/sync/sessions/status_controller.cc

Issue 8771044: Revert 112743 - [Sync] Make syncer commands avoid posting tasks on threads with no work to do (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/sessions/status_controller.h" 5 #include "chrome/browser/sync/sessions/status_controller.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "chrome/browser/sync/protocol/sync_protocol_error.h" 10 #include "chrome/browser/sync/protocol/sync_protocol_error.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 true, group_restriction_)->conflict_progress; 55 true, group_restriction_)->conflict_progress;
56 } 56 }
57 57
58 const ConflictProgress* StatusController::GetUnrestrictedConflictProgress( 58 const ConflictProgress* StatusController::GetUnrestrictedConflictProgress(
59 ModelSafeGroup group) const { 59 ModelSafeGroup group) const {
60 const PerModelSafeGroupState* state = 60 const PerModelSafeGroupState* state =
61 GetModelSafeGroupState(false, group); 61 GetModelSafeGroupState(false, group);
62 return state ? &state->conflict_progress : NULL; 62 return state ? &state->conflict_progress : NULL;
63 } 63 }
64 64
65 ConflictProgress*
66 StatusController::GetUnrestrictedMutableConflictProgressForTest(
67 ModelSafeGroup group) {
68 return &GetOrCreateModelSafeGroupState(false, group)->conflict_progress;
69 }
70
71 const UpdateProgress* StatusController::GetUnrestrictedUpdateProgress( 65 const UpdateProgress* StatusController::GetUnrestrictedUpdateProgress(
72 ModelSafeGroup group) const { 66 ModelSafeGroup group) const {
73 const PerModelSafeGroupState* state = 67 const PerModelSafeGroupState* state =
74 GetModelSafeGroupState(false, group); 68 GetModelSafeGroupState(false, group);
75 return state ? &state->update_progress : NULL; 69 return state ? &state->update_progress : NULL;
76 } 70 }
77 71
78 UpdateProgress*
79 StatusController::GetUnrestrictedMutableUpdateProgressForTest(
80 ModelSafeGroup group) {
81 return &GetOrCreateModelSafeGroupState(false, group)->update_progress;
82 }
83
84 const PerModelSafeGroupState* StatusController::GetModelSafeGroupState( 72 const PerModelSafeGroupState* StatusController::GetModelSafeGroupState(
85 bool restrict, ModelSafeGroup group) const { 73 bool restrict, ModelSafeGroup group) const {
86 DCHECK_EQ(restrict, group_restriction_in_effect_); 74 DCHECK_EQ(restrict, group_restriction_in_effect_);
87 std::map<ModelSafeGroup, PerModelSafeGroupState*>::const_iterator it = 75 std::map<ModelSafeGroup, PerModelSafeGroupState*>::const_iterator it =
88 per_model_group_.find(group); 76 per_model_group_.find(group);
89 return (it == per_model_group_.end()) ? NULL : it->second; 77 return (it == per_model_group_.end()) ? NULL : it->second;
90 } 78 }
91 79
92 PerModelSafeGroupState* StatusController::GetOrCreateModelSafeGroupState( 80 PerModelSafeGroupState* StatusController::GetOrCreateModelSafeGroupState(
93 bool restrict, ModelSafeGroup group) { 81 bool restrict, ModelSafeGroup group) {
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 void StatusController::set_debug_info_sent() { 290 void StatusController::set_debug_info_sent() {
303 shared_.control_params.debug_info_sent = true; 291 shared_.control_params.debug_info_sent = true;
304 } 292 }
305 293
306 bool StatusController::debug_info_sent() const { 294 bool StatusController::debug_info_sent() const {
307 return shared_.control_params.debug_info_sent; 295 return shared_.control_params.debug_info_sent;
308 } 296 }
309 297
310 } // namespace sessions 298 } // namespace sessions
311 } // namespace browser_sync 299 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/sessions/status_controller.h ('k') | chrome/browser/sync/sessions/sync_session.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698