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

Side by Side Diff: components/test_runner/tracked_dictionary.cc

Issue 1715573002: Replicating LayoutDumpFlags across OOPIFs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@replicating-pixel-dump-flag
Patch Set: Removed unneeded include. Created 4 years, 9 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 | « components/test_runner/tracked_dictionary.h ('k') | components/test_runner/web_test_delegate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "components/test_runner/tracked_dictionary.h"
6
7 #include <utility>
8
9 namespace test_runner {
10
11 TrackedDictionary::TrackedDictionary() {}
12
13 void TrackedDictionary::ResetChangeTracking() {
14 changed_values_.Clear();
15 }
16
17 void TrackedDictionary::ApplyUntrackedChanges(
18 const base::DictionaryValue& new_changes) {
19 current_values_.MergeDictionary(&new_changes);
20
21 for (base::DictionaryValue::Iterator it(new_changes); !it.IsAtEnd();
22 it.Advance()) {
23 changed_values_.Remove(it.key(), nullptr);
24 }
25 }
26
27 void TrackedDictionary::Set(const std::string& path,
28 scoped_ptr<base::Value> new_value) {
29 // Is this truly a *new* value?
30 const base::Value* old_value;
31 if (current_values_.Get(path, &old_value)) {
32 if (base::Value::Equals(old_value, new_value.get()))
33 return;
34 }
35
36 changed_values_.Set(path, new_value->CreateDeepCopy());
37 current_values_.Set(path, std::move(new_value));
38 }
39
40 void TrackedDictionary::SetBoolean(const std::string& path, bool new_value) {
41 Set(path, make_scoped_ptr(new base::FundamentalValue(new_value)));
42 }
43
44 } // namespace test_runner
OLDNEW
« no previous file with comments | « components/test_runner/tracked_dictionary.h ('k') | components/test_runner/web_test_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698