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

Unified Diff: components/sync/core_impl/js_mutation_event_observer.cc

Issue 2130453004: [Sync] Move //sync to //components/sync. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: components/sync/core_impl/js_mutation_event_observer.cc
diff --git a/sync/internal_api/js_mutation_event_observer.cc b/components/sync/core_impl/js_mutation_event_observer.cc
similarity index 80%
rename from sync/internal_api/js_mutation_event_observer.cc
rename to components/sync/core_impl/js_mutation_event_observer.cc
index 857d723e39e7cac6765b3707238a83b679d5bdbc..4321d06807a69ef65370f32dea6280d3f1c9bb5d 100644
--- a/sync/internal_api/js_mutation_event_observer.cc
+++ b/components/sync/core_impl/js_mutation_event_observer.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "sync/internal_api/js_mutation_event_observer.h"
+#include "components/sync/core_impl/js_mutation_event_observer.h"
#include <stddef.h>
#include <stdint.h>
@@ -13,13 +13,12 @@
#include "base/logging.h"
#include "base/strings/string_number_conversions.h"
#include "base/values.h"
-#include "sync/js/js_event_details.h"
-#include "sync/js/js_event_handler.h"
+#include "components/sync/js/js_event_details.h"
+#include "components/sync/js/js_event_handler.h"
namespace syncer {
-JsMutationEventObserver::JsMutationEventObserver()
- : weak_ptr_factory_(this) {}
+JsMutationEventObserver::JsMutationEventObserver() : weak_ptr_factory_(this) {}
JsMutationEventObserver::~JsMutationEventObserver() {
DCHECK(CalledOnValidThread());
@@ -61,15 +60,14 @@ void JsMutationEventObserver::OnChangesApplied(
const size_t changes_size = changes.Get().size();
if (changes_size <= kChangeLimit) {
base::ListValue* changes_list = new base::ListValue();
- for (ChangeRecordList::const_iterator it =
- changes.Get().begin(); it != changes.Get().end(); ++it) {
+ for (ChangeRecordList::const_iterator it = changes.Get().begin();
+ it != changes.Get().end(); ++it) {
changes_list->Append(it->ToValue());
}
changes_value = changes_list;
} else {
changes_value =
- new base::StringValue(
- base::SizeTToString(changes_size) + " changes");
+ new base::StringValue(base::SizeTToString(changes_size) + " changes");
}
details.Set("changes", changes_value);
HandleJsEvent(FROM_HERE, "onChangesApplied", JsEventDetails(&details));
@@ -94,20 +92,19 @@ void JsMutationEventObserver::OnTransactionWrite(
base::DictionaryValue details;
details.Set("writeTransactionInfo",
write_transaction_info.Get().ToValue(kChangeLimit));
- details.Set("modelsWithChanges",
- ModelTypeSetToValue(models_with_changes));
+ details.Set("modelsWithChanges", ModelTypeSetToValue(models_with_changes));
HandleJsEvent(FROM_HERE, "onTransactionWrite", JsEventDetails(&details));
}
void JsMutationEventObserver::HandleJsEvent(
const tracked_objects::Location& from_here,
- const std::string& name, const JsEventDetails& details) {
+ const std::string& name,
+ const JsEventDetails& details) {
if (!event_handler_.IsInitialized()) {
NOTREACHED();
return;
}
- event_handler_.Call(from_here,
- &JsEventHandler::HandleJsEvent, name, details);
+ event_handler_.Call(from_here, &JsEventHandler::HandleJsEvent, name, details);
}
} // namespace syncer

Powered by Google App Engine
This is Rietveld 408576698