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 // From ppb_url_loader.idl modified Wed Apr 17 11:16:00 2013. | 5 // From ppb_url_loader.idl modified Wed Apr 17 11:16:00 2013. |
6 | 6 |
7 #include <string.h> | 7 #include <string.h> |
8 | 8 |
9 #include "ppapi/c/pp_completion_callback.h" | 9 #include "ppapi/c/pp_completion_callback.h" |
10 #include "ppapi/c/pp_errors.h" | 10 #include "ppapi/c/pp_errors.h" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 EnterResource<PPB_URLLoader_API> enter(loader, callback, true); | 108 EnterResource<PPB_URLLoader_API> enter(loader, callback, true); |
109 if (enter.failed()) | 109 if (enter.failed()) |
110 return enter.retval(); | 110 return enter.retval(); |
111 return enter.SetResult(enter.object()->FinishStreamingToFile( | 111 return enter.SetResult(enter.object()->FinishStreamingToFile( |
112 enter.callback())); | 112 enter.callback())); |
113 } | 113 } |
114 | 114 |
115 void Close(PP_Resource loader) { | 115 void Close(PP_Resource loader) { |
116 VLOG(4) << "PPB_URLLoader::Close()"; | 116 VLOG(4) << "PPB_URLLoader::Close()"; |
117 EnterResource<PPB_URLLoader_API> enter(loader, true); | 117 EnterResource<PPB_URLLoader_API> enter(loader, true); |
118 if (enter.succeeded()) | 118 if (enter.failed()) |
119 enter.object()->Close(); | 119 return; |
| 120 enter.object()->Close(); |
120 } | 121 } |
121 | 122 |
122 const PPB_URLLoader_1_0 g_ppb_urlloader_thunk_1_0 = { | 123 const PPB_URLLoader_1_0 g_ppb_urlloader_thunk_1_0 = { |
123 &Create, | 124 &Create, |
124 &IsURLLoader, | 125 &IsURLLoader, |
125 &Open, | 126 &Open, |
126 &FollowRedirect, | 127 &FollowRedirect, |
127 &GetUploadProgress, | 128 &GetUploadProgress, |
128 &GetDownloadProgress, | 129 &GetDownloadProgress, |
129 &GetResponseInfo, | 130 &GetResponseInfo, |
130 &ReadResponseBody, | 131 &ReadResponseBody, |
131 &FinishStreamingToFile, | 132 &FinishStreamingToFile, |
132 &Close | 133 &Close |
133 }; | 134 }; |
134 | 135 |
135 } // namespace | 136 } // namespace |
136 | 137 |
137 const PPB_URLLoader_1_0* GetPPB_URLLoader_1_0_Thunk() { | 138 const PPB_URLLoader_1_0* GetPPB_URLLoader_1_0_Thunk() { |
138 return &g_ppb_urlloader_thunk_1_0; | 139 return &g_ppb_urlloader_thunk_1_0; |
139 } | 140 } |
140 | 141 |
141 } // namespace thunk | 142 } // namespace thunk |
142 } // namespace ppapi | 143 } // namespace ppapi |
OLD | NEW |