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

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: tony review 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
« no previous file with comments | « net/test/test_server.cc ('k') | remoting/host/json_host_config.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « net/test/test_server.cc ('k') | remoting/host/json_host_config.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698