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

Unified Diff: trunk/src/chrome/browser/automation/automation_provider.h

Issue 89753004: Revert 237280 "Remove TraceController" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: trunk/src/chrome/browser/automation/automation_provider.h
===================================================================
--- trunk/src/chrome/browser/automation/automation_provider.h (revision 237451)
+++ trunk/src/chrome/browser/automation/automation_provider.h (working copy)
@@ -29,6 +29,7 @@
#include "components/autofill/core/browser/field_types.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_observer.h"
+#include "content/public/browser/trace_subscriber.h"
#include "ipc/ipc_channel.h"
#include "ipc/ipc_listener.h"
#include "ipc/ipc_sender.h"
@@ -81,7 +82,8 @@
public IPC::Sender,
public base::SupportsWeakPtr<AutomationProvider>,
public base::RefCountedThreadSafe<
- AutomationProvider, content::BrowserThread::DeleteOnUIThread> {
+ AutomationProvider, content::BrowserThread::DeleteOnUIThread>,
+ public content::TraceSubscriber {
public:
explicit AutomationProvider(Profile* profile);
@@ -213,6 +215,17 @@
bool reinitialize_on_channel_error_;
private:
+ // Storage for EndTracing() to resume operations after a callback.
+ struct TracingData {
+ std::list<std::string> trace_output;
+ scoped_ptr<IPC::Message> reply_message;
+ };
+
+ // TraceSubscriber:
+ virtual void OnEndTracingComplete() OVERRIDE;
+ virtual void OnTraceDataCollected(
+ const scoped_refptr<base::RefCountedString>& trace_fragment) OVERRIDE;
+
void OnUnhandledMessage(const IPC::Message& message);
// Clear and reinitialize the automation IPC channel.
@@ -241,8 +254,7 @@
void BeginTracing(const std::string& category_patterns, bool* success);
void EndTracing(IPC::Message* reply_message);
- void OnTraceDataCollected(IPC::Message* reply_message,
- const base::FilePath& path);
+ void GetTracingOutput(std::string* chunk, bool* success);
// Asynchronous request for printing the current tab.
void PrintAsync(int tab_handle);
@@ -339,6 +351,10 @@
// ID of automation channel.
std::string channel_id_;
+ // Trace data that has been collected but not flushed to the automation
+ // client.
+ TracingData tracing_data_;
+
DISALLOW_COPY_AND_ASSIGN(AutomationProvider);
};
« no previous file with comments | « trunk/src/base/debug/trace_event_unittest.cc ('k') | trunk/src/chrome/browser/automation/automation_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698