Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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/utility/private/network_list_observer.h" | |
| 6 | |
| 7 #include "ppapi/cpp/private/network_list_private.h" | |
| 8 #include "ppapi/cpp/module.h" | |
| 9 | |
| 10 namespace pp { | |
| 11 | |
| 12 NetworkListObserver::NetworkListObserver(const InstanceHandle& instance) | |
| 13 : monitor_(instance, &NetworkListObserver::NetworkListCallbackHandler, | |
| 14 this) { | |
|
dmichael (off chromium)
2012/03/16 20:06:11
You probably need to use PP_ALLOW_THIS_IN_INITIALI
Sergey Ulanov
2012/03/17 00:43:48
Done.
| |
| 15 } | |
| 16 | |
| 17 NetworkListObserver::~NetworkListObserver() { | |
| 18 } | |
| 19 | |
| 20 // static | |
| 21 void NetworkListObserver::NetworkListCallbackHandler( | |
| 22 void* user_data, | |
| 23 PP_Resource list_resource) { | |
| 24 NetworkListObserver* object = | |
| 25 static_cast<NetworkListObserver*>(user_data); | |
|
dmichael (off chromium)
2012/03/16 20:06:11
style nit: looks like this might fit on 1 line?
Sergey Ulanov
2012/03/17 00:43:48
Done.
| |
| 26 NetworkListPrivate list(list_resource); | |
| 27 object->OnNetworkListChanged(list); | |
| 28 Module::Get()->core()->ReleaseResource(list_resource); | |
| 29 } | |
| 30 | |
| 31 } // namespace pp | |
| OLD | NEW |