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

Side by Side Diff: ppapi/shared_impl/ppapi_message_tracker.h

Issue 10983028: Render/pepper hang debugging: generate dumps for the browser and renderer processes if users kill a… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 2 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
« no previous file with comments | « ppapi/proxy/host_dispatcher.cc ('k') | ppapi/shared_impl/ppapi_message_tracker.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef PPAPI_SHARED_IMPL_PPAPI_MESSAGE_TRACKER_H_
6 #define PPAPI_SHARED_IMPL_PPAPI_MESSAGE_TRACKER_H_
7
8 #include "base/basictypes.h"
9 #include "base/synchronization/lock.h"
10 #include "ppapi/shared_impl/ppapi_shared_export.h"
11
12 template <typename T> struct DefaultSingletonTraits;
13
14 namespace ppapi {
15
16 // PpapiMessageTracker uses a counter to record whether anyone is sending or
17 // receiving pepper messages in the current process.
18 // This class is thread safe.
19 class PPAPI_SHARED_EXPORT PpapiMessageTracker {
20 public:
21 static PpapiMessageTracker* GetInstance();
22
23 void EnterMessageHandling();
24 void ExitMessageHandling();
25 bool IsHandlingMessage();
26
27 private:
28 friend struct DefaultSingletonTraits<PpapiMessageTracker>;
29
30 PpapiMessageTracker();
31 ~PpapiMessageTracker();
32
33 base::Lock lock_;
34 int enter_count_;
35
36 DISALLOW_COPY_AND_ASSIGN(PpapiMessageTracker);
37 };
38
39 class PPAPI_SHARED_EXPORT ScopedTrackPpapiMessage {
40 public:
41 ScopedTrackPpapiMessage();
42 ~ScopedTrackPpapiMessage();
43
44 private:
45 DISALLOW_COPY_AND_ASSIGN(ScopedTrackPpapiMessage);
46 };
47
48 } // namespace ppapi
49
50 #endif // PPAPI_SHARED_IMPL_PPAPI_MESSAGE_TRACKER_H_
OLDNEW
« no previous file with comments | « ppapi/proxy/host_dispatcher.cc ('k') | ppapi/shared_impl/ppapi_message_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698