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

Side by Side Diff: remoting/host/policy_hack/policy_watcher.cc

Issue 810133003: replace NULL->nullptr in src/remoting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // Most of this code is copied from: 5 // Most of this code is copied from:
6 // src/chrome/browser/policy/asynchronous_policy_loader.{h,cc} 6 // src/chrome/browser/policy/asynchronous_policy_loader.{h,cc}
7 7
8 #include "remoting/host/policy_hack/policy_watcher.h" 8 #include "remoting/host/policy_hack/policy_watcher.h"
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 22 matching lines...) Expand all
33 // |default| if they are not set in |from|, or values from |bad_type_values| if 33 // |default| if they are not set in |from|, or values from |bad_type_values| if
34 // the value in |from| has the wrong type. 34 // the value in |from| has the wrong type.
35 scoped_ptr<base::DictionaryValue> CopyGoodValuesAndAddDefaults( 35 scoped_ptr<base::DictionaryValue> CopyGoodValuesAndAddDefaults(
36 const base::DictionaryValue* from, 36 const base::DictionaryValue* from,
37 const base::DictionaryValue* default_values, 37 const base::DictionaryValue* default_values,
38 const base::DictionaryValue* bad_type_values) { 38 const base::DictionaryValue* bad_type_values) {
39 scoped_ptr<base::DictionaryValue> to(default_values->DeepCopy()); 39 scoped_ptr<base::DictionaryValue> to(default_values->DeepCopy());
40 for (base::DictionaryValue::Iterator i(*default_values); 40 for (base::DictionaryValue::Iterator i(*default_values);
41 !i.IsAtEnd(); i.Advance()) { 41 !i.IsAtEnd(); i.Advance()) {
42 42
43 const base::Value* value = NULL; 43 const base::Value* value = nullptr;
44 44
45 // If the policy isn't in |from|, use the default. 45 // If the policy isn't in |from|, use the default.
46 if (!from->Get(i.key(), &value)) { 46 if (!from->Get(i.key(), &value)) {
47 continue; 47 continue;
48 } 48 }
49 49
50 // If the policy is the wrong type, use the value from |bad_type_values|. 50 // If the policy is the wrong type, use the value from |bad_type_values|.
51 if (!value->IsType(i.value().GetType())) { 51 if (!value->IsType(i.value().GetType())) {
52 CHECK(bad_type_values->Get(i.key(), &value)); 52 CHECK(bad_type_values->Get(i.key(), &value));
53 } 53 }
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 void PolicyWatcher::SignalTransientPolicyError() { 246 void PolicyWatcher::SignalTransientPolicyError() {
247 const int kMaxRetryCount = 5; 247 const int kMaxRetryCount = 5;
248 transient_policy_error_retry_counter_ += 1; 248 transient_policy_error_retry_counter_ += 1;
249 if (transient_policy_error_retry_counter_ >= kMaxRetryCount) { 249 if (transient_policy_error_retry_counter_ >= kMaxRetryCount) {
250 SignalPolicyError(); 250 SignalPolicyError();
251 } 251 }
252 } 252 }
253 253
254 } // namespace policy_hack 254 } // namespace policy_hack
255 } // namespace remoting 255 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/pam_authorization_factory_posix.cc ('k') | remoting/host/policy_hack/policy_watcher_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698