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

Side by Side Diff: ppapi/thunk/ppb_url_loader_thunk.cc

Issue 14161017: Pepper: Simplify idl_thunk implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: on_failure comment nit Created 7 years, 8 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/thunk/ppb_messaging_thunk.cc ('k') | ppapi/thunk/ppb_url_loader_trusted_thunk.cc » ('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 // 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
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
OLDNEW
« no previous file with comments | « ppapi/thunk/ppb_messaging_thunk.cc ('k') | ppapi/thunk/ppb_url_loader_trusted_thunk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698