Chromium Code Reviews| Index: content/browser/debugger/devtools_trace_domain_handler.h |
| diff --git a/content/browser/debugger/devtools_trace_domain_handler.h b/content/browser/debugger/devtools_trace_domain_handler.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..f89c54f956a550ca864eb3ce00ba2062ca33f6ea |
| --- /dev/null |
| +++ b/content/browser/debugger/devtools_trace_domain_handler.h |
| @@ -0,0 +1,49 @@ |
| +// 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_DEBUGGER_DEVTOOLS_TRACE_HANDLER_H_ |
| +#define CONTENT_BROWSER_DEBUGGER_DEVTOOLS_TRACE_HANDLER_H_ |
| + |
| +#include "content/browser/debugger/devtools_browser_target.h" |
| +#include "content/public/browser/trace_subscriber.h" |
| + |
| +namespace content { |
| + |
| +// This class bridges DevTools remote debugging server with the trace |
| +// infrastructure. |
| +class DevToolsTraceDomainHandler |
| + : public TraceSubscriber, |
| + public DevToolsBrowserTarget::Handler { |
| + public: |
| + DevToolsTraceDomainHandler(); |
| + ~DevToolsTraceDomainHandler(); |
|
pfeldman
2012/12/14 10:39:33
virtual
bulach
2012/12/14 16:03:52
Done.
|
| + |
| + // TraceSubscriber: |
| + virtual void OnEndTracingComplete(); |
| + virtual void OnTraceDataCollected( |
| + const scoped_refptr<base::RefCountedString>& trace_fragment); |
| + |
| + // DevToolBrowserTarget::Handler: |
| + virtual base::Value* OnProtocolCommand( |
| + int connection_id, |
| + int request_id, |
| + const std::string& method, |
| + const base::DictionaryValue* params) OVERRIDE; |
| + |
| + private: |
| + base::Value* BeginTracing(const base::DictionaryValue* params); |
| + base::Value* EndTracingAsync(const base::DictionaryValue* params); |
| + base::Value* HasCompleted(const base::DictionaryValue* params); |
| + base::Value* GetAndResetTrace(const base::DictionaryValue* params); |
| + |
| + bool has_completed_; |
| + |
| + std::string buffer_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(DevToolsTraceDomainHandler); |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_BROWSER_DEBUGGER_DEVTOOLS_TRACE_HANDLER_H_ |