| 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/c/pp_var.h" | 5 #include "ppapi/c/pp_var.h" |
| 6 #include "ppapi/c/private/ppb_host_resolver_private.h" | 6 #include "ppapi/c/private/ppb_host_resolver_private.h" |
| 7 #include "ppapi/thunk/enter.h" | 7 #include "ppapi/thunk/enter.h" |
| 8 #include "ppapi/thunk/ppb_host_resolver_private_api.h" | 8 #include "ppapi/thunk/ppb_host_resolver_private_api.h" |
| 9 #include "ppapi/thunk/resource_creation_api.h" | 9 #include "ppapi/thunk/resource_creation_api.h" |
| 10 #include "ppapi/thunk/thunk.h" | 10 #include "ppapi/thunk/thunk.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 } | 29 } |
| 30 | 30 |
| 31 int32_t Resolve(PP_Resource host_resolver, | 31 int32_t Resolve(PP_Resource host_resolver, |
| 32 const char* host, | 32 const char* host, |
| 33 uint16_t port, | 33 uint16_t port, |
| 34 const PP_HostResolver_Private_Hint* hint, | 34 const PP_HostResolver_Private_Hint* hint, |
| 35 PP_CompletionCallback callback) { | 35 PP_CompletionCallback callback) { |
| 36 EnterHostResolver enter(host_resolver, callback, true); | 36 EnterHostResolver enter(host_resolver, callback, true); |
| 37 if (enter.failed()) | 37 if (enter.failed()) |
| 38 return enter.retval(); | 38 return enter.retval(); |
| 39 return enter.SetResult(enter.object()->Resolve(host, port, hint, callback)); | 39 return enter.SetResult(enter.object()->Resolve(host, port, hint, |
| 40 enter.callback())); |
| 40 } | 41 } |
| 41 | 42 |
| 42 PP_Var GetCanonicalName(PP_Resource host_resolver) { | 43 PP_Var GetCanonicalName(PP_Resource host_resolver) { |
| 43 EnterHostResolver enter(host_resolver, true); | 44 EnterHostResolver enter(host_resolver, true); |
| 44 if (enter.failed()) | 45 if (enter.failed()) |
| 45 return PP_MakeUndefined(); | 46 return PP_MakeUndefined(); |
| 46 return enter.object()->GetCanonicalName(); | 47 return enter.object()->GetCanonicalName(); |
| 47 } | 48 } |
| 48 | 49 |
| 49 uint32_t GetSize(PP_Resource host_resolver) { | 50 uint32_t GetSize(PP_Resource host_resolver) { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 72 }; | 73 }; |
| 73 | 74 |
| 74 } // namespace | 75 } // namespace |
| 75 | 76 |
| 76 const PPB_HostResolver_Private_0_1* GetPPB_HostResolver_Private_0_1_Thunk() { | 77 const PPB_HostResolver_Private_0_1* GetPPB_HostResolver_Private_0_1_Thunk() { |
| 77 return &g_ppb_host_resolver_thunk; | 78 return &g_ppb_host_resolver_thunk; |
| 78 } | 79 } |
| 79 | 80 |
| 80 } // namespace thunk | 81 } // namespace thunk |
| 81 } // namespace ppapi | 82 } // namespace ppapi |
| OLD | NEW |