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
3// found in the LICENSE file.
4
5#include "ppapi/cpp/private/network_monitor_private.h"
6
7#include "ppapi/cpp/instance.h"
8#include "ppapi/cpp/module_impl.h"
9
10namespace pp {
11
12namespace {
13
14template <> const char* interface_name<PPB_NetworkMonitor_Private>() {
15  return PPB_NETWORKMONITOR_PRIVATE_INTERFACE;
16}
17
18}  // namespace
19
20NetworkMonitorPrivate::NetworkMonitorPrivate(
21    const InstanceHandle& instance,
22    PPB_NetworkMonitor_Callback callback,
23    void* user_data) {
24  if (has_interface<PPB_NetworkMonitor_Private>()) {
25    PassRefFromConstructor(get_interface<PPB_NetworkMonitor_Private>()->Create(
26        instance.pp_instance(), callback, user_data));
27  }
28}
29
30// static
31bool NetworkMonitorPrivate::IsAvailable() {
32  return has_interface<PPB_NetworkMonitor_Private>();
33}
34
35}  // namespace pp
36