/* Copyright (c) 2012 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
/**
* This file defines the PPB_NetworkMonitor
interface.
*/
[generate_thunk]
label Chrome {
M31 = 1.0
};
/**
* The PPB_NetworkMonitor
allows to get network interfaces
* configuration and monitor network configuration changes.
*
* Permissions: Apps permission socket
with subrule
* network-state
is required for UpdateNetworkList()
.
* For more details about network communication permissions, please see:
* http://developer.chrome.com/apps/app_network.html
*/
interface PPB_NetworkMonitor {
/**
* Creates a Network Monitor resource.
*
* @param[in] instance A PP_Instance
identifying one instance of
* a module.
*
* @return A PP_Resource
corresponding to a network monitor or 0
* on failure.
*/
PP_Resource Create([in] PP_Instance instance);
/**
* Gets current network configuration. When called for the first time,
* completes as soon as the current network configuration is received from
* the browser. Each consequent call will wait for network list changes,
* returning a new PPB_NetworkList
resource every time.
*
* @param[in] network_monitor A PP_Resource
corresponding to a
* network monitor.
* @param[out] network_list The PPB_NetworkList resource with the
* current state of network interfaces.
* @param[in] callback A PP_CompletionCallback
to be called upon
* completion.
*
* @return An int32_t containing an error code from pp_errors.h
.
* PP_ERROR_NOACCESS
will be returned if the caller doesn't have
* required permissions.
*/
int32_t UpdateNetworkList([in] PP_Resource network_monitor,
[out] PP_Resource network_list,
[in] PP_CompletionCallback callback);
/**
* Determines if the specified resource
is a
* NetworkMonitor
object.
*
* @param[in] resource A PP_Resource
resource.
*
* @return Returns PP_TRUE
if resource
is a
* PPB_NetworkMonitor
, PP_FALSE
otherwise.
*/
PP_Bool IsNetworkMonitor([in] PP_Resource resource);
};