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

Side by Side Diff: ppapi/cpp/private/net_address_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/instance_private.cc ('k') | ppapi/cpp/private/tcp_socket_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/net_address_private.h" 5 #include "ppapi/cpp/private/net_address_private.h"
6 6
7 #include "ppapi/c/pp_bool.h" 7 #include "ppapi/c/pp_bool.h"
8 #include "ppapi/cpp/module.h" 8 #include "ppapi/cpp/module.h"
9 #include "ppapi/cpp/module_impl.h" 9 #include "ppapi/cpp/module_impl.h"
10 #include "ppapi/cpp/var.h" 10 #include "ppapi/cpp/var.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 // static 44 // static
45 std::string NetAddressPrivate::Describe(const PP_NetAddress_Private& addr, 45 std::string NetAddressPrivate::Describe(const PP_NetAddress_Private& addr,
46 bool include_port) { 46 bool include_port) {
47 if (!has_interface<PPB_NetAddress_Private>()) 47 if (!has_interface<PPB_NetAddress_Private>())
48 return std::string(); 48 return std::string();
49 49
50 Module* module = Module::Get(); 50 Module* module = Module::Get();
51 if (!module) 51 if (!module)
52 return std::string(); 52 return std::string();
53 53
54 Var result(Var::PassRef(), 54 Var result(PASS_REF,
55 get_interface<PPB_NetAddress_Private>()->Describe( 55 get_interface<PPB_NetAddress_Private>()->Describe(
56 module->pp_module(), 56 module->pp_module(),
57 &addr, 57 &addr,
58 PP_FromBool(include_port))); 58 PP_FromBool(include_port)));
59 return result.is_string() ? result.AsString() : std::string(); 59 return result.is_string() ? result.AsString() : std::string();
60 } 60 }
61 61
62 // static 62 // static
63 bool NetAddressPrivate::ReplacePort(const PP_NetAddress_Private& addr_in, 63 bool NetAddressPrivate::ReplacePort(const PP_NetAddress_Private& addr_in,
64 uint16_t port, 64 uint16_t port,
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 uint16_t address_size) { 101 uint16_t address_size) {
102 if (!has_interface<PPB_NetAddress_Private>()) 102 if (!has_interface<PPB_NetAddress_Private>())
103 return false; 103 return false;
104 return PP_ToBool(get_interface<PPB_NetAddress_Private>()->GetAddress( 104 return PP_ToBool(get_interface<PPB_NetAddress_Private>()->GetAddress(
105 &addr, 105 &addr,
106 address, 106 address,
107 address_size)); 107 address_size));
108 } 108 }
109 109
110 } // namespace pp 110 } // namespace pp
OLDNEW
« no previous file with comments | « ppapi/cpp/private/instance_private.cc ('k') | ppapi/cpp/private/tcp_socket_private.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698