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

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

Issue 11359147: Convert the Pepper Talk API to use the new resource system. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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/talk_resource.h ('k') | ppapi/thunk/interfaces_ppb_private.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "ppapi/proxy/talk_resource.h"
6
7 #include "ppapi/proxy/ppapi_messages.h"
8
9 namespace ppapi {
10 namespace proxy {
11
12 TalkResource::TalkResource(Connection connection, PP_Instance instance)
13 : PluginResource(connection, instance) {
14 }
15
16 TalkResource::~TalkResource() {
17 }
18
19 thunk::PPB_Talk_Private_API* TalkResource::AsPPB_Talk_Private_API() {
20 return this;
21 }
22
23 int32_t TalkResource::GetPermission(scoped_refptr<TrackedCallback> callback) {
24 if (TrackedCallback::IsPending(callback_))
25 return PP_ERROR_INPROGRESS;
26 callback_ = callback;
27
28 if (!sent_create_to_browser())
29 SendCreate(BROWSER, PpapiHostMsg_Talk_Create());
30
31 Call<PpapiPluginMsg_Talk_GetPermissionReply>(
32 BROWSER,
33 PpapiHostMsg_Talk_GetPermission(),
34 base::Bind(&TalkResource::GetPermissionReply, base::Unretained(this)));
35 return PP_OK_COMPLETIONPENDING;
36 }
37
38 void TalkResource::GetPermissionReply(
39 const ResourceMessageReplyParams& params) {
40 callback_->Run(params.result());
41 }
42
43 } // namespace proxy
44 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/proxy/talk_resource.h ('k') | ppapi/thunk/interfaces_ppb_private.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698