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

Side by Side Diff: remoting/client/plugin/chromoting_instance.cc

Issue 7661009: base: Add Is* functions to Value class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix nat_policy.cc Created 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "remoting/client/plugin/chromoting_instance.h" 5 #include "remoting/client/plugin/chromoting_instance.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 std::string error_message; 451 std::string error_message;
452 scoped_ptr<base::Value> policy(base::JSONReader::ReadAndReturnError( 452 scoped_ptr<base::Value> policy(base::JSONReader::ReadAndReturnError(
453 policy_json, true, &error_code, &error_message)); 453 policy_json, true, &error_code, &error_message));
454 454
455 if (!policy.get()) { 455 if (!policy.get()) {
456 LOG(ERROR) << "Error " << error_code << " parsing policy: " 456 LOG(ERROR) << "Error " << error_code << " parsing policy: "
457 << error_message << "."; 457 << error_message << ".";
458 return false; 458 return false;
459 } 459 }
460 460
461 if (!policy->IsType(base::Value::TYPE_DICTIONARY)) { 461 if (!policy->IsDictionary()) {
462 LOG(ERROR) << "Policy must be a dictionary"; 462 LOG(ERROR) << "Policy must be a dictionary";
463 return false; 463 return false;
464 } 464 }
465 465
466 base::DictionaryValue* dictionary = 466 base::DictionaryValue* dictionary =
467 static_cast<base::DictionaryValue*>(policy.get()); 467 static_cast<base::DictionaryValue*>(policy.get());
468 bool traversal_policy = false; 468 bool traversal_policy = false;
469 if (!dictionary->GetBoolean(kClientFirewallTraversalPolicyName, 469 if (!dictionary->GetBoolean(kClientFirewallTraversalPolicyName,
470 &traversal_policy)) { 470 &traversal_policy)) {
471 // Disable NAT traversal on any failure of reading the policy. 471 // Disable NAT traversal on any failure of reading the policy.
(...skipping 20 matching lines...) Expand all
492 492
493 initial_policy_received_ = true; 493 initial_policy_received_ = true;
494 enable_client_nat_traversal_ = traversal_policy; 494 enable_client_nat_traversal_ = traversal_policy;
495 495
496 if (delayed_connect_.get()) { 496 if (delayed_connect_.get()) {
497 RunTaskOnPluginThread(delayed_connect_.release()); 497 RunTaskOnPluginThread(delayed_connect_.release());
498 } 498 }
499 } 499 }
500 500
501 } // namespace remoting 501 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698