| 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 "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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |