OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |