| 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 #ifndef REMOTING_HOST_PLUGIN_HOST_SCRIPT_OBJECT_H_ | 5 #ifndef REMOTING_HOST_PLUGIN_HOST_SCRIPT_OBJECT_H_ |
| 6 #define REMOTING_HOST_PLUGIN_HOST_SCRIPT_OBJECT_H_ | 6 #define REMOTING_HOST_PLUGIN_HOST_SCRIPT_OBJECT_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 14 #include "base/synchronization/cancellation_flag.h" | 14 #include "base/synchronization/cancellation_flag.h" |
| 15 #include "base/synchronization/waitable_event.h" | 15 #include "base/synchronization/waitable_event.h" |
| 16 #include "base/string16.h" |
| 16 #include "base/threading/platform_thread.h" | 17 #include "base/threading/platform_thread.h" |
| 17 #include "base/time.h" | 18 #include "base/time.h" |
| 18 #include "remoting/base/plugin_message_loop_proxy.h" | 19 #include "remoting/base/plugin_message_loop_proxy.h" |
| 19 #include "remoting/host/chromoting_host_context.h" | 20 #include "remoting/host/chromoting_host_context.h" |
| 20 #include "remoting/host/host_status_observer.h" | 21 #include "remoting/host/host_status_observer.h" |
| 21 #include "remoting/host/plugin/host_plugin_utils.h" | 22 #include "remoting/host/plugin/host_plugin_utils.h" |
| 22 #include "third_party/npapi/bindings/npapi.h" | 23 #include "third_party/npapi/bindings/npapi.h" |
| 23 #include "third_party/npapi/bindings/npfunctions.h" | 24 #include "third_party/npapi/bindings/npfunctions.h" |
| 24 #include "third_party/npapi/bindings/npruntime.h" | 25 #include "third_party/npapi/bindings/npruntime.h" |
| 25 | 26 |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 | 129 |
| 129 // Called when the nat traversal policy is updated. | 130 // Called when the nat traversal policy is updated. |
| 130 void OnNatPolicyUpdate(bool nat_traversal_enabled); | 131 void OnNatPolicyUpdate(bool nat_traversal_enabled); |
| 131 | 132 |
| 132 void LocalizeStrings(); | 133 void LocalizeStrings(); |
| 133 | 134 |
| 134 // Helper function for executing InvokeDefault on an NPObject that performs | 135 // Helper function for executing InvokeDefault on an NPObject that performs |
| 135 // a string->string mapping with one optional substitution parameter. Stores | 136 // a string->string mapping with one optional substitution parameter. Stores |
| 136 // the translation in |result| and returns true on success, or leaves it | 137 // the translation in |result| and returns true on success, or leaves it |
| 137 // unchanged and returns false on failure. | 138 // unchanged and returns false on failure. |
| 138 bool LocalizeString(const char* tag, const char* substitution, | 139 bool LocalizeString(const char* tag, string16* result); |
| 139 std::string* result); | |
| 140 | 140 |
| 141 // Helper function for executing InvokeDefault on an NPObject, and ignoring | 141 // Helper function for executing InvokeDefault on an NPObject, and ignoring |
| 142 // the return value. | 142 // the return value. |
| 143 bool InvokeAndIgnoreResult(NPObject* func, | 143 bool InvokeAndIgnoreResult(NPObject* func, |
| 144 const NPVariant* args, | 144 const NPVariant* args, |
| 145 uint32_t argCount); | 145 uint32_t argCount); |
| 146 | 146 |
| 147 // Set an exception for the current call. | 147 // Set an exception for the current call. |
| 148 void SetException(const std::string& exception_string); | 148 void SetException(const std::string& exception_string); |
| 149 | 149 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 // it can be executed after at least one successful policy read. This | 184 // it can be executed after at least one successful policy read. This |
| 185 // variable contains the thunk if it is necessary. | 185 // variable contains the thunk if it is necessary. |
| 186 base::Closure pending_connect_; | 186 base::Closure pending_connect_; |
| 187 }; | 187 }; |
| 188 | 188 |
| 189 } // namespace remoting | 189 } // namespace remoting |
| 190 | 190 |
| 191 DISABLE_RUNNABLE_METHOD_REFCOUNT(remoting::HostNPScriptObject); | 191 DISABLE_RUNNABLE_METHOD_REFCOUNT(remoting::HostNPScriptObject); |
| 192 | 192 |
| 193 #endif // REMOTING_HOST_HOST_SCRIPT_OBJECT_H_ | 193 #endif // REMOTING_HOST_HOST_SCRIPT_OBJECT_H_ |
| OLD | NEW |