| 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 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 500 std::string error_message; | 500 std::string error_message; |
| 501 scoped_ptr<base::Value> policy(base::JSONReader::ReadAndReturnError( | 501 scoped_ptr<base::Value> policy(base::JSONReader::ReadAndReturnError( |
| 502 policy_json, true, &error_code, &error_message)); | 502 policy_json, true, &error_code, &error_message)); |
| 503 | 503 |
| 504 if (!policy.get()) { | 504 if (!policy.get()) { |
| 505 LOG(ERROR) << "Error " << error_code << " parsing policy: " | 505 LOG(ERROR) << "Error " << error_code << " parsing policy: " |
| 506 << error_message << "."; | 506 << error_message << "."; |
| 507 return false; | 507 return false; |
| 508 } | 508 } |
| 509 | 509 |
| 510 if (!policy->IsType(base::Value::TYPE_DICTIONARY)) { | 510 if (!policy->IsDictionary()) { |
| 511 LOG(ERROR) << "Policy must be a dictionary"; | 511 LOG(ERROR) << "Policy must be a dictionary"; |
| 512 return false; | 512 return false; |
| 513 } | 513 } |
| 514 | 514 |
| 515 base::DictionaryValue* dictionary = | 515 base::DictionaryValue* dictionary = |
| 516 static_cast<base::DictionaryValue*>(policy.get()); | 516 static_cast<base::DictionaryValue*>(policy.get()); |
| 517 bool traversal_policy = false; | 517 bool traversal_policy = false; |
| 518 if (!dictionary->GetBoolean(kClientFirewallTraversalPolicyName, | 518 if (!dictionary->GetBoolean(kClientFirewallTraversalPolicyName, |
| 519 &traversal_policy)) { | 519 &traversal_policy)) { |
| 520 // Disable NAT traversal on any failure of reading the policy. | 520 // Disable NAT traversal on any failure of reading the policy. |
| (...skipping 20 matching lines...) Expand all Loading... |
| 541 | 541 |
| 542 initial_policy_received_ = true; | 542 initial_policy_received_ = true; |
| 543 enable_client_nat_traversal_ = traversal_policy; | 543 enable_client_nat_traversal_ = traversal_policy; |
| 544 | 544 |
| 545 if (delayed_connect_.get()) { | 545 if (delayed_connect_.get()) { |
| 546 RunTaskOnPluginThread(delayed_connect_.release()); | 546 RunTaskOnPluginThread(delayed_connect_.release()); |
| 547 } | 547 } |
| 548 } | 548 } |
| 549 | 549 |
| 550 } // namespace remoting | 550 } // namespace remoting |
| OLD | NEW |