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

Side by Side Diff: ppapi/cpp/extensions/event_base.cc

Issue 103093004: Remove PPB_Ext_Alarms_Dev and PPB_Ext_Events_Dev. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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) 2013 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/extensions/event_base.h"
6
7 #include "ppapi/cpp/extensions/dev/events_dev.h"
8
9 namespace pp {
10 namespace ext {
11 namespace internal {
12
13 GenericEventBase::GenericEventBase(
14 const InstanceHandle& instance,
15 const PP_Ext_EventListener& pp_listener)
16 : instance_(instance),
17 listener_id_(0),
18 pp_listener_(pp_listener) {
19 }
20
21 GenericEventBase::~GenericEventBase() {
22 StopListening();
23 }
24
25 bool GenericEventBase::StartListening() {
26 if (IsListening())
27 return true;
28
29 listener_id_ = events::Events_Dev::AddListener(instance_.pp_instance(),
30 pp_listener_);
31 return IsListening();
32 }
33
34 void GenericEventBase::StopListening() {
35 if (!IsListening())
36 return;
37
38 events::Events_Dev::RemoveListener(instance_.pp_instance(), listener_id_);
39 listener_id_ = 0;
40 }
41
42 } // namespace internal
43 } // namespace ext
44 } // namespace pp
OLDNEW
« no previous file with comments | « ppapi/cpp/extensions/event_base.h ('k') | ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698