| OLD | NEW |
| 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/sync/engine_impl/js_mutation_event_observer.h" | 5 #include "components/sync/engine_impl/js_mutation_event_observer.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 ModelType model_type, | 46 ModelType model_type, |
| 47 int64_t write_transaction_id, | 47 int64_t write_transaction_id, |
| 48 const ImmutableChangeRecordList& changes) { | 48 const ImmutableChangeRecordList& changes) { |
| 49 if (!event_handler_.IsInitialized()) { | 49 if (!event_handler_.IsInitialized()) { |
| 50 return; | 50 return; |
| 51 } | 51 } |
| 52 base::DictionaryValue details; | 52 base::DictionaryValue details; |
| 53 details.SetString("modelType", ModelTypeToString(model_type)); | 53 details.SetString("modelType", ModelTypeToString(model_type)); |
| 54 details.SetString("writeTransactionId", | 54 details.SetString("writeTransactionId", |
| 55 base::Int64ToString(write_transaction_id)); | 55 base::Int64ToString(write_transaction_id)); |
| 56 base::Value* changes_value = NULL; | 56 base::Value* changes_value = nullptr; |
| 57 const size_t changes_size = changes.Get().size(); | 57 const size_t changes_size = changes.Get().size(); |
| 58 if (changes_size <= kChangeLimit) { | 58 if (changes_size <= kChangeLimit) { |
| 59 base::ListValue* changes_list = new base::ListValue(); | 59 base::ListValue* changes_list = new base::ListValue(); |
| 60 for (ChangeRecordList::const_iterator it = changes.Get().begin(); | 60 for (ChangeRecordList::const_iterator it = changes.Get().begin(); |
| 61 it != changes.Get().end(); ++it) { | 61 it != changes.Get().end(); ++it) { |
| 62 changes_list->Append(it->ToValue()); | 62 changes_list->Append(it->ToValue()); |
| 63 } | 63 } |
| 64 changes_value = changes_list; | 64 changes_value = changes_list; |
| 65 } else { | 65 } else { |
| 66 changes_value = | 66 changes_value = |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 const std::string& name, | 98 const std::string& name, |
| 99 const JsEventDetails& details) { | 99 const JsEventDetails& details) { |
| 100 if (!event_handler_.IsInitialized()) { | 100 if (!event_handler_.IsInitialized()) { |
| 101 NOTREACHED(); | 101 NOTREACHED(); |
| 102 return; | 102 return; |
| 103 } | 103 } |
| 104 event_handler_.Call(from_here, &JsEventHandler::HandleJsEvent, name, details); | 104 event_handler_.Call(from_here, &JsEventHandler::HandleJsEvent, name, details); |
| 105 } | 105 } |
| 106 | 106 |
| 107 } // namespace syncer | 107 } // namespace syncer |
| OLD | NEW |