Chromium Code Reviews| Index: content/browser/debugger/devtools_browser_target.h |
| diff --git a/content/browser/debugger/devtools_browser_target.h b/content/browser/debugger/devtools_browser_target.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..b81eb63889a1996326a258761583c9f45ac23348 |
| --- /dev/null |
| +++ b/content/browser/debugger/devtools_browser_target.h |
| @@ -0,0 +1,58 @@ |
| +// 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_BROWSER_TARGET_H_ |
| +#define CONTENT_BROWSER_DEBUGGER_DEVTOOLS_BROWSER_TARGET_H_ |
| + |
| +#include <map> |
| +#include <string> |
| + |
| +#include "base/basictypes.h" |
| + |
| +namespace base { |
| + |
| +class DictionaryValue; |
| +class Value; |
| + |
| +} // namespace base |
| + |
| +namespace content { |
| + |
| +// This class handles the "Browser" target for remote debugging. |
| +class DevToolsBrowserTarget { |
| + public: |
| + class Handler { |
| + public: |
| + // |return_value| ownership is transferred to the caller. |
| + virtual base::Value* OnProtocolCommand( |
| + int connection_id, |
|
pfeldman
2012/12/14 10:39:33
I don't think it needs connection_id
bulach
2012/12/14 16:03:52
Done.
|
| + int request_id, |
|
pfeldman
2012/12/14 10:39:33
Handler should not need request_id as well - Brows
bulach
2012/12/14 16:03:52
Done.
|
| + const std::string& method, |
| + const base::DictionaryValue* params) = 0; |
| + |
|
pfeldman
2012/12/14 10:39:33
protected:
virtual ~Handler() {}
bulach
2012/12/14 16:03:52
has to be public now that ownership is properly tr
|
| + }; |
| + |
| + explicit DevToolsBrowserTarget(int connection_id); |
| + ~DevToolsBrowserTarget(); |
| + |
| + int connection_id() const { return connection_id_; } |
| + |
| + // Takes ownership of |handler|. |
|
pfeldman
2012/12/14 10:39:33
Not according to the code.
bulach
2012/12/14 16:03:52
argh! :) my bad, forgot to update when moving from
|
| + void RegisterHandler(const std::string& domain, Handler* handler); |
| + |
| + base::Value* OnWebSocketMessage(int connection_id, |
|
pfeldman
2012/12/14 10:39:33
No need for connection_id
bulach
2012/12/14 16:03:52
Done.
|
| + const std::string& data); |
| + |
| + private: |
| + const int connection_id_; |
| + |
| + typedef std::map<std::string, Handler*> HandlersMap; |
| + HandlersMap handlers_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(DevToolsBrowserTarget); |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_BROWSER_DEBUGGER_DEVTOOLS_BROWSER_TARGET_H_ |