OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <stdio.h> | 5 #include <stdio.h> |
6 #include <string.h> | 6 #include <string.h> |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 : instance_(instance), | 69 : instance_(instance), |
70 scriptable_object_(NULL) { | 70 scriptable_object_(NULL) { |
71 plugin_task_runner_ = new remoting::PluginThreadTaskRunner(this); | 71 plugin_task_runner_ = new remoting::PluginThreadTaskRunner(this); |
72 plugin_auto_task_runner_ = | 72 plugin_auto_task_runner_ = |
73 new remoting::AutoThreadTaskRunner( | 73 new remoting::AutoThreadTaskRunner( |
74 plugin_task_runner_, | 74 plugin_task_runner_, |
75 base::Bind(&remoting::PluginThreadTaskRunner::Quit, | 75 base::Bind(&remoting::PluginThreadTaskRunner::Quit, |
76 plugin_task_runner_)); | 76 plugin_task_runner_)); |
77 } | 77 } |
78 | 78 |
79 ~HostNPPlugin() { | 79 virtual ~HostNPPlugin() { |
80 if (scriptable_object_) { | 80 if (scriptable_object_) { |
81 DCHECK_EQ(scriptable_object_->referenceCount, 1UL); | 81 DCHECK_EQ(scriptable_object_->referenceCount, 1UL); |
82 g_npnetscape_funcs->releaseobject(scriptable_object_); | 82 g_npnetscape_funcs->releaseobject(scriptable_object_); |
83 scriptable_object_ = NULL; | 83 scriptable_object_ = NULL; |
84 } | 84 } |
85 | 85 |
86 // Process tasks on |plugin_task_runner_| until all references to | 86 // Process tasks on |plugin_task_runner_| until all references to |
87 // |plugin_auto_task_runner_| have been dropped. This requires that the | 87 // |plugin_auto_task_runner_| have been dropped. This requires that the |
88 // browser has dropped any script object references - see above. | 88 // browser has dropped any script object references - see above. |
89 plugin_auto_task_runner_ = NULL; | 89 plugin_auto_task_runner_ = NULL; |
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
520 } | 520 } |
521 | 521 |
522 EXPORT NPError API_CALL NP_GetValue(void* npp, | 522 EXPORT NPError API_CALL NP_GetValue(void* npp, |
523 NPPVariable variable, | 523 NPPVariable variable, |
524 void* value) { | 524 void* value) { |
525 return GetValue((NPP)npp, variable, value); | 525 return GetValue((NPP)npp, variable, value); |
526 } | 526 } |
527 #endif | 527 #endif |
528 | 528 |
529 } // extern "C" | 529 } // extern "C" |
OLD | NEW |