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

Side by Side Diff: webkit/glue/plugins/pepper_plugin_module.cc

Issue 2819036: Chrome-side of making CallOnMainThread use a completion callback.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « DEPS ('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) 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
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
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
OLDNEW
« no previous file with comments | « DEPS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698