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

Side by Side Diff: ppapi/utility/network_list_observer.cc

Issue 9696051: Add NetworkListObserver utility class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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/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) {
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);
26 NetworkListPrivate list(list_resource);
27 object->OnNetworkList(list);
28 Module::Get()->core()->ReleaseResource(list_resource);
29 }
30
31 } // namespace pp
OLDNEW
« ppapi/utility/network_list_observer.h ('K') | « ppapi/utility/network_list_observer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698