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

Side by Side Diff: ppapi/thunk/common.cc

Issue 9113044: Convert to new enter method (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove common.h Created 8 years, 11 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "ppapi/thunk/common.h"
6
7 #include "base/bind.h"
8 #include "base/message_loop.h"
9 #include "ppapi/c/pp_errors.h"
10
11 namespace ppapi {
12 namespace thunk {
13
14 int32_t MayForceCallback(PP_CompletionCallback callback, int32_t result) {
15 if (result == PP_OK_COMPLETIONPENDING)
16 return result;
17
18 if (callback.func == NULL ||
19 (callback.flags & PP_COMPLETIONCALLBACK_FLAG_OPTIONAL) != 0)
20 return result;
21
22 // TODO(polina): make this work off the main thread as well
23 // (At this point this should not be an issue because PPAPI is only supported
24 // on the main thread).
25 MessageLoop::current()->PostTask(FROM_HERE, base::Bind(
26 callback.func, callback.user_data, result));
27 return PP_OK_COMPLETIONPENDING;
28 }
29
30 } // namespace thunk
31 } // namespace ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698