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

Side by Side Diff: components/sync/engine_impl/commit_util.cc

Issue 2258873003: [Sync] Move sessions/ to engine/cycle/ and rename things to match. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 4 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/commit_util.h" 5 #include "components/sync/engine_impl/commit_util.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <limits> 9 #include <limits>
10 #include <set> 10 #include <set>
11 #include <string> 11 #include <string>
12 #include <vector> 12 #include <vector>
13 13
14 #include "base/debug/dump_without_crashing.h" 14 #include "base/debug/dump_without_crashing.h"
15 #include "base/strings/string_util.h" 15 #include "base/strings/string_util.h"
16 #include "components/sync/base/attachment_id_proto.h" 16 #include "components/sync/base/attachment_id_proto.h"
17 #include "components/sync/base/time.h" 17 #include "components/sync/base/time.h"
18 #include "components/sync/base/unique_position.h" 18 #include "components/sync/base/unique_position.h"
19 #include "components/sync/engine_impl/cycle/sync_cycle.h"
skym 2016/08/19 17:17:42 I don't think this import actually does anything,
maxbogue 2016/08/19 19:12:00 Removed.
19 #include "components/sync/engine_impl/syncer_proto_util.h" 20 #include "components/sync/engine_impl/syncer_proto_util.h"
20 #include "components/sync/protocol/bookmark_specifics.pb.h" 21 #include "components/sync/protocol/bookmark_specifics.pb.h"
21 #include "components/sync/protocol/sync.pb.h" 22 #include "components/sync/protocol/sync.pb.h"
22 #include "components/sync/sessions_impl/sync_session.h"
23 #include "components/sync/syncable/directory.h" 23 #include "components/sync/syncable/directory.h"
24 #include "components/sync/syncable/entry.h" 24 #include "components/sync/syncable/entry.h"
25 #include "components/sync/syncable/model_neutral_mutable_entry.h" 25 #include "components/sync/syncable/model_neutral_mutable_entry.h"
26 #include "components/sync/syncable/syncable_base_transaction.h" 26 #include "components/sync/syncable/syncable_base_transaction.h"
27 #include "components/sync/syncable/syncable_base_write_transaction.h" 27 #include "components/sync/syncable/syncable_base_write_transaction.h"
28 #include "components/sync/syncable/syncable_changes_version.h" 28 #include "components/sync/syncable/syncable_changes_version.h"
29 #include "components/sync/syncable/syncable_proto_util.h" 29 #include "components/sync/syncable/syncable_proto_util.h"
30 #include "components/sync/syncable/syncable_util.h" 30 #include "components/sync/syncable/syncable_util.h"
31 31
32 using std::set; 32 using std::set;
33 using std::string; 33 using std::string;
34 using std::vector; 34 using std::vector;
35 35
36 namespace syncer { 36 namespace syncer {
37 37
38 using syncable::Entry; 38 using syncable::Entry;
39 using syncable::Id; 39 using syncable::Id;
40 40
41 namespace commit_util { 41 namespace commit_util {
42 42
43 void AddExtensionsActivityToMessage( 43 void AddExtensionsActivityToMessage(
skym 2016/08/19 17:17:42 Was this like required for stars? And we can rip o
maxbogue 2016/08/19 19:12:00 I don't think it was for stars; looks like it was
44 ExtensionsActivity* activity, 44 ExtensionsActivity* activity,
45 ExtensionsActivity::Records* extensions_activity_buffer, 45 ExtensionsActivity::Records* extensions_activity_buffer,
46 sync_pb::CommitMessage* message) { 46 sync_pb::CommitMessage* message) {
47 // This isn't perfect, since the set of extensions activity may not correlate 47 // This isn't perfect, since the set of extensions activity may not correlate
48 // exactly with the items being committed. That's OK as long as we're looking 48 // exactly with the items being committed. That's OK as long as we're looking
49 // for a rough estimate of extensions activity, not an precise mapping of 49 // for a rough estimate of extensions activity, not an precise mapping of
50 // which commits were triggered by which extension. 50 // which commits were triggered by which extension.
51 // 51 //
52 // We will push this list of extensions activity back into the 52 // We will push this list of extensions activity back into the
53 // ExtensionsActivityMonitor if this commit fails. That's why we must keep a 53 // ExtensionsActivityMonitor if this commit fails. That's why we must keep a
54 // copy of these records in the session. 54 // copy of these records in the cycle.
55 activity->GetAndClearRecords(extensions_activity_buffer); 55 activity->GetAndClearRecords(extensions_activity_buffer);
56 56
57 const ExtensionsActivity::Records& records = *extensions_activity_buffer; 57 const ExtensionsActivity::Records& records = *extensions_activity_buffer;
58 for (ExtensionsActivity::Records::const_iterator it = records.begin(); 58 for (ExtensionsActivity::Records::const_iterator it = records.begin();
59 it != records.end(); ++it) { 59 it != records.end(); ++it) {
60 sync_pb::ChromiumExtensionsActivity* activity_message = 60 sync_pb::ChromiumExtensionsActivity* activity_message =
61 message->add_extensions_activity(); 61 message->add_extensions_activity();
62 activity_message->set_extension_id(it->second.extension_id); 62 activity_message->set_extension_id(it->second.extension_id);
63 activity_message->set_bookmark_writes_since_last_commit( 63 activity_message->set_bookmark_writes_since_last_commit(
64 it->second.bookmark_write_count); 64 it->second.bookmark_write_count);
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 452
453 ProcessSuccessfulCommitResponse(commit_request_entry, server_entry, 453 ProcessSuccessfulCommitResponse(commit_request_entry, server_entry,
454 local_entry.GetId(), &local_entry, 454 local_entry.GetId(), &local_entry,
455 dirty_sync_was_set, deleted_folders); 455 dirty_sync_was_set, deleted_folders);
456 return response; 456 return response;
457 } 457 }
458 458
459 } // namespace commit_util 459 } // namespace commit_util
460 460
461 } // namespace syncer 461 } // namespace syncer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698