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

Side by Side Diff: chrome/browser/sync/js_sync_manager_observer.cc

Issue 6546009: [Sync] Fix bug in JsSyncManagerObserver leading to erroneous change info. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 9 years, 10 months 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
« no previous file with comments | « no previous file | chrome/browser/sync/js_sync_manager_observer_unittest.cc » ('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) 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/js_sync_manager_observer.h" 5 #include "chrome/browser/sync/js_sync_manager_observer.h"
6 6
7 #include <cstddef> 7 #include <cstddef>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 16 matching lines...) Expand all
27 syncable::ModelType model_type, 27 syncable::ModelType model_type,
28 const sync_api::BaseTransaction* trans, 28 const sync_api::BaseTransaction* trans,
29 const sync_api::SyncManager::ChangeRecord* changes, 29 const sync_api::SyncManager::ChangeRecord* changes,
30 int change_count) { 30 int change_count) {
31 ListValue return_args; 31 ListValue return_args;
32 return_args.Append(Value::CreateStringValue( 32 return_args.Append(Value::CreateStringValue(
33 syncable::ModelTypeToString(model_type))); 33 syncable::ModelTypeToString(model_type)));
34 ListValue* change_values = new ListValue(); 34 ListValue* change_values = new ListValue();
35 return_args.Append(change_values); 35 return_args.Append(change_values);
36 for (int i = 0; i < change_count; ++i) { 36 for (int i = 0; i < change_count; ++i) {
37 change_values->Append(changes->ToValue(trans)); 37 change_values->Append(changes[i].ToValue(trans));
38 } 38 }
39 parent_router_->RouteJsEvent("onChangesApplied", 39 parent_router_->RouteJsEvent("onChangesApplied",
40 JsArgList(return_args), NULL); 40 JsArgList(return_args), NULL);
41 } 41 }
42 42
43 void JsSyncManagerObserver::OnChangesComplete( 43 void JsSyncManagerObserver::OnChangesComplete(
44 syncable::ModelType model_type) { 44 syncable::ModelType model_type) {
45 ListValue return_args; 45 ListValue return_args;
46 return_args.Append(Value::CreateStringValue( 46 return_args.Append(Value::CreateStringValue(
47 syncable::ModelTypeToString(model_type))); 47 syncable::ModelTypeToString(model_type)));
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 void JsSyncManagerObserver::OnClearServerDataSucceeded() { 108 void JsSyncManagerObserver::OnClearServerDataSucceeded() {
109 parent_router_->RouteJsEvent("onClearServerDataSucceeded", 109 parent_router_->RouteJsEvent("onClearServerDataSucceeded",
110 JsArgList(), NULL); 110 JsArgList(), NULL);
111 } 111 }
112 112
113 void JsSyncManagerObserver::OnClearServerDataFailed() { 113 void JsSyncManagerObserver::OnClearServerDataFailed() {
114 parent_router_->RouteJsEvent("onClearServerDataFailed", JsArgList(), NULL); 114 parent_router_->RouteJsEvent("onClearServerDataFailed", JsArgList(), NULL);
115 } 115 }
116 116
117 } // namespace browser_sync 117 } // namespace browser_sync
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sync/js_sync_manager_observer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698