| 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/host/plugin/host_script_object.h" | 5 #include "remoting/host/plugin/host_script_object.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/message_loop_proxy.h" | 9 #include "base/message_loop_proxy.h" |
| 10 #include "base/sys_string_conversions.h" | 10 #include "base/sys_string_conversions.h" |
| (...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 646 | 646 |
| 647 if (!success) { | 647 if (!success) { |
| 648 host_context_.main_message_loop()->PostTask(FROM_HERE, base::Bind( | 648 host_context_.main_message_loop()->PostTask(FROM_HERE, base::Bind( |
| 649 &HostNPScriptObject::NotifyAccessCode, base::Unretained(this), false)); | 649 &HostNPScriptObject::NotifyAccessCode, base::Unretained(this), false)); |
| 650 DisconnectInternal(); | 650 DisconnectInternal(); |
| 651 return; | 651 return; |
| 652 } | 652 } |
| 653 | 653 |
| 654 std::string host_secret = GenerateRandomHostSecret(); | 654 std::string host_secret = GenerateRandomHostSecret(); |
| 655 std::string access_code = support_id + host_secret; | 655 std::string access_code = support_id + host_secret; |
| 656 host_->set_access_code(access_code); | 656 host_->SetSharedSecret(access_code); |
| 657 | 657 |
| 658 { | 658 { |
| 659 base::AutoLock lock(access_code_lock_); | 659 base::AutoLock lock(access_code_lock_); |
| 660 access_code_ = access_code; | 660 access_code_ = access_code; |
| 661 access_code_lifetime_ = lifetime; | 661 access_code_lifetime_ = lifetime; |
| 662 } | 662 } |
| 663 | 663 |
| 664 host_context_.main_message_loop()->PostTask(FROM_HERE, base::Bind( | 664 host_context_.main_message_loop()->PostTask(FROM_HERE, base::Bind( |
| 665 &HostNPScriptObject::NotifyAccessCode, base::Unretained(this), true)); | 665 &HostNPScriptObject::NotifyAccessCode, base::Unretained(this), true)); |
| 666 } | 666 } |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 837 uint32_t argCount) { | 837 uint32_t argCount) { |
| 838 NPVariant np_result; | 838 NPVariant np_result; |
| 839 bool is_good = g_npnetscape_funcs->invokeDefault(plugin_, func, args, | 839 bool is_good = g_npnetscape_funcs->invokeDefault(plugin_, func, args, |
| 840 argCount, &np_result); | 840 argCount, &np_result); |
| 841 if (is_good) | 841 if (is_good) |
| 842 g_npnetscape_funcs->releasevariantvalue(&np_result); | 842 g_npnetscape_funcs->releasevariantvalue(&np_result); |
| 843 return is_good; | 843 return is_good; |
| 844 } | 844 } |
| 845 | 845 |
| 846 } // namespace remoting | 846 } // namespace remoting |
| OLD | NEW |