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