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

Side by Side Diff: ppapi/proxy/ppb_talk_private_proxy.cc

Issue 10909244: PPAPI: Get TrackedCallback ready for running on non-main threads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged. Created 8 years, 1 month 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 | « ppapi/proxy/ppb_instance_proxy.cc ('k') | ppapi/proxy/ppb_tcp_server_socket_private_proxy.cc » ('j') | 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) 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 "ppapi/proxy/ppb_talk_private_proxy.h" 5 #include "ppapi/proxy/ppb_talk_private_proxy.h"
6 6
7 #include "ipc/ipc_message_macros.h" 7 #include "ipc/ipc_message_macros.h"
8 #include "ppapi/c/pp_errors.h" 8 #include "ppapi/c/pp_errors.h"
9 #include "ppapi/proxy/plugin_dispatcher.h" 9 #include "ppapi/proxy/plugin_dispatcher.h"
10 #include "ppapi/proxy/plugin_globals.h" 10 #include "ppapi/proxy/plugin_globals.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 if (PluginGlobals::Get()->plugin_proxy_delegate()->SendToBrowser( 42 if (PluginGlobals::Get()->plugin_proxy_delegate()->SendToBrowser(
43 new PpapiHostMsg_PPBTalk_GetPermission( 43 new PpapiHostMsg_PPBTalk_GetPermission(
44 API_ID_PPB_TALK, 44 API_ID_PPB_TALK,
45 dispatcher->plugin_dispatcher_id(), 45 dispatcher->plugin_dispatcher_id(),
46 pp_resource()))) 46 pp_resource())))
47 return PP_OK_COMPLETIONPENDING; 47 return PP_OK_COMPLETIONPENDING;
48 return PP_ERROR_FAILED; 48 return PP_ERROR_FAILED;
49 } 49 }
50 50
51 void GotCompletion(int32_t result) { 51 void GotCompletion(int32_t result) {
52 TrackedCallback::ClearAndRun(&callback_, result); 52 callback_->Run(result);
53 } 53 }
54 54
55 private: 55 private:
56 scoped_refptr<TrackedCallback> callback_; 56 scoped_refptr<TrackedCallback> callback_;
57 57
58 DISALLOW_COPY_AND_ASSIGN(Talk); 58 DISALLOW_COPY_AND_ASSIGN(Talk);
59 }; 59 };
60 60
61 } // namespace 61 } // namespace
62 62
(...skipping 20 matching lines...) Expand all
83 PP_Resource resource, 83 PP_Resource resource,
84 int32_t result) { 84 int32_t result) {
85 thunk::EnterResourceNoLock<thunk::PPB_Talk_Private_API> enter( 85 thunk::EnterResourceNoLock<thunk::PPB_Talk_Private_API> enter(
86 resource, false); 86 resource, false);
87 if (enter.succeeded()) 87 if (enter.succeeded())
88 static_cast<Talk*>(enter.object())->GotCompletion(result); 88 static_cast<Talk*>(enter.object())->GotCompletion(result);
89 } 89 }
90 90
91 } // namespace proxy 91 } // namespace proxy
92 } // namespace ppapi 92 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/proxy/ppb_instance_proxy.cc ('k') | ppapi/proxy/ppb_tcp_server_socket_private_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698