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

Side by Side Diff: cc/trees/property_tree.cc

Issue 1886973005: cc: Clear the |layer_id_to_scroll_offset_map_| during ScrollTree deserialization . (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add back previous test expectation. Created 4 years, 8 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
« no previous file with comments | « no previous file | cc/trees/property_tree_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include <set> 7 #include <set>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 1444 matching lines...) Expand 10 before | Expand all | Expand 10 after
1455 1455
1456 void ScrollTree::FromProtobuf(const proto::PropertyTree& proto) { 1456 void ScrollTree::FromProtobuf(const proto::PropertyTree& proto) {
1457 DCHECK(proto.has_property_type()); 1457 DCHECK(proto.has_property_type());
1458 DCHECK_EQ(proto.property_type(), proto::PropertyTree::Scroll); 1458 DCHECK_EQ(proto.property_type(), proto::PropertyTree::Scroll);
1459 1459
1460 PropertyTree::FromProtobuf(proto); 1460 PropertyTree::FromProtobuf(proto);
1461 const proto::ScrollTreeData& data = proto.scroll_tree_data(); 1461 const proto::ScrollTreeData& data = proto.scroll_tree_data();
1462 1462
1463 currently_scrolling_node_id_ = data.currently_scrolling_node_id(); 1463 currently_scrolling_node_id_ = data.currently_scrolling_node_id();
1464 1464
1465 // TODO(khushalsagar): This should probably be removed if the copy constructor
1466 // for ScrollTree copies the |layer_id_to_scroll_offset_map_| as well.
1467 layer_id_to_scroll_offset_map_.clear();
1465 for (int i = 0; i < data.layer_id_to_scroll_offset_map_size(); ++i) { 1468 for (int i = 0; i < data.layer_id_to_scroll_offset_map_size(); ++i) {
1466 const proto::ScrollOffsetMapEntry entry = 1469 const proto::ScrollOffsetMapEntry entry =
1467 data.layer_id_to_scroll_offset_map(i); 1470 data.layer_id_to_scroll_offset_map(i);
1468 layer_id_to_scroll_offset_map_[entry.layer_id()] = new SyncedScrollOffset(); 1471 layer_id_to_scroll_offset_map_[entry.layer_id()] = new SyncedScrollOffset();
1469 ProtoToSyncedScrollOffset( 1472 ProtoToSyncedScrollOffset(
1470 entry.scroll_offset(), 1473 entry.scroll_offset(),
1471 layer_id_to_scroll_offset_map_[entry.layer_id()].get()); 1474 layer_id_to_scroll_offset_map_[entry.layer_id()].get());
1472 } 1475 }
1473 } 1476 }
1474 1477
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after
1938 break; 1941 break;
1939 case ALL_TREES: 1942 case ALL_TREES:
1940 transform_tree.ResetChangeTracking(); 1943 transform_tree.ResetChangeTracking();
1941 effect_tree.ResetChangeTracking(); 1944 effect_tree.ResetChangeTracking();
1942 } 1945 }
1943 changed = false; 1946 changed = false;
1944 full_tree_damaged = false; 1947 full_tree_damaged = false;
1945 } 1948 }
1946 1949
1947 } // namespace cc 1950 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/trees/property_tree_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698