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 #include "webkit/plugins/ppapi/plugin_module.h" | 5 #include "webkit/plugins/ppapi/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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 } | 142 } |
143 | 143 |
144 void* MemAlloc(uint32_t num_bytes) { | 144 void* MemAlloc(uint32_t num_bytes) { |
145 return malloc(num_bytes); | 145 return malloc(num_bytes); |
146 } | 146 } |
147 | 147 |
148 void MemFree(void* ptr) { | 148 void MemFree(void* ptr) { |
149 free(ptr); | 149 free(ptr); |
150 } | 150 } |
151 | 151 |
152 double GetTime() { | 152 PP_Time GetTime() { |
153 return base::Time::Now().ToDoubleT(); | 153 return TimeToPPTime(base::Time::Now()); |
154 } | 154 } |
155 | 155 |
156 double GetTickTime() { | 156 PP_TimeTicks GetTickTime() { |
157 // TODO(brettw) http://code.google.com/p/chromium/issues/detail?id=57448 | 157 return TimeTicksToPPTimeTicks(base::TimeTicks::Now()); |
158 // This should be a tick timer rather than wall clock time, but needs to | |
159 // match message times, which also currently use wall clock time. | |
160 return GetTime(); | |
161 } | 158 } |
162 | 159 |
163 void CallOnMainThread(int delay_in_msec, | 160 void CallOnMainThread(int delay_in_msec, |
164 PP_CompletionCallback callback, | 161 PP_CompletionCallback callback, |
165 int32_t result) { | 162 int32_t result) { |
166 GetMainThreadMessageLoop()->PostDelayedTask( | 163 GetMainThreadMessageLoop()->PostDelayedTask( |
167 FROM_HERE, | 164 FROM_HERE, |
168 NewRunnableFunction(callback.func, callback.user_data, result), | 165 NewRunnableFunction(callback.func, callback.user_data, result), |
169 delay_in_msec); | 166 delay_in_msec); |
170 } | 167 } |
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
608 int retval = entry_points_.initialize_module(pp_module(), &GetInterface); | 605 int retval = entry_points_.initialize_module(pp_module(), &GetInterface); |
609 if (retval != 0) { | 606 if (retval != 0) { |
610 LOG(WARNING) << "PPP_InitializeModule returned failure " << retval; | 607 LOG(WARNING) << "PPP_InitializeModule returned failure " << retval; |
611 return false; | 608 return false; |
612 } | 609 } |
613 return true; | 610 return true; |
614 } | 611 } |
615 | 612 |
616 } // namespace ppapi | 613 } // namespace ppapi |
617 } // namespace webkit | 614 } // namespace webkit |
OLD | NEW |