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

Side by Side Diff: content/browser/trace_subscriber_stdio.h

Issue 9694028: Add a Content API around TracingController. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix linux 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
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_BROWSER_TRACE_SUBSCRIBER_STDIO_H_ 5 #ifndef CONTENT_BROWSER_TRACE_SUBSCRIBER_STDIO_H_
6 #define CONTENT_BROWSER_TRACE_SUBSCRIBER_STDIO_H_ 6 #define CONTENT_BROWSER_TRACE_SUBSCRIBER_STDIO_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
11 #include "base/compiler_specific.h"
11 #include "base/file_util.h" 12 #include "base/file_util.h"
12 #include "content/browser/trace_controller.h" 13 #include "content/public/browser/trace_subscriber.h"
13 #include "content/common/content_export.h" 14 #include "content/common/content_export.h"
14 15
15 namespace content { 16 namespace content {
16 17
17 class TraceSubscriberStdioImpl; 18 class TraceSubscriberStdioImpl;
18 19
19 // Stdio implementation of TraceSubscriber. Use this to write traces to a file. 20 // Stdio implementation of TraceSubscriber. Use this to write traces to a file.
20 class CONTENT_EXPORT TraceSubscriberStdio : public TraceSubscriber { 21 class CONTENT_EXPORT TraceSubscriberStdio
22 : NON_EXPORTED_BASE(public content::TraceSubscriber) {
21 public: 23 public:
22 // Creates or overwrites the specified file. Check IsValid() for success. 24 // Creates or overwrites the specified file. Check IsValid() for success.
23 explicit TraceSubscriberStdio(const FilePath& path); 25 explicit TraceSubscriberStdio(const FilePath& path);
24 virtual ~TraceSubscriberStdio(); 26 virtual ~TraceSubscriberStdio();
25 27
26 // Implementation of TraceSubscriber 28 // Implementation of TraceSubscriber
27 virtual void OnEndTracingComplete() OVERRIDE; 29 virtual void OnEndTracingComplete() OVERRIDE;
28 virtual void OnTraceDataCollected( 30 virtual void OnTraceDataCollected(
29 const scoped_refptr<base::RefCountedString>& data_ptr) OVERRIDE; 31 const scoped_refptr<base::RefCountedString>& data_ptr) OVERRIDE;
30 32
31 private: 33 private:
32 scoped_refptr<TraceSubscriberStdioImpl> impl_; 34 scoped_refptr<TraceSubscriberStdioImpl> impl_;
33 DISALLOW_COPY_AND_ASSIGN(TraceSubscriberStdio); 35 DISALLOW_COPY_AND_ASSIGN(TraceSubscriberStdio);
34 }; 36 };
35 37
36 } // namespace content 38 } // namespace content
37 39
38 #endif // CONTENT_BROWSER_TRACE_SUBSCRIBER_STDIO_H_ 40 #endif // CONTENT_BROWSER_TRACE_SUBSCRIBER_STDIO_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698