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

Unified Diff: cc/proto/synced_property_conversions.cc

Issue 1736073002: cc: Move SyncedScrollOffset to scroll tree (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and add comment Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/proto/synced_property_conversions.h ('k') | cc/proto/synced_property_conversions_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/proto/synced_property_conversions.cc
diff --git a/cc/proto/synced_property_conversions.cc b/cc/proto/synced_property_conversions.cc
new file mode 100644
index 0000000000000000000000000000000000000000..09c8be2677731ae4b23d89b403f088285bb39afe
--- /dev/null
+++ b/cc/proto/synced_property_conversions.cc
@@ -0,0 +1,26 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "cc/proto/synced_property_conversions.h"
+
+#include "cc/proto/gfx_conversions.h"
+#include "cc/proto/synced_property.pb.h"
+
+namespace cc {
+
+void SyncedScrollOffsetToProto(const SyncedScrollOffset& synced_scroll_offset,
+ proto::SyncedProperty* proto) {
+ proto::ScrollOffsetGroup* data = proto->mutable_scroll_offset_group();
+ ScrollOffsetToProto(synced_scroll_offset.PendingBase(),
+ data->mutable_pending_base());
+}
+
+void ProtoToSyncedScrollOffset(const proto::SyncedProperty& proto,
+ SyncedScrollOffset* synced_scroll_offset) {
+ const proto::ScrollOffsetGroup& data = proto.scroll_offset_group();
+ synced_scroll_offset->PushFromMainThread(
+ ProtoToScrollOffset(data.pending_base()));
+}
+
+} // namespace cc
« no previous file with comments | « cc/proto/synced_property_conversions.h ('k') | cc/proto/synced_property_conversions_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698