diff options
author | wangxianzhu@chromium.org <wangxianzhu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-02 23:43:48 +0000 |
---|---|---|
committer | wangxianzhu@chromium.org <wangxianzhu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-02 23:43:48 +0000 |
commit | 398752be784a614f6267b2a4840d70e475266a92 (patch) | |
tree | 84a3cf0e843e4d60cae31dad374c8f720a77e512 /content/browser/tracing/trace_controller_impl.h | |
parent | f9c764b9f07e6b1ebed375480e421376d7139317 (diff) | |
download | chromium_src-398752be784a614f6267b2a4840d70e475266a92.zip chromium_src-398752be784a614f6267b2a4840d70e475266a92.tar.gz chromium_src-398752be784a614f6267b2a4840d70e475266a92.tar.bz2 |
Revert "Revert 237280 "Remove TraceController""
This reverts commit 6aa58b8599840160df945afa89e7482d14d1c4d4.
Fixed double-close issue when ending recording.
> Revert 237280 "Remove TraceController"
>
> Seems to have broken trace-based telemetry benchmarks on android.
>
> BUG=323749
>
> > Remove TraceController
> >
> > TraceController is obsoleted by TracingController.
> > Changed all remaining clients to use TracingController.
> >
> > BUG=none
> >
> > Review URL: https://codereview.chromium.org/67683003
>
> TBR=wangxianzhu@chromium.org
>
> Review URL: https://codereview.chromium.org/89753004
>
> git-svn-id: svn://svn.chromium.org/chrome/trunk/src@237452 0039d316-1c4b-4281-b951-d872f2087c98
TBR=wangxianzhu@chromium.org
Review URL: https://codereview.chromium.org/99103004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238234 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/tracing/trace_controller_impl.h')
-rw-r--r-- | content/browser/tracing/trace_controller_impl.h | 105 |
1 files changed, 0 insertions, 105 deletions
diff --git a/content/browser/tracing/trace_controller_impl.h b/content/browser/tracing/trace_controller_impl.h deleted file mode 100644 index c058a04..0000000 --- a/content/browser/tracing/trace_controller_impl.h +++ /dev/null @@ -1,105 +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 CONTENT_BROWSER_TRACING_TRACE_CONTROLLER_IMPL_H_ -#define CONTENT_BROWSER_TRACING_TRACE_CONTROLLER_IMPL_H_ - -#include <set> -#include <string> -#include <vector> - -#include "base/debug/trace_event.h" -#include "base/lazy_instance.h" -#include "content/public/browser/trace_controller.h" - -class CommandLine; - -namespace content { -class TraceMessageFilter; - -class TraceControllerImpl : public TraceController { - public: - static TraceControllerImpl* GetInstance(); - - // TraceController implementation: - virtual bool BeginTracing(TraceSubscriber* subscriber, - const std::string& category_patterns, - base::debug::TraceLog::Options options) OVERRIDE; - virtual bool EndTracingAsync(TraceSubscriber* subscriber) OVERRIDE; - virtual bool GetTraceBufferPercentFullAsync( - TraceSubscriber* subscriber) OVERRIDE; - virtual bool SetWatchEvent(TraceSubscriber* subscriber, - const std::string& category_name, - const std::string& event_name) OVERRIDE; - virtual bool CancelWatchEvent(TraceSubscriber* subscriber) OVERRIDE; - virtual void CancelSubscriber(TraceSubscriber* subscriber) OVERRIDE; - virtual bool GetKnownCategoryGroupsAsync(TraceSubscriber* subscriber) - OVERRIDE; - - private: - typedef std::set<scoped_refptr<TraceMessageFilter> > FilterMap; - - friend struct base::DefaultLazyInstanceTraits<TraceControllerImpl>; - friend class TraceMessageFilter; - - TraceControllerImpl(); - virtual ~TraceControllerImpl(); - - bool is_tracing_enabled() const { - return can_end_tracing(); - } - - bool can_end_tracing() const { - return is_tracing_ && pending_end_ack_count_ == 0; - } - - // Can get Buffer Percent Full - bool can_get_buffer_percent_full() const { - return is_tracing_ && - pending_end_ack_count_ == 0 && - pending_bpf_ack_count_ == 0; - } - - bool can_begin_tracing(TraceSubscriber* subscriber) const { - return !is_tracing_ && - (subscriber_ == NULL || subscriber == subscriber_); - } - - // Methods for use by TraceMessageFilter. - - void AddFilter(TraceMessageFilter* filter); - void RemoveFilter(TraceMessageFilter* filter); - void OnTracingBegan(TraceSubscriber* subscriber); - void OnEndTracingAck(const std::vector<std::string>& known_category_groups); - void OnTraceDataCollected( - const scoped_refptr<base::RefCountedString>& events_str_ptr); - void OnTraceNotification(int notification); - void OnTraceBufferPercentFullReply(float percent_full); - - // Callback of TraceLog::Flush() for the local trace. - void OnLocalTraceDataCollected( - const scoped_refptr<base::RefCountedString>& events_str_ptr, - bool has_more_events); - - FilterMap filters_; - TraceSubscriber* subscriber_; - // Pending acks for EndTracingAsync: - int pending_end_ack_count_; - // Pending acks for GetTraceBufferPercentFullAsync: - int pending_bpf_ack_count_; - float maximum_bpf_; - bool is_tracing_; - bool is_get_category_groups_; - std::set<std::string> known_category_groups_; - std::string watch_category_; - std::string watch_name_; - base::debug::TraceLog::Options trace_options_; - base::debug::CategoryFilter category_filter_; - - DISALLOW_COPY_AND_ASSIGN(TraceControllerImpl); -}; - -} // namespace content - -#endif // CONTENT_BROWSER_TRACING_TRACE_CONTROLLER_IMPL_H_ |