| 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 "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/bind.h" | 9 #include "base/bind.h" | 
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" | 
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 176   return TimeTicksToPPTimeTicks(base::TimeTicks::Now()); | 176   return TimeTicksToPPTimeTicks(base::TimeTicks::Now()); | 
| 177 } | 177 } | 
| 178 | 178 | 
| 179 void CallOnMainThread(int delay_in_msec, | 179 void CallOnMainThread(int delay_in_msec, | 
| 180                       PP_CompletionCallback callback, | 180                       PP_CompletionCallback callback, | 
| 181                       int32_t result) { | 181                       int32_t result) { | 
| 182   if (callback.func) { | 182   if (callback.func) { | 
| 183     GetMainThreadMessageLoop()->PostDelayedTask( | 183     GetMainThreadMessageLoop()->PostDelayedTask( | 
| 184         FROM_HERE, | 184         FROM_HERE, | 
| 185         base::Bind(callback.func, callback.user_data, result), | 185         base::Bind(callback.func, callback.user_data, result), | 
| 186         delay_in_msec); | 186         base::TimeDelta::FromMilliseconds(delay_in_msec)); | 
| 187   } | 187   } | 
| 188 } | 188 } | 
| 189 | 189 | 
| 190 PP_Bool IsMainThread() { | 190 PP_Bool IsMainThread() { | 
| 191   return BoolToPPBool(GetMainThreadMessageLoop()->BelongsToCurrentThread()); | 191   return BoolToPPBool(GetMainThreadMessageLoop()->BelongsToCurrentThread()); | 
| 192 } | 192 } | 
| 193 | 193 | 
| 194 const PPB_Core core_interface = { | 194 const PPB_Core core_interface = { | 
| 195   &AddRefResource, | 195   &AddRefResource, | 
| 196   &ReleaseResource, | 196   &ReleaseResource, | 
| (...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 623   int retval = entry_points.initialize_module(pp_module(), &GetInterface); | 623   int retval = entry_points.initialize_module(pp_module(), &GetInterface); | 
| 624   if (retval != 0) { | 624   if (retval != 0) { | 
| 625     LOG(WARNING) << "PPP_InitializeModule returned failure " << retval; | 625     LOG(WARNING) << "PPP_InitializeModule returned failure " << retval; | 
| 626     return false; | 626     return false; | 
| 627   } | 627   } | 
| 628   return true; | 628   return true; | 
| 629 } | 629 } | 
| 630 | 630 | 
| 631 }  // namespace ppapi | 631 }  // namespace ppapi | 
| 632 }  // namespace webkit | 632 }  // namespace webkit | 
| OLD | NEW | 
|---|