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

Unified Diff: content/browser/devtools/devtools_protocol_frontend.h

Issue 508973003: DevTools: Protocol handler generator for content (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/devtools/devtools_protocol_frontend.h
diff --git a/content/browser/devtools/devtools_protocol_frontend.h b/content/browser/devtools/devtools_protocol_frontend.h
new file mode 100644
index 0000000000000000000000000000000000000000..50daffd8fabdd77d7c95a5020f0c57a5d6f2cce4
--- /dev/null
+++ b/content/browser/devtools/devtools_protocol_frontend.h
@@ -0,0 +1,45 @@
+// Copyright 2014 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_DEVTOOLS_DEVTOOLS_PROTOCOL_FRONTEND_H_
+#define CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_PROTOCOL_FRONTEND_H_
+
+#include "content/browser/devtools/devtools_protocol.h"
+
+namespace content {
+
+class DevToolsProtocolFrontend {
+ public:
+ typedef base::Callback<void(const std::string& event,
+ base::DictionaryValue* params)> EventCallback;
+ enum ResponseStatus {
+ RESPONSE_STATUS_FALLTHROUGH,
+ RESPONSE_STATUS_OK,
+ RESPONSE_STATUS_INVALID_PARAMS,
+ RESPONSE_STATUS_SERVER_ERROR,
dgozman 2014/09/09 14:30:59 Add internal error as well.
vkuzkokov 2014/09/10 10:33:12 Done.
+ };
+
+ struct Response {
+ Response(ResponseStatus status, const std::string& message);
dgozman 2014/09/09 14:30:59 Let's add static Response FallThrough(); static R
vkuzkokov 2014/09/10 10:33:12 Done.
+
+ ResponseStatus status_;
+ std::string message_;
+ };
+
+ protected:
+ explicit DevToolsProtocolFrontend(const EventCallback& event_callback);
+ virtual ~DevToolsProtocolFrontend();
+
+ void SendNotification(const std::string& method,
+ base::DictionaryValue* params);
+
+ private:
+ EventCallback event_callback_;
+
+ DISALLOW_COPY_AND_ASSIGN(DevToolsProtocolFrontend);
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_PROTOCOL_FRONTEND_H_

Powered by Google App Engine
This is Rietveld 408576698