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_completion_callback.h" | 5 #include "ppapi/c/pp_completion_callback.h" |
6 #include "ppapi/c/pp_errors.h" | 6 #include "ppapi/c/pp_errors.h" |
7 #include "ppapi/shared_impl/tracked_callback.h" | 7 #include "ppapi/shared_impl/tracked_callback.h" |
8 #include "ppapi/thunk/enter.h" | 8 #include "ppapi/thunk/enter.h" |
9 #include "ppapi/thunk/thunk.h" | 9 #include "ppapi/thunk/thunk.h" |
10 #include "ppapi/thunk/ppb_url_loader_api.h" | 10 #include "ppapi/thunk/ppb_url_loader_api.h" |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 if (enter.succeeded()) | 104 if (enter.succeeded()) |
105 enter.object()->Close(); | 105 enter.object()->Close(); |
106 } | 106 } |
107 | 107 |
108 void GrantUniversalAccess(PP_Resource loader) { | 108 void GrantUniversalAccess(PP_Resource loader) { |
109 EnterURLLoader enter(loader, true); | 109 EnterURLLoader enter(loader, true); |
110 if (enter.succeeded()) | 110 if (enter.succeeded()) |
111 enter.object()->GrantUniversalAccess(); | 111 enter.object()->GrantUniversalAccess(); |
112 } | 112 } |
113 | 113 |
114 void SetStatusCallback(PP_Resource loader, | |
115 PP_URLLoaderTrusted_StatusCallback cb) { | |
116 EnterURLLoader enter(loader, true); | |
117 if (enter.succeeded()) | |
118 enter.object()->SetStatusCallback(cb); | |
119 } | |
120 | |
121 const PPB_URLLoader g_ppb_urlloader_thunk = { | 114 const PPB_URLLoader g_ppb_urlloader_thunk = { |
122 &Create, | 115 &Create, |
123 &IsURLLoader, | 116 &IsURLLoader, |
124 &Open, | 117 &Open, |
125 &FollowRedirect, | 118 &FollowRedirect, |
126 &GetUploadProgress, | 119 &GetUploadProgress, |
127 &GetDownloadProgress, | 120 &GetDownloadProgress, |
128 &GetResponseInfo, | 121 &GetResponseInfo, |
129 &ReadResponseBody, | 122 &ReadResponseBody, |
130 &FinishStreamingToFile, | 123 &FinishStreamingToFile, |
131 &Close | 124 &Close |
132 }; | 125 }; |
133 | 126 |
134 const PPB_URLLoaderTrusted g_ppb_urlloader_trusted_thunk = { | 127 const PPB_URLLoaderTrusted g_ppb_urlloader_trusted_thunk = { |
135 &GrantUniversalAccess, | 128 &GrantUniversalAccess, |
136 &SetStatusCallback | 129 NULL // TODO(brettw) remove SetStatusCallback from the header. |
137 }; | 130 }; |
138 | 131 |
139 } // namespace | 132 } // namespace |
140 | 133 |
141 const PPB_URLLoader_1_0* GetPPB_URLLoader_1_0_Thunk() { | 134 const PPB_URLLoader_1_0* GetPPB_URLLoader_1_0_Thunk() { |
142 return &g_ppb_urlloader_thunk; | 135 return &g_ppb_urlloader_thunk; |
143 } | 136 } |
144 | 137 |
145 const PPB_URLLoaderTrusted_0_3* GetPPB_URLLoaderTrusted_0_3_Thunk() { | 138 const PPB_URLLoaderTrusted_0_3* GetPPB_URLLoaderTrusted_0_3_Thunk() { |
146 return &g_ppb_urlloader_trusted_thunk; | 139 return &g_ppb_urlloader_trusted_thunk; |
147 } | 140 } |
148 | 141 |
149 } // namespace thunk | 142 } // namespace thunk |
150 } // namespace ppapi | 143 } // namespace ppapi |
OLD | NEW |