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

Unified Diff: ppapi/thunk/ppb_network_monitor_private_thunk.cc

Issue 23453025: Refactor PPB_NetworkMonitor_Private interface to use CompletionCallback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: ppapi/thunk/ppb_network_monitor_private_thunk.cc
diff --git a/ppapi/thunk/ppb_network_monitor_private_thunk.cc b/ppapi/thunk/ppb_network_monitor_private_thunk.cc
index 0382e923990eacd0f4c9a80e41cdec0e17bdeccc..3e627f91cb4e48fefc08c0b619f540198f56f44e 100644
--- a/ppapi/thunk/ppb_network_monitor_private_thunk.cc
+++ b/ppapi/thunk/ppb_network_monitor_private_thunk.cc
@@ -15,13 +15,21 @@ namespace {
typedef EnterResource<PPB_NetworkMonitor_Private_API> EnterNetworkMonitor;
-PP_Resource Create(PP_Instance instance,
- PPB_NetworkMonitor_Callback callback,
- void* user_data) {
+PP_Resource Create(PP_Instance instance) {
yzshen1 2013/09/04 19:52:01 FYI: You could use [generate_thunk] in the idl fil
Sergey Ulanov 2013/09/04 22:22:32 Done.
EnterResourceCreation enter(instance);
if (enter.failed())
return 0;
- return enter.functions()->CreateNetworkMonitor(instance, callback, user_data);
+ return enter.functions()->CreateNetworkMonitor(instance);
+}
+
+int32_t UpdateNetworkList(PP_Resource network_monitor,
+ PP_Resource* network_list,
+ struct PP_CompletionCallback callback) {
+ EnterNetworkMonitor enter(network_monitor, callback, true);
+ if (enter.failed())
+ return enter.retval();
+ return enter.SetResult(enter.object()->UpdateNetworkList(
+ network_list, enter.callback()));
}
PP_Bool IsNetworkMonitor(PP_Resource resource) {
@@ -31,13 +39,14 @@ PP_Bool IsNetworkMonitor(PP_Resource resource) {
const PPB_NetworkMonitor_Private g_ppb_network_monitor_private_thunk = {
&Create,
+ &UpdateNetworkList,
&IsNetworkMonitor,
};
} // namespace
-const PPB_NetworkMonitor_Private_0_2*
-GetPPB_NetworkMonitor_Private_0_2_Thunk() {
+const PPB_NetworkMonitor_Private_0_3*
+GetPPB_NetworkMonitor_Private_0_3_Thunk() {
return &g_ppb_network_monitor_private_thunk;
}

Powered by Google App Engine
This is Rietveld 408576698