OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "webkit/glue/plugins/pepper_plugin_module.h" | 5 #include "webkit/glue/plugins/pepper_plugin_module.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 } | 88 } |
89 | 89 |
90 void MemFree(void* ptr) { | 90 void MemFree(void* ptr) { |
91 free(ptr); | 91 free(ptr); |
92 } | 92 } |
93 | 93 |
94 double GetTime() { | 94 double GetTime() { |
95 return base::Time::Now().ToDoubleT(); | 95 return base::Time::Now().ToDoubleT(); |
96 } | 96 } |
97 | 97 |
98 void CallOnMainThread(int delay_in_msec, void (*func)(void*), void* context) { | 98 void CallOnMainThread(int delay_in_msec, |
| 99 PP_CompletionCallback callback, |
| 100 int32_t result) { |
99 GetMainThreadMessageLoop()->PostDelayedTask( | 101 GetMainThreadMessageLoop()->PostDelayedTask( |
100 FROM_HERE, | 102 FROM_HERE, |
101 NewRunnableFunction(func, context), | 103 NewRunnableFunction(callback.func, callback.user_data, result), |
102 delay_in_msec); | 104 delay_in_msec); |
103 } | 105 } |
104 | 106 |
105 const PPB_Core core_interface = { | 107 const PPB_Core core_interface = { |
106 &AddRefResource, | 108 &AddRefResource, |
107 &ReleaseResource, | 109 &ReleaseResource, |
108 &MemAlloc, | 110 &MemAlloc, |
109 &MemFree, | 111 &MemFree, |
110 &GetTime, | 112 &GetTime, |
111 &CallOnMainThread | 113 &CallOnMainThread |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 | 335 |
334 void PluginModule::InstanceCreated(PluginInstance* instance) { | 336 void PluginModule::InstanceCreated(PluginInstance* instance) { |
335 instances_.insert(instance); | 337 instances_.insert(instance); |
336 } | 338 } |
337 | 339 |
338 void PluginModule::InstanceDeleted(PluginInstance* instance) { | 340 void PluginModule::InstanceDeleted(PluginInstance* instance) { |
339 instances_.erase(instance); | 341 instances_.erase(instance); |
340 } | 342 } |
341 | 343 |
342 } // namespace pepper | 344 } // namespace pepper |
OLD | NEW |