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

Side by Side Diff: chrome/browser/sync/js/js_transaction_observer.cc

Issue 7904021: [Sync] Rework SharedValue<T> into Immutable<T> (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rename vars Created 9 years, 3 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
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/js_transaction_observer.h" 5 #include "chrome/browser/sync/js/js_transaction_observer.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/string_number_conversions.h" 10 #include "base/string_number_conversions.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 53
54 // Max number of mutations we attempt to convert to values (to avoid 54 // Max number of mutations we attempt to convert to values (to avoid
55 // running out of memory). 55 // running out of memory).
56 const size_t kMutationLimit = 300; 56 const size_t kMutationLimit = 300;
57 57
58 } // namespace 58 } // namespace
59 59
60 void JsTransactionObserver::OnTransactionMutate( 60 void JsTransactionObserver::OnTransactionMutate(
61 const tracked_objects::Location& location, 61 const tracked_objects::Location& location,
62 const syncable::WriterTag& writer, 62 const syncable::WriterTag& writer,
63 const syncable::SharedEntryKernelMutationMap& mutations, 63 const syncable::ImmutableEntryKernelMutationMap& mutations,
64 const syncable::ModelTypeBitSet& models_with_changes) { 64 const syncable::ModelTypeBitSet& models_with_changes) {
65 DCHECK(non_thread_safe_.CalledOnValidThread()); 65 DCHECK(non_thread_safe_.CalledOnValidThread());
66 if (!event_handler_.IsInitialized()) { 66 if (!event_handler_.IsInitialized()) {
67 return; 67 return;
68 } 68 }
69 DictionaryValue details; 69 DictionaryValue details;
70 details.SetString("location", GetLocationString(location)); 70 details.SetString("location", GetLocationString(location));
71 details.SetString("writer", syncable::WriterTagToString(writer)); 71 details.SetString("writer", syncable::WriterTagToString(writer));
72 Value* mutations_value = NULL; 72 Value* mutations_value = NULL;
73 const size_t mutations_size = mutations.Get().size(); 73 const size_t mutations_size = mutations.Get().size();
(...skipping 29 matching lines...) Expand all
103 const std::string& name, const JsEventDetails& details) { 103 const std::string& name, const JsEventDetails& details) {
104 if (!event_handler_.IsInitialized()) { 104 if (!event_handler_.IsInitialized()) {
105 NOTREACHED(); 105 NOTREACHED();
106 return; 106 return;
107 } 107 }
108 event_handler_.Call(from_here, 108 event_handler_.Call(from_here,
109 &JsEventHandler::HandleJsEvent, name, details); 109 &JsEventHandler::HandleJsEvent, name, details);
110 } 110 }
111 111
112 } // namespace browser_sync 112 } // namespace browser_sync
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698