summaryrefslogtreecommitdiffstats
path: root/ppapi/shared_impl
diff options
context:
space:
mode:
authoryzshen@chromium.org <yzshen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-26 02:01:40 +0000
committeryzshen@chromium.org <yzshen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-26 02:01:40 +0000
commit6c2432f4a60bb8d6858e3db349097335482660ef (patch)
treefdcc8064c1c853f704c0f97a5a7916d2e3da3230 /ppapi/shared_impl
parent9c07d74653d35edc49fd1bb0225b326dca4585c9 (diff)
downloadchromium_src-6c2432f4a60bb8d6858e3db349097335482660ef.zip
chromium_src-6c2432f4a60bb8d6858e3db349097335482660ef.tar.gz
chromium_src-6c2432f4a60bb8d6858e3db349097335482660ef.tar.bz2
Render/pepper hang debugging: generate dumps for the browser and renderer processes if users kill a hung pepper plugin.
This CL collects information in order to diagnose inter-process pepper deadlocks. - We don't crash those renderers or the browser. - We only do this on the Windows Canary channel for 20% of pepper plugin hangs, if there are not too many renderers (<4). BUG=147593 TEST=None Review URL: https://chromiumcodereview.appspot.com/10983028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@158717 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/shared_impl')
-rw-r--r--ppapi/shared_impl/ppapi_message_tracker.cc47
-rw-r--r--ppapi/shared_impl/ppapi_message_tracker.h50
2 files changed, 0 insertions, 97 deletions
diff --git a/ppapi/shared_impl/ppapi_message_tracker.cc b/ppapi/shared_impl/ppapi_message_tracker.cc
deleted file mode 100644
index 4fba69f..0000000
--- a/ppapi/shared_impl/ppapi_message_tracker.cc
+++ /dev/null
@@ -1,47 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "ppapi/shared_impl/ppapi_message_tracker.h"
-
-#include "base/logging.h"
-#include "base/memory/singleton.h"
-
-namespace ppapi {
-
-//static
-PpapiMessageTracker* PpapiMessageTracker::GetInstance() {
- return Singleton<PpapiMessageTracker>::get();
-}
-
-PpapiMessageTracker::PpapiMessageTracker() : enter_count_(0) {
-}
-
-PpapiMessageTracker::~PpapiMessageTracker() {
-}
-
-void PpapiMessageTracker::EnterMessageHandling() {
- base::AutoLock auto_lock(lock_);
- enter_count_++;
-}
-
-void PpapiMessageTracker::ExitMessageHandling() {
- base::AutoLock auto_lock(lock_);
- DCHECK_GT(enter_count_, 0);
- enter_count_--;
-}
-
-bool PpapiMessageTracker::IsHandlingMessage() {
- base::AutoLock auto_lock(lock_);
- return enter_count_ > 0;
-}
-
-ScopedTrackPpapiMessage::ScopedTrackPpapiMessage() {
- PpapiMessageTracker::GetInstance()->EnterMessageHandling();
-}
-
-ScopedTrackPpapiMessage::~ScopedTrackPpapiMessage() {
- PpapiMessageTracker::GetInstance()->ExitMessageHandling();
-}
-
-} // namespace ppapi
diff --git a/ppapi/shared_impl/ppapi_message_tracker.h b/ppapi/shared_impl/ppapi_message_tracker.h
deleted file mode 100644
index d817b97..0000000
--- a/ppapi/shared_impl/ppapi_message_tracker.h
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef PPAPI_SHARED_IMPL_PPAPI_MESSAGE_TRACKER_H_
-#define PPAPI_SHARED_IMPL_PPAPI_MESSAGE_TRACKER_H_
-
-#include "base/basictypes.h"
-#include "base/synchronization/lock.h"
-#include "ppapi/shared_impl/ppapi_shared_export.h"
-
-template <typename T> struct DefaultSingletonTraits;
-
-namespace ppapi {
-
-// PpapiMessageTracker uses a counter to record whether anyone is sending or
-// receiving pepper messages in the current process.
-// This class is thread safe.
-class PPAPI_SHARED_EXPORT PpapiMessageTracker {
- public:
- static PpapiMessageTracker* GetInstance();
-
- void EnterMessageHandling();
- void ExitMessageHandling();
- bool IsHandlingMessage();
-
- private:
- friend struct DefaultSingletonTraits<PpapiMessageTracker>;
-
- PpapiMessageTracker();
- ~PpapiMessageTracker();
-
- base::Lock lock_;
- int enter_count_;
-
- DISALLOW_COPY_AND_ASSIGN(PpapiMessageTracker);
-};
-
-class PPAPI_SHARED_EXPORT ScopedTrackPpapiMessage {
- public:
- ScopedTrackPpapiMessage();
- ~ScopedTrackPpapiMessage();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(ScopedTrackPpapiMessage);
-};
-
-} // namespace ppapi
-
-#endif // PPAPI_SHARED_IMPL_PPAPI_MESSAGE_TRACKER_H_