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

Side by Side Diff: ppapi/cpp/private/udp_socket_private.cc

Issue 9381010: Convert resources to take an instance key instead of an Instance*. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: USELESS PATCH TITLE Created 8 years, 9 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
« no previous file with comments | « ppapi/cpp/private/udp_socket_private.h ('k') | ppapi/cpp/private/var_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
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/cpp/private/udp_socket_private.h" 5 #include "ppapi/cpp/private/udp_socket_private.h"
6 6
7 #include "ppapi/c/pp_bool.h" 7 #include "ppapi/c/pp_bool.h"
8 #include "ppapi/c/pp_errors.h" 8 #include "ppapi/c/pp_errors.h"
9 #include "ppapi/cpp/completion_callback.h" 9 #include "ppapi/cpp/completion_callback.h"
10 #include "ppapi/cpp/instance.h" 10 #include "ppapi/cpp/instance_handle.h"
11 #include "ppapi/cpp/module.h" 11 #include "ppapi/cpp/module.h"
12 #include "ppapi/cpp/module_impl.h" 12 #include "ppapi/cpp/module_impl.h"
13 13
14 namespace pp { 14 namespace pp {
15 15
16 namespace { 16 namespace {
17 17
18 template <> const char* interface_name<PPB_UDPSocket_Private>() { 18 template <> const char* interface_name<PPB_UDPSocket_Private>() {
19 return PPB_UDPSOCKET_PRIVATE_INTERFACE; 19 return PPB_UDPSOCKET_PRIVATE_INTERFACE;
20 } 20 }
21 21
22 } // namespace 22 } // namespace
23 23
24 UDPSocketPrivate::UDPSocketPrivate(Instance* instance) { 24 UDPSocketPrivate::UDPSocketPrivate(const InstanceHandle& instance) {
25 if (has_interface<PPB_UDPSocket_Private>() && instance) { 25 if (has_interface<PPB_UDPSocket_Private>()) {
26 PassRefFromConstructor(get_interface<PPB_UDPSocket_Private>()->Create( 26 PassRefFromConstructor(get_interface<PPB_UDPSocket_Private>()->Create(
27 instance->pp_instance())); 27 instance.pp_instance()));
28 } 28 }
29 } 29 }
30 30
31 int32_t UDPSocketPrivate::Bind(const PP_NetAddress_Private* addr, 31 int32_t UDPSocketPrivate::Bind(const PP_NetAddress_Private* addr,
32 const CompletionCallback& callback) { 32 const CompletionCallback& callback) {
33 if (!has_interface<PPB_UDPSocket_Private>()) 33 if (!has_interface<PPB_UDPSocket_Private>())
34 return PP_ERROR_NOINTERFACE; 34 return PP_ERROR_NOINTERFACE;
35 return get_interface<PPB_UDPSocket_Private>()->Bind( 35 return get_interface<PPB_UDPSocket_Private>()->Bind(
36 pp_resource(), addr, callback.pp_completion_callback()); 36 pp_resource(), addr, callback.pp_completion_callback());
37 } 37 }
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 callback.pp_completion_callback()); 74 callback.pp_completion_callback());
75 } 75 }
76 76
77 void UDPSocketPrivate::Close() { 77 void UDPSocketPrivate::Close() {
78 if (!has_interface<PPB_UDPSocket_Private>()) 78 if (!has_interface<PPB_UDPSocket_Private>())
79 return; 79 return;
80 return get_interface<PPB_UDPSocket_Private>()->Close(pp_resource()); 80 return get_interface<PPB_UDPSocket_Private>()->Close(pp_resource());
81 } 81 }
82 } // namespace pp 82 } // namespace pp
83 83
OLDNEW
« no previous file with comments | « ppapi/cpp/private/udp_socket_private.h ('k') | ppapi/cpp/private/var_private.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698