OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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/engine/process_commit_response_command.h" | 5 #include "chrome/browser/sync/engine/process_commit_response_command.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 | 45 |
46 void IncrementErrorCounters(SyncerStatus status) { | 46 void IncrementErrorCounters(SyncerStatus status) { |
47 status.increment_consecutive_problem_commits(); | 47 status.increment_consecutive_problem_commits(); |
48 status.increment_consecutive_errors(); | 48 status.increment_consecutive_errors(); |
49 } | 49 } |
50 void ResetErrorCounters(SyncerStatus status) { | 50 void ResetErrorCounters(SyncerStatus status) { |
51 status.zero_consecutive_problem_commits(); | 51 status.zero_consecutive_problem_commits(); |
52 status.zero_consecutive_errors(); | 52 status.zero_consecutive_errors(); |
53 } | 53 } |
54 | 54 |
55 ProcessCommitResponseCommand::ProcessCommitResponseCommand( | 55 ProcessCommitResponseCommand::ProcessCommitResponseCommand() {} |
56 ExtensionsActivityMonitor* monitor) : extensions_monitor_(monitor) {} | |
57 ProcessCommitResponseCommand::~ProcessCommitResponseCommand() {} | 56 ProcessCommitResponseCommand::~ProcessCommitResponseCommand() {} |
58 | 57 |
59 void ProcessCommitResponseCommand::ModelChangingExecuteImpl( | 58 void ProcessCommitResponseCommand::ModelChangingExecuteImpl( |
60 SyncerSession* session) { | 59 SyncerSession* session) { |
61 ProcessCommitResponse(session); | |
62 if (!session->HadSuccessfulCommits()) | |
63 extensions_monitor_->PutRecords(session->extensions_activity()); | |
64 } | |
65 | |
66 void ProcessCommitResponseCommand::ProcessCommitResponse( | |
67 SyncerSession* session) { | |
68 // TODO(sync): This function returns if it sees problems. We probably want | 60 // TODO(sync): This function returns if it sees problems. We probably want |
69 // to flag the need for an update or similar. | 61 // to flag the need for an update or similar. |
70 ScopedDirLookup dir(session->dirman(), session->account_name()); | 62 ScopedDirLookup dir(session->dirman(), session->account_name()); |
71 if (!dir.good()) { | 63 if (!dir.good()) { |
72 LOG(ERROR) << "Scoped dir lookup failed!"; | 64 LOG(ERROR) << "Scoped dir lookup failed!"; |
73 return; | 65 return; |
74 } | 66 } |
75 const ClientToServerResponse& response = session->commit_response(); | 67 const ClientToServerResponse& response = session->commit_response(); |
76 const vector<syncable::Id>& commit_ids = session->commit_ids(); | 68 const vector<syncable::Id>& commit_ids = session->commit_ids(); |
77 | 69 |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 | 364 |
373 LOG(INFO) << "Server commit moved aside entry: " << old_name.db_value() | 365 LOG(INFO) << "Server commit moved aside entry: " << old_name.db_value() |
374 << " to new name " << db_name; | 366 << " to new name " << db_name; |
375 | 367 |
376 // Should be safe since we're in a "commit lock." | 368 // Should be safe since we're in a "commit lock." |
377 local_entry->PutName(Name::FromDBNameAndSyncName(db_name, server_name)); | 369 local_entry->PutName(Name::FromDBNameAndSyncName(db_name, server_name)); |
378 } | 370 } |
379 } | 371 } |
380 | 372 |
381 } // namespace browser_sync | 373 } // namespace browser_sync |
OLD | NEW |