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

Side by Side Diff: remoting/host/plugin/host_plugin.cc

Issue 9427023: Add functions to expand PostDelayedTask interface. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Add fix to RunOnPluginThread() in host_plugin.cc Created 8 years, 10 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
« no previous file with comments | « remoting/client/plugin/pepper_plugin_thread_delegate.cc ('k') | no next file » | 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 <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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 NULL 141 NULL
142 }; 142 };
143 scriptable_object_ = g_npnetscape_funcs->createobject(instance_, 143 scriptable_object_ = g_npnetscape_funcs->createobject(instance_,
144 &npc_ref_object); 144 &npc_ref_object);
145 } 145 }
146 return scriptable_object_; 146 return scriptable_object_;
147 } 147 }
148 148
149 // PluginMessageLoopProxy::Delegate implementation. 149 // PluginMessageLoopProxy::Delegate implementation.
150 virtual bool RunOnPluginThread( 150 virtual bool RunOnPluginThread(
151 int delay_ms, void(function)(void*), void* data) OVERRIDE { 151 base::TimeDelta delay, void(function)(void*), void* data) OVERRIDE {
152 if (delay_ms == 0) { 152 if (delay == base::TimeDelta()) {
153 g_npnetscape_funcs->pluginthreadasynccall(instance_, function, data); 153 g_npnetscape_funcs->pluginthreadasynccall(instance_, function, data);
154 } else { 154 } else {
155 base::AutoLock auto_lock(timers_lock_); 155 base::AutoLock auto_lock(timers_lock_);
156 uint32_t timer_id = g_npnetscape_funcs->scheduletimer( 156 uint32_t timer_id = g_npnetscape_funcs->scheduletimer(
157 instance_, delay_ms, false, &NPDelayedTaskSpringboard); 157 instance_, delay.InMilliseconds(), false, &NPDelayedTaskSpringboard);
158 DelayedTask task = {function, data}; 158 DelayedTask task = {function, data};
159 timers_[timer_id] = task; 159 timers_[timer_id] = task;
160 } 160 }
161 return true; 161 return true;
162 } 162 }
163 163
164 static void NPDelayedTaskSpringboard(NPP npp, uint32_t timer_id) { 164 static void NPDelayedTaskSpringboard(NPP npp, uint32_t timer_id) {
165 HostNPPlugin* self = reinterpret_cast<HostNPPlugin*>(npp->pdata); 165 HostNPPlugin* self = reinterpret_cast<HostNPPlugin*>(npp->pdata);
166 DelayedTask task; 166 DelayedTask task;
167 { 167 {
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 } 497 }
498 498
499 EXPORT NPError API_CALL NP_GetValue(void* npp, 499 EXPORT NPError API_CALL NP_GetValue(void* npp,
500 NPPVariable variable, 500 NPPVariable variable,
501 void* value) { 501 void* value) {
502 return GetValue((NPP)npp, variable, value); 502 return GetValue((NPP)npp, variable, value);
503 } 503 }
504 #endif 504 #endif
505 505
506 } // extern "C" 506 } // extern "C"
OLDNEW
« no previous file with comments | « remoting/client/plugin/pepper_plugin_thread_delegate.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698