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

Unified Diff: content/browser/devtools/protocol/devtools_protocol_handler_impl.h

Issue 683733010: NOT FOR COMMIT: Generated code for 642263004 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@singleUse
Patch Set: Created 6 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
« no previous file with comments | « no previous file | content/browser/devtools/protocol/devtools_protocol_handler_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/devtools/protocol/devtools_protocol_handler_impl.h
diff --git a/content/browser/devtools/protocol/devtools_protocol_handler_impl.h b/content/browser/devtools/protocol/devtools_protocol_handler_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..15f5e9ac65231bf08fc33a9dc689eb0827ad581f
--- /dev/null
+++ b/content/browser/devtools/protocol/devtools_protocol_handler_impl.h
@@ -0,0 +1,1748 @@
+// 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.
+
+// THIS FILE IS AUTOGENERATED. DO NOT EDIT.
+// Generated by
+// content/public/browser/devtools_protocol_handler_generator.py from
+// third_party/WebKit/Source/devtools/protocol.json
+
+#ifndef CONTENT_BROWSER_DEVTOOLS_PROTOCOL_DEVTOOLS_PROTOCOL_HANDLER_IMPL_H_
+#define CONTENT_BROWSER_DEVTOOLS_PROTOCOL_DEVTOOLS_PROTOCOL_HANDLER_IMPL_H_
+
+#include "content/browser/devtools/devtools_protocol.h"
+#include "content/browser/devtools/protocol/devtools_protocol_client.h"
+
+namespace content {
+
+class DevToolsProtocolHandlerImpl;
+
+namespace devtools {
+
+class ListBuilderBase {
+ public:
+ static scoped_ptr<base::ListValue> ToValue(ListBuilderBase src);
+
+ protected:
+ ListBuilderBase();
+ ListBuilderBase(scoped_ptr<base::ListValue> list_);
+
+ scoped_ptr<base::ListValue> list_;
+};
+
+template<class T>
+class ListBuilder : public ListBuilderBase {
+ MOVE_ONLY_TYPE_WITH_MOVE_CONSTRUCTOR_FOR_CPP_03(ListBuilder)
+ public:
+ ListBuilder() {}
+ ListBuilder(ListBuilder&& other) : ListBuilderBase(other.list_.Pass()) {
+ }
+
+ void push_back(T item) {
+ list_->Append(T::ToValue(item.Pass()).release());
+ }
+};
+
+template<>
+class ListBuilder<std::string> : public ListBuilderBase {
+ MOVE_ONLY_TYPE_WITH_MOVE_CONSTRUCTOR_FOR_CPP_03(ListBuilder)
+ public:
+ ListBuilder() {}
+ ListBuilder(ListBuilder&& other) : ListBuilderBase(other.list_.Pass()) {
+ }
+
+ void push_back(const std::string& item) {
+ list_->AppendString(item);
+ }
+};
+
+namespace inspector {
+template<int MASK>
+struct DetachedParamsBuilder {
+ MOVE_ONLY_TYPE_WITH_MOVE_CONSTRUCTOR_FOR_CPP_03(DetachedParamsBuilder)
+ public:
+ enum {
+ kAllSet = 0,
+ kReason = 1 << 0,
+ kNoneSet = kReason
+ };
+
+ DetachedParamsBuilder<MASK & ~kReason>&
+ set_reason(const std::string& reason) {
+ COMPILE_ASSERT(MASK & kReason, already_set);
+ dict_->SetString("reason", reason);
+ return ThisAs<DetachedParamsBuilder<MASK & ~kReason>>();
+ }
+
+ static DetachedParamsBuilder<kNoneSet> Create() {
+ return DetachedParamsBuilder<kNoneSet>();
+ }
+
+ static scoped_ptr<base::DictionaryValue> ToValue(
+ DetachedParamsBuilder src) {
+ return src.dict_.Pass();
+ }
+
+ DetachedParamsBuilder(DetachedParamsBuilder&& other)
+ : dict_(other.dict_.Pass()) {
+ }
+
+ private:
+ friend struct DetachedParamsBuilder<0>;
+
+ DetachedParamsBuilder() : dict_(new base::DictionaryValue()) {
+ }
+
+ template<class T> T& ThisAs() {
+ COMPILE_ASSERT(sizeof(*this) == sizeof(T), cannot_cast);
+ return *reinterpret_cast<T*>(this);
+ }
+
+ scoped_ptr<base::DictionaryValue> dict_;
+};
+
+typedef DetachedParamsBuilder<0> DetachedParams;
+
+} // namespace inspector
+
+namespace inspector {
+template<int MASK>
+struct TargetCrashedParamsBuilder {
+ MOVE_ONLY_TYPE_WITH_MOVE_CONSTRUCTOR_FOR_CPP_03(TargetCrashedParamsBuilder)
+ public:
+ enum {
+ kAllSet = 0,
+ kNoneSet = kAllSet
+ };
+
+
+ static TargetCrashedParamsBuilder<kNoneSet> Create() {
+ return TargetCrashedParamsBuilder<kNoneSet>();
+ }
+
+ static scoped_ptr<base::DictionaryValue> ToValue(
+ TargetCrashedParamsBuilder src) {
+ return src.dict_.Pass();
+ }
+
+ TargetCrashedParamsBuilder(TargetCrashedParamsBuilder&& other)
+ : dict_(other.dict_.Pass()) {
+ }
+
+ private:
+ friend struct TargetCrashedParamsBuilder<0>;
+
+ TargetCrashedParamsBuilder() : dict_(new base::DictionaryValue()) {
+ }
+
+ template<class T> T& ThisAs() {
+ COMPILE_ASSERT(sizeof(*this) == sizeof(T), cannot_cast);
+ return *reinterpret_cast<T*>(this);
+ }
+
+ scoped_ptr<base::DictionaryValue> dict_;
+};
+
+typedef TargetCrashedParamsBuilder<0> TargetCrashedParams;
+
+} // namespace inspector
+
+namespace inspector {
+class InspectorHandler;
+} // namespace domain
+
+namespace inspector {
+class Client : public DevToolsProtocolClient {
+ public:
+ Client(const RawMessageCallback& raw_message_callback);
+ virtual ~Client();
+
+ void Detached(
+ DetachedParams params);
+ void TargetCrashed(
+ TargetCrashedParams params);
+};
+} // namespace inspector
+
+namespace page {
+typedef std::string FrameId;
+} // namespace page
+
+namespace page {
+template<int MASK>
+struct NavigationEntryBuilder {
+ MOVE_ONLY_TYPE_WITH_MOVE_CONSTRUCTOR_FOR_CPP_03(NavigationEntryBuilder)
+ public:
+ enum {
+ kAllSet = 0,
+ kId = 1 << 0,
+ kUrl = 1 << 1,
+ kTitle = 1 << 2,
+ kNoneSet = kId | kUrl | kTitle
+ };
+
+ NavigationEntryBuilder<MASK & ~kId>&
+ set_id(int id) {
+ COMPILE_ASSERT(MASK & kId, already_set);
+ dict_->SetInteger("id", id);
+ return ThisAs<NavigationEntryBuilder<MASK & ~kId>>();
+ }
+
+ NavigationEntryBuilder<MASK & ~kUrl>&
+ set_url(const std::string& url) {
+ COMPILE_ASSERT(MASK & kUrl, already_set);
+ dict_->SetString("url", url);
+ return ThisAs<NavigationEntryBuilder<MASK & ~kUrl>>();
+ }
+
+ NavigationEntryBuilder<MASK & ~kTitle>&
+ set_title(const std::string& title) {
+ COMPILE_ASSERT(MASK & kTitle, already_set);
+ dict_->SetString("title", title);
+ return ThisAs<NavigationEntryBuilder<MASK & ~kTitle>>();
+ }
+
+ static NavigationEntryBuilder<kNoneSet> Create() {
+ return NavigationEntryBuilder<kNoneSet>();
+ }
+
+ static scoped_ptr<base::DictionaryValue> ToValue(
+ NavigationEntryBuilder src) {
+ return src.dict_.Pass();
+ }
+
+ NavigationEntryBuilder(NavigationEntryBuilder&& other)
+ : dict_(other.dict_.Pass()) {
+ }
+
+ private:
+ friend struct NavigationEntryBuilder<0>;
+
+ NavigationEntryBuilder() : dict_(new base::DictionaryValue()) {
+ }
+
+ template<class T> T& ThisAs() {
+ COMPILE_ASSERT(sizeof(*this) == sizeof(T), cannot_cast);
+ return *reinterpret_cast<T*>(this);
+ }
+
+ scoped_ptr<base::DictionaryValue> dict_;
+};
+
+typedef NavigationEntryBuilder<0> NavigationEntry;
+
+} // namespace page
+
+namespace page {
+template<int MASK>
+struct CaptureScreenshotResponseBuilder {
+ MOVE_ONLY_TYPE_WITH_MOVE_CONSTRUCTOR_FOR_CPP_03(CaptureScreenshotResponseBuilder)
+ public:
+ enum {
+ kAllSet = 0,
+ kData = 1 << 0,
+ kNoneSet = kData
+ };
+
+ CaptureScreenshotResponseBuilder<MASK & ~kData>&
+ set_data(const std::string& data) {
+ COMPILE_ASSERT(MASK & kData, already_set);
+ dict_->SetString("data", data);
+ return ThisAs<CaptureScreenshotResponseBuilder<MASK & ~kData>>();
+ }
+
+ static CaptureScreenshotResponseBuilder<kNoneSet> Create() {
+ return CaptureScreenshotResponseBuilder<kNoneSet>();
+ }
+
+ static scoped_ptr<base::DictionaryValue> ToValue(
+ CaptureScreenshotResponseBuilder src) {
+ return src.dict_.Pass();
+ }
+
+ CaptureScreenshotResponseBuilder(CaptureScreenshotResponseBuilder&& other)
+ : dict_(other.dict_.Pass()) {
+ }
+
+ private:
+ friend struct CaptureScreenshotResponseBuilder<0>;
+
+ CaptureScreenshotResponseBuilder() : dict_(new base::DictionaryValue()) {
+ }
+
+ template<class T> T& ThisAs() {
+ COMPILE_ASSERT(sizeof(*this) == sizeof(T), cannot_cast);
+ return *reinterpret_cast<T*>(this);
+ }
+
+ scoped_ptr<base::DictionaryValue> dict_;
+};
+
+typedef CaptureScreenshotResponseBuilder<0> CaptureScreenshotResponse;
+
+} // namespace page
+
+namespace page {
+namespace start_screencast {
+extern const char kFormatJpeg[];
+extern const char kFormatPng[];
+} // namespace start_screencast
+} // namespace page
+
+namespace page {
+template<int MASK>
+struct QuotaBuilder {
+ MOVE_ONLY_TYPE_WITH_MOVE_CONSTRUCTOR_FOR_CPP_03(QuotaBuilder)
+ public:
+ enum {
+ kAllSet = 0,
+ kTemporary = 1 << 0,
+ kPersistent = 1 << 1,
+ kNoneSet = kTemporary | kPersistent
+ };
+
+ QuotaBuilder<MASK & ~kTemporary>&
+ set_temporary(double temporary) {
+ COMPILE_ASSERT(MASK & kTemporary, already_set);
+ dict_->SetDouble("temporary", temporary);
+ return ThisAs<QuotaBuilder<MASK & ~kTemporary>>();
+ }
+
+ QuotaBuilder<MASK & ~kPersistent>&
+ set_persistent(double persistent) {
+ COMPILE_ASSERT(MASK & kPersistent, already_set);
+ dict_->SetDouble("persistent", persistent);
+ return ThisAs<QuotaBuilder<MASK & ~kPersistent>>();
+ }
+
+ static QuotaBuilder<kNoneSet> Create() {
+ return QuotaBuilder<kNoneSet>();
+ }
+
+ static scoped_ptr<base::DictionaryValue> ToValue(
+ QuotaBuilder src) {
+ return src.dict_.Pass();
+ }
+
+ QuotaBuilder(QuotaBuilder&& other)
+ : dict_(other.dict_.Pass()) {
+ }
+
+ private:
+ friend struct QuotaBuilder<0>;
+
+ QuotaBuilder() : dict_(new base::DictionaryValue()) {
+ }
+
+ template<class T> T& ThisAs() {
+ COMPILE_ASSERT(sizeof(*this) == sizeof(T), cannot_cast);
+ return *reinterpret_cast<T*>(this);
+ }
+
+ scoped_ptr<base::DictionaryValue> dict_;
+};
+
+typedef QuotaBuilder<0> Quota;
+
+} // namespace page
+
+namespace page {
+namespace usage_item {
+extern const char kIdFilesystem[];
+extern const char kIdDatabase[];
+extern const char kIdAppcache[];
+extern const char kIdIndexeddatabase[];
+} // namespace usage_item
+} // namespace page
+
+namespace page {
+template<int MASK>
+struct UsageItemBuilder {
+ MOVE_ONLY_TYPE_WITH_MOVE_CONSTRUCTOR_FOR_CPP_03(UsageItemBuilder)
+ public:
+ enum {
+ kAllSet = 0,
+ kId = 1 << 0,
+ kValue = 1 << 1,
+ kNoneSet = kId | kValue
+ };
+
+ UsageItemBuilder<MASK & ~kId>&
+ set_id(const std::string& id) {
+ COMPILE_ASSERT(MASK & kId, already_set);
+ dict_->SetString("id", id);
+ return ThisAs<UsageItemBuilder<MASK & ~kId>>();
+ }
+
+ UsageItemBuilder<MASK & ~kValue>&
+ set_value(double value) {
+ COMPILE_ASSERT(MASK & kValue, already_set);
+ dict_->SetDouble("value", value);
+ return ThisAs<UsageItemBuilder<MASK & ~kValue>>();
+ }
+
+ static UsageItemBuilder<kNoneSet> Create() {
+ return UsageItemBuilder<kNoneSet>();
+ }
+
+ static scoped_ptr<base::DictionaryValue> ToValue(
+ UsageItemBuilder src) {
+ return src.dict_.Pass();
+ }
+
+ UsageItemBuilder(UsageItemBuilder&& other)
+ : dict_(other.dict_.Pass()) {
+ }
+
+ private:
+ friend struct UsageItemBuilder<0>;
+
+ UsageItemBuilder() : dict_(new base::DictionaryValue()) {
+ }
+
+ template<class T> T& ThisAs() {
+ COMPILE_ASSERT(sizeof(*this) == sizeof(T), cannot_cast);
+ return *reinterpret_cast<T*>(this);
+ }
+
+ scoped_ptr<base::DictionaryValue> dict_;
+};
+
+typedef UsageItemBuilder<0> UsageItem;
+
+} // namespace page
+
+namespace page {
+template<int MASK>
+struct UsageBuilder {
+ MOVE_ONLY_TYPE_WITH_MOVE_CONSTRUCTOR_FOR_CPP_03(UsageBuilder)
+ public:
+ enum {
+ kAllSet = 0,
+ kTemporary = 1 << 0,
+ kPersistent = 1 << 1,
+ kSyncable = 1 << 2,
+ kNoneSet = kTemporary | kPersistent | kSyncable
+ };
+
+ UsageBuilder<MASK & ~kTemporary>&
+ set_temporary(devtools::ListBuilder<devtools::page::UsageItem> temporary) {
+ COMPILE_ASSERT(MASK & kTemporary, already_set);
+ dict_->Set("temporary",
+ devtools::ListBuilder<devtools::page::UsageItem>::ToValue(temporary.Pass()).release());
+ return ThisAs<UsageBuilder<MASK & ~kTemporary>>();
+ }
+
+ UsageBuilder<MASK & ~kPersistent>&
+ set_persistent(devtools::ListBuilder<devtools::page::UsageItem> persistent) {
+ COMPILE_ASSERT(MASK & kPersistent, already_set);
+ dict_->Set("persistent",
+ devtools::ListBuilder<devtools::page::UsageItem>::ToValue(persistent.Pass()).release());
+ return ThisAs<UsageBuilder<MASK & ~kPersistent>>();
+ }
+
+ UsageBuilder<MASK & ~kSyncable>&
+ set_syncable(devtools::ListBuilder<devtools::page::UsageItem> syncable) {
+ COMPILE_ASSERT(MASK & kSyncable, already_set);
+ dict_->Set("syncable",
+ devtools::ListBuilder<devtools::page::UsageItem>::ToValue(syncable.Pass()).release());
+ return ThisAs<UsageBuilder<MASK & ~kSyncable>>();
+ }
+
+ static UsageBuilder<kNoneSet> Create() {
+ return UsageBuilder<kNoneSet>();
+ }
+
+ static scoped_ptr<base::DictionaryValue> ToValue(
+ UsageBuilder src) {
+ return src.dict_.Pass();
+ }
+
+ UsageBuilder(UsageBuilder&& other)
+ : dict_(other.dict_.Pass()) {
+ }
+
+ private:
+ friend struct UsageBuilder<0>;
+
+ UsageBuilder() : dict_(new base::DictionaryValue()) {
+ }
+
+ template<class T> T& ThisAs() {
+ COMPILE_ASSERT(sizeof(*this) == sizeof(T), cannot_cast);
+ return *reinterpret_cast<T*>(this);
+ }
+
+ scoped_ptr<base::DictionaryValue> dict_;
+};
+
+typedef UsageBuilder<0> Usage;
+
+} // namespace page
+
+namespace page {
+template<int MASK>
+struct QueryUsageAndQuotaResponseBuilder {
+ MOVE_ONLY_TYPE_WITH_MOVE_CONSTRUCTOR_FOR_CPP_03(QueryUsageAndQuotaResponseBuilder)
+ public:
+ enum {
+ kAllSet = 0,
+ kQuota = 1 << 0,
+ kUsage = 1 << 1,
+ kNoneSet = kQuota | kUsage
+ };
+
+ QueryUsageAndQuotaResponseBuilder<MASK & ~kQuota>&
+ set_quota(devtools::page::Quota quota) {
+ COMPILE_ASSERT(MASK & kQuota, already_set);
+ dict_->Set("quota",
+ devtools::page::Quota::ToValue(quota.Pass()).release());
+ return ThisAs<QueryUsageAndQuotaResponseBuilder<MASK & ~kQuota>>();
+ }
+
+ QueryUsageAndQuotaResponseBuilder<MASK & ~kUsage>&
+ set_usage(devtools::page::Usage usage) {
+ COMPILE_ASSERT(MASK & kUsage, already_set);
+ dict_->Set("usage",
+ devtools::page::Usage::ToValue(usage.Pass()).release());
+ return ThisAs<QueryUsageAndQuotaResponseBuilder<MASK & ~kUsage>>();
+ }
+
+ static QueryUsageAndQuotaResponseBuilder<kNoneSet> Create() {
+ return QueryUsageAndQuotaResponseBuilder<kNoneSet>();
+ }
+
+ static scoped_ptr<base::DictionaryValue> ToValue(
+ QueryUsageAndQuotaResponseBuilder src) {
+ return src.dict_.Pass();
+ }
+
+ QueryUsageAndQuotaResponseBuilder(QueryUsageAndQuotaResponseBuilder&& other)
+ : dict_(other.dict_.Pass()) {
+ }
+
+ private:
+ friend struct QueryUsageAndQuotaResponseBuilder<0>;
+
+ QueryUsageAndQuotaResponseBuilder() : dict_(new base::DictionaryValue()) {
+ }
+
+ template<class T> T& ThisAs() {
+ COMPILE_ASSERT(sizeof(*this) == sizeof(T), cannot_cast);
+ return *reinterpret_cast<T*>(this);
+ }
+
+ scoped_ptr<base::DictionaryValue> dict_;
+};
+
+typedef QueryUsageAndQuotaResponseBuilder<0> QueryUsageAndQuotaResponse;
+
+} // namespace page
+
+namespace dom {
+template<int MASK>
+struct RectBuilder {
+ MOVE_ONLY_TYPE_WITH_MOVE_CONSTRUCTOR_FOR_CPP_03(RectBuilder)
+ public:
+ enum {
+ kAllSet = 0,
+ kX = 1 << 0,
+ kY = 1 << 1,
+ kWidth = 1 << 2,
+ kHeight = 1 << 3,
+ kNoneSet = kX | kY | kWidth | kHeight
+ };
+
+ RectBuilder<MASK & ~kX>&
+ set_x(double x) {
+ COMPILE_ASSERT(MASK & kX, already_set);
+ dict_->SetDouble("x", x);
+ return ThisAs<RectBuilder<MASK & ~kX>>();
+ }
+
+ RectBuilder<MASK & ~kY>&
+ set_y(double y) {
+ COMPILE_ASSERT(MASK & kY, already_set);
+ dict_->SetDouble("y", y);
+ return ThisAs<RectBuilder<MASK & ~kY>>();
+ }
+
+ RectBuilder<MASK & ~kWidth>&
+ set_width(double width) {
+ COMPILE_ASSERT(MASK & kWidth, already_set);
+ dict_->SetDouble("width", width);
+ return ThisAs<RectBuilder<MASK & ~kWidth>>();
+ }
+
+ RectBuilder<MASK & ~kHeight>&
+ set_height(double height) {
+ COMPILE_ASSERT(MASK & kHeight, already_set);
+ dict_->SetDouble("height", height);
+ return ThisAs<RectBuilder<MASK & ~kHeight>>();
+ }
+
+ static RectBuilder<kNoneSet> Create() {
+ return RectBuilder<kNoneSet>();
+ }
+
+ static scoped_ptr<base::DictionaryValue> ToValue(
+ RectBuilder src) {
+ return src.dict_.Pass();
+ }
+
+ RectBuilder(RectBuilder&& other)
+ : dict_(other.dict_.Pass()) {
+ }
+
+ private:
+ friend struct RectBuilder<0>;
+
+ RectBuilder() : dict_(new base::DictionaryValue()) {
+ }
+
+ template<class T> T& ThisAs() {
+ COMPILE_ASSERT(sizeof(*this) == sizeof(T), cannot_cast);
+ return *reinterpret_cast<T*>(this);
+ }
+
+ scoped_ptr<base::DictionaryValue> dict_;
+};
+
+typedef RectBuilder<0> Rect;
+
+} // namespace dom
+
+namespace page {
+template<int MASK>
+struct ScreencastFrameMetadataBuilder {
+ MOVE_ONLY_TYPE_WITH_MOVE_CONSTRUCTOR_FOR_CPP_03(ScreencastFrameMetadataBuilder)
+ public:
+ enum {
+ kAllSet = 0,
+ kDeviceScaleFactor = 1 << 0,
+ kViewport = 1 << 1,
+ kPageScaleFactor = 1 << 2,
+ kPageScaleFactorMin = 1 << 3,
+ kPageScaleFactorMax = 1 << 4,
+ kDeviceWidth = 1 << 5,
+ kDeviceHeight = 1 << 6,
+ kScrollOffsetX = 1 << 7,
+ kScrollOffsetY = 1 << 8,
+ kNoneSet = kDeviceScaleFactor | kViewport | kPageScaleFactor | kPageScaleFactorMin | kPageScaleFactorMax | kDeviceWidth | kDeviceHeight | kScrollOffsetX | kScrollOffsetY
+ };
+
+ ScreencastFrameMetadataBuilder<MASK & ~kDeviceScaleFactor>&
+ set_device_scale_factor(double device_scale_factor) {
+ COMPILE_ASSERT(MASK & kDeviceScaleFactor, already_set);
+ dict_->SetDouble("deviceScaleFactor", device_scale_factor);
+ return ThisAs<ScreencastFrameMetadataBuilder<MASK & ~kDeviceScaleFactor>>();
+ }
+
+ ScreencastFrameMetadataBuilder<MASK & ~kViewport>&
+ set_viewport(devtools::dom::Rect viewport) {
+ COMPILE_ASSERT(MASK & kViewport, already_set);
+ dict_->Set("viewport",
+ devtools::dom::Rect::ToValue(viewport.Pass()).release());
+ return ThisAs<ScreencastFrameMetadataBuilder<MASK & ~kViewport>>();
+ }
+
+ ScreencastFrameMetadataBuilder<MASK>&
+ set_offset_top(double offset_top) {
+ dict_->SetDouble("offsetTop", offset_top);
+ return *this;
+ }
+
+ ScreencastFrameMetadataBuilder<MASK>&
+ set_offset_bottom(double offset_bottom) {
+ dict_->SetDouble("offsetBottom", offset_bottom);
+ return *this;
+ }
+
+ ScreencastFrameMetadataBuilder<MASK & ~kPageScaleFactor>&
+ set_page_scale_factor(double page_scale_factor) {
+ COMPILE_ASSERT(MASK & kPageScaleFactor, already_set);
+ dict_->SetDouble("pageScaleFactor", page_scale_factor);
+ return ThisAs<ScreencastFrameMetadataBuilder<MASK & ~kPageScaleFactor>>();
+ }
+
+ ScreencastFrameMetadataBuilder<MASK & ~kPageScaleFactorMin>&
+ set_page_scale_factor_min(double page_scale_factor_min) {
+ COMPILE_ASSERT(MASK & kPageScaleFactorMin, already_set);
+ dict_->SetDouble("pageScaleFactorMin", page_scale_factor_min);
+ return ThisAs<ScreencastFrameMetadataBuilder<MASK & ~kPageScaleFactorMin>>();
+ }
+
+ ScreencastFrameMetadataBuilder<MASK & ~kPageScaleFactorMax>&
+ set_page_scale_factor_max(double page_scale_factor_max) {
+ COMPILE_ASSERT(MASK & kPageScaleFactorMax, already_set);
+ dict_->SetDouble("pageScaleFactorMax", page_scale_factor_max);
+ return ThisAs<ScreencastFrameMetadataBuilder<MASK & ~kPageScaleFactorMax>>();
+ }
+
+ ScreencastFrameMetadataBuilder<MASK & ~kDeviceWidth>&
+ set_device_width(double device_width) {
+ COMPILE_ASSERT(MASK & kDeviceWidth, already_set);
+ dict_->SetDouble("deviceWidth", device_width);
+ return ThisAs<ScreencastFrameMetadataBuilder<MASK & ~kDeviceWidth>>();
+ }
+
+ ScreencastFrameMetadataBuilder<MASK & ~kDeviceHeight>&
+ set_device_height(double device_height) {
+ COMPILE_ASSERT(MASK & kDeviceHeight, already_set);
+ dict_->SetDouble("deviceHeight", device_height);
+ return ThisAs<ScreencastFrameMetadataBuilder<MASK & ~kDeviceHeight>>();
+ }
+
+ ScreencastFrameMetadataBuilder<MASK & ~kScrollOffsetX>&
+ set_scroll_offset_x(double scroll_offset_x) {
+ COMPILE_ASSERT(MASK & kScrollOffsetX, already_set);
+ dict_->SetDouble("scrollOffsetX", scroll_offset_x);
+ return ThisAs<ScreencastFrameMetadataBuilder<MASK & ~kScrollOffsetX>>();
+ }
+
+ ScreencastFrameMetadataBuilder<MASK & ~kScrollOffsetY>&
+ set_scroll_offset_y(double scroll_offset_y) {
+ COMPILE_ASSERT(MASK & kScrollOffsetY, already_set);
+ dict_->SetDouble("scrollOffsetY", scroll_offset_y);
+ return ThisAs<ScreencastFrameMetadataBuilder<MASK & ~kScrollOffsetY>>();
+ }
+
+ static ScreencastFrameMetadataBuilder<kNoneSet> Create() {
+ return ScreencastFrameMetadataBuilder<kNoneSet>();
+ }
+
+ static scoped_ptr<base::DictionaryValue> ToValue(
+ ScreencastFrameMetadataBuilder src) {
+ return src.dict_.Pass();
+ }
+
+ ScreencastFrameMetadataBuilder(ScreencastFrameMetadataBuilder&& other)
+ : dict_(other.dict_.Pass()) {
+ }
+
+ private:
+ friend struct ScreencastFrameMetadataBuilder<0>;
+
+ ScreencastFrameMetadataBuilder() : dict_(new base::DictionaryValue()) {
+ }
+
+ template<class T> T& ThisAs() {
+ COMPILE_ASSERT(sizeof(*this) == sizeof(T), cannot_cast);
+ return *reinterpret_cast<T*>(this);
+ }
+
+ scoped_ptr<base::DictionaryValue> dict_;
+};
+
+typedef ScreencastFrameMetadataBuilder<0> ScreencastFrameMetadata;
+
+} // namespace page
+
+namespace page {
+template<int MASK>
+struct ScreencastFrameParamsBuilder {
+ MOVE_ONLY_TYPE_WITH_MOVE_CONSTRUCTOR_FOR_CPP_03(ScreencastFrameParamsBuilder)
+ public:
+ enum {
+ kAllSet = 0,
+ kData = 1 << 0,
+ kMetadata = 1 << 1,
+ kNoneSet = kData | kMetadata
+ };
+
+ ScreencastFrameParamsBuilder<MASK & ~kData>&
+ set_data(const std::string& data) {
+ COMPILE_ASSERT(MASK & kData, already_set);
+ dict_->SetString("data", data);
+ return ThisAs<ScreencastFrameParamsBuilder<MASK & ~kData>>();
+ }
+
+ ScreencastFrameParamsBuilder<MASK & ~kMetadata>&
+ set_metadata(devtools::page::ScreencastFrameMetadata metadata) {
+ COMPILE_ASSERT(MASK & kMetadata, already_set);
+ dict_->Set("metadata",
+ devtools::page::ScreencastFrameMetadata::ToValue(metadata.Pass()).release());
+ return ThisAs<ScreencastFrameParamsBuilder<MASK & ~kMetadata>>();
+ }
+
+ static ScreencastFrameParamsBuilder<kNoneSet> Create() {
+ return ScreencastFrameParamsBuilder<kNoneSet>();
+ }
+
+ static scoped_ptr<base::DictionaryValue> ToValue(
+ ScreencastFrameParamsBuilder src) {
+ return src.dict_.Pass();
+ }
+
+ ScreencastFrameParamsBuilder(ScreencastFrameParamsBuilder&& other)
+ : dict_(other.dict_.Pass()) {
+ }
+
+ private:
+ friend struct ScreencastFrameParamsBuilder<0>;
+
+ ScreencastFrameParamsBuilder() : dict_(new base::DictionaryValue()) {
+ }
+
+ template<class T> T& ThisAs() {
+ COMPILE_ASSERT(sizeof(*this) == sizeof(T), cannot_cast);
+ return *reinterpret_cast<T*>(this);
+ }
+
+ scoped_ptr<base::DictionaryValue> dict_;
+};
+
+typedef ScreencastFrameParamsBuilder<0> ScreencastFrameParams;
+
+} // namespace page
+
+namespace page {
+template<int MASK>
+struct ScreencastVisibilityChangedParamsBuilder {
+ MOVE_ONLY_TYPE_WITH_MOVE_CONSTRUCTOR_FOR_CPP_03(ScreencastVisibilityChangedParamsBuilder)
+ public:
+ enum {
+ kAllSet = 0,
+ kVisible = 1 << 0,
+ kNoneSet = kVisible
+ };
+
+ ScreencastVisibilityChangedParamsBuilder<MASK & ~kVisible>&
+ set_visible(bool visible) {
+ COMPILE_ASSERT(MASK & kVisible, already_set);
+ dict_->SetBoolean("visible", visible);
+ return ThisAs<ScreencastVisibilityChangedParamsBuilder<MASK & ~kVisible>>();
+ }
+
+ static ScreencastVisibilityChangedParamsBuilder<kNoneSet> Create() {
+ return ScreencastVisibilityChangedParamsBuilder<kNoneSet>();
+ }
+
+ static scoped_ptr<base::DictionaryValue> ToValue(
+ ScreencastVisibilityChangedParamsBuilder src) {
+ return src.dict_.Pass();
+ }
+
+ ScreencastVisibilityChangedParamsBuilder(ScreencastVisibilityChangedParamsBuilder&& other)
+ : dict_(other.dict_.Pass()) {
+ }
+
+ private:
+ friend struct ScreencastVisibilityChangedParamsBuilder<0>;
+
+ ScreencastVisibilityChangedParamsBuilder() : dict_(new base::DictionaryValue()) {
+ }
+
+ template<class T> T& ThisAs() {
+ COMPILE_ASSERT(sizeof(*this) == sizeof(T), cannot_cast);
+ return *reinterpret_cast<T*>(this);
+ }
+
+ scoped_ptr<base::DictionaryValue> dict_;
+};
+
+typedef ScreencastVisibilityChangedParamsBuilder<0> ScreencastVisibilityChangedParams;
+
+} // namespace page
+
+namespace dom {
+template<int MASK>
+struct RGBABuilder {
+ MOVE_ONLY_TYPE_WITH_MOVE_CONSTRUCTOR_FOR_CPP_03(RGBABuilder)
+ public:
+ enum {
+ kAllSet = 0,
+ kR = 1 << 0,
+ kG = 1 << 1,
+ kB = 1 << 2,
+ kNoneSet = kR | kG | kB
+ };
+
+ RGBABuilder<MASK & ~kR>&
+ set_r(int r) {
+ COMPILE_ASSERT(MASK & kR, already_set);
+ dict_->SetInteger("r", r);
+ return ThisAs<RGBABuilder<MASK & ~kR>>();
+ }
+
+ RGBABuilder<MASK & ~kG>&
+ set_g(int g) {
+ COMPILE_ASSERT(MASK & kG, already_set);
+ dict_->SetInteger("g", g);
+ return ThisAs<RGBABuilder<MASK & ~kG>>();
+ }
+
+ RGBABuilder<MASK & ~kB>&
+ set_b(int b) {
+ COMPILE_ASSERT(MASK & kB, already_set);
+ dict_->SetInteger("b", b);
+ return ThisAs<RGBABuilder<MASK & ~kB>>();
+ }
+
+ RGBABuilder<MASK>&
+ set_a(double a) {
+ dict_->SetDouble("a", a);
+ return *this;
+ }
+
+ static RGBABuilder<kNoneSet> Create() {
+ return RGBABuilder<kNoneSet>();
+ }
+
+ static scoped_ptr<base::DictionaryValue> ToValue(
+ RGBABuilder src) {
+ return src.dict_.Pass();
+ }
+
+ RGBABuilder(RGBABuilder&& other)
+ : dict_(other.dict_.Pass()) {
+ }
+
+ private:
+ friend struct RGBABuilder<0>;
+
+ RGBABuilder() : dict_(new base::DictionaryValue()) {
+ }
+
+ template<class T> T& ThisAs() {
+ COMPILE_ASSERT(sizeof(*this) == sizeof(T), cannot_cast);
+ return *reinterpret_cast<T*>(this);
+ }
+
+ scoped_ptr<base::DictionaryValue> dict_;
+};
+
+typedef RGBABuilder<0> RGBA;
+
+} // namespace dom
+
+namespace page {
+template<int MASK>
+struct ColorPickedParamsBuilder {
+ MOVE_ONLY_TYPE_WITH_MOVE_CONSTRUCTOR_FOR_CPP_03(ColorPickedParamsBuilder)
+ public:
+ enum {
+ kAllSet = 0,
+ kColor = 1 << 0,
+ kNoneSet = kColor
+ };
+
+ ColorPickedParamsBuilder<MASK & ~kColor>&
+ set_color(devtools::dom::RGBA color) {
+ COMPILE_ASSERT(MASK & kColor, already_set);
+ dict_->Set("color",
+ devtools::dom::RGBA::ToValue(color.Pass()).release());
+ return ThisAs<ColorPickedParamsBuilder<MASK & ~kColor>>();
+ }
+
+ static ColorPickedParamsBuilder<kNoneSet> Create() {
+ return ColorPickedParamsBuilder<kNoneSet>();
+ }
+
+ static scoped_ptr<base::DictionaryValue> ToValue(
+ ColorPickedParamsBuilder src) {
+ return src.dict_.Pass();
+ }
+
+ ColorPickedParamsBuilder(ColorPickedParamsBuilder&& other)
+ : dict_(other.dict_.Pass()) {
+ }
+
+ private:
+ friend struct ColorPickedParamsBuilder<0>;
+
+ ColorPickedParamsBuilder() : dict_(new base::DictionaryValue()) {
+ }
+
+ template<class T> T& ThisAs() {
+ COMPILE_ASSERT(sizeof(*this) == sizeof(T), cannot_cast);
+ return *reinterpret_cast<T*>(this);
+ }
+
+ scoped_ptr<base::DictionaryValue> dict_;
+};
+
+typedef ColorPickedParamsBuilder<0> ColorPickedParams;
+
+} // namespace page
+
+namespace page {
+template<int MASK>
+struct InterstitialShownParamsBuilder {
+ MOVE_ONLY_TYPE_WITH_MOVE_CONSTRUCTOR_FOR_CPP_03(InterstitialShownParamsBuilder)
+ public:
+ enum {
+ kAllSet = 0,
+ kNoneSet = kAllSet
+ };
+
+
+ static InterstitialShownParamsBuilder<kNoneSet> Create() {
+ return InterstitialShownParamsBuilder<kNoneSet>();
+ }
+
+ static scoped_ptr<base::DictionaryValue> ToValue(
+ InterstitialShownParamsBuilder src) {
+ return src.dict_.Pass();
+ }
+
+ InterstitialShownParamsBuilder(InterstitialShownParamsBuilder&& other)
+ : dict_(other.dict_.Pass()) {
+ }
+
+ private:
+ friend struct InterstitialShownParamsBuilder<0>;
+
+ InterstitialShownParamsBuilder() : dict_(new base::DictionaryValue()) {
+ }
+
+ template<class T> T& ThisAs() {
+ COMPILE_ASSERT(sizeof(*this) == sizeof(T), cannot_cast);
+ return *reinterpret_cast<T*>(this);
+ }
+
+ scoped_ptr<base::DictionaryValue> dict_;
+};
+
+typedef InterstitialShownParamsBuilder<0> InterstitialShownParams;
+
+} // namespace page
+
+namespace page {
+template<int MASK>
+struct InterstitialHiddenParamsBuilder {
+ MOVE_ONLY_TYPE_WITH_MOVE_CONSTRUCTOR_FOR_CPP_03(InterstitialHiddenParamsBuilder)
+ public:
+ enum {
+ kAllSet = 0,
+ kNoneSet = kAllSet
+ };
+
+
+ static InterstitialHiddenParamsBuilder<kNoneSet> Create() {
+ return InterstitialHiddenParamsBuilder<kNoneSet>();
+ }
+
+ static scoped_ptr<base::DictionaryValue> ToValue(
+ InterstitialHiddenParamsBuilder src) {
+ return src.dict_.Pass();
+ }
+
+ InterstitialHiddenParamsBuilder(InterstitialHiddenParamsBuilder&& other)
+ : dict_(other.dict_.Pass()) {
+ }
+
+ private:
+ friend struct InterstitialHiddenParamsBuilder<0>;
+
+ InterstitialHiddenParamsBuilder() : dict_(new base::DictionaryValue()) {
+ }
+
+ template<class T> T& ThisAs() {
+ COMPILE_ASSERT(sizeof(*this) == sizeof(T), cannot_cast);
+ return *reinterpret_cast<T*>(this);
+ }
+
+ scoped_ptr<base::DictionaryValue> dict_;
+};
+
+typedef InterstitialHiddenParamsBuilder<0> InterstitialHiddenParams;
+
+} // namespace page
+
+namespace page {
+class PageHandler;
+} // namespace domain
+
+namespace page {
+class Client : public DevToolsProtocolClient {
+ public:
+ Client(const RawMessageCallback& raw_message_callback);
+ virtual ~Client();
+
+ void SendCaptureScreenshotResponse(
+ scoped_refptr<DevToolsProtocol::Command> command,
+ CaptureScreenshotResponse params);
+ void SendQueryUsageAndQuotaResponse(
+ scoped_refptr<DevToolsProtocol::Command> command,
+ QueryUsageAndQuotaResponse params);
+ void ScreencastFrame(
+ ScreencastFrameParams params);
+ void ScreencastVisibilityChanged(
+ ScreencastVisibilityChangedParams params);
+ void ColorPicked(
+ ColorPickedParams params);
+ void InterstitialShown(
+ InterstitialShownParams params);
+ void InterstitialHidden(
+ InterstitialHiddenParams params);
+};
+} // namespace page
+
+namespace network {
+class NetworkHandler;
+} // namespace domain
+
+namespace dom {
+typedef int NodeId;
+} // namespace dom
+
+namespace dom {
+class DOMHandler;
+} // namespace domain
+
+namespace worker {
+template<int MASK>
+struct DisconnectedFromWorkerParamsBuilder {
+ MOVE_ONLY_TYPE_WITH_MOVE_CONSTRUCTOR_FOR_CPP_03(DisconnectedFromWorkerParamsBuilder)
+ public:
+ enum {
+ kAllSet = 0,
+ kNoneSet = kAllSet
+ };
+
+
+ static DisconnectedFromWorkerParamsBuilder<kNoneSet> Create() {
+ return DisconnectedFromWorkerParamsBuilder<kNoneSet>();
+ }
+
+ static scoped_ptr<base::DictionaryValue> ToValue(
+ DisconnectedFromWorkerParamsBuilder src) {
+ return src.dict_.Pass();
+ }
+
+ DisconnectedFromWorkerParamsBuilder(DisconnectedFromWorkerParamsBuilder&& other)
+ : dict_(other.dict_.Pass()) {
+ }
+
+ private:
+ friend struct DisconnectedFromWorkerParamsBuilder<0>;
+
+ DisconnectedFromWorkerParamsBuilder() : dict_(new base::DictionaryValue()) {
+ }
+
+ template<class T> T& ThisAs() {
+ COMPILE_ASSERT(sizeof(*this) == sizeof(T), cannot_cast);
+ return *reinterpret_cast<T*>(this);
+ }
+
+ scoped_ptr<base::DictionaryValue> dict_;
+};
+
+typedef DisconnectedFromWorkerParamsBuilder<0> DisconnectedFromWorkerParams;
+
+} // namespace worker
+
+namespace worker {
+class WorkerHandler;
+} // namespace domain
+
+namespace worker {
+class Client : public DevToolsProtocolClient {
+ public:
+ Client(const RawMessageCallback& raw_message_callback);
+ virtual ~Client();
+
+ void DisconnectedFromWorker(
+ DisconnectedFromWorkerParams params);
+};
+} // namespace worker
+
+namespace input {
+namespace emulate_touch_from_mouse_event {
+extern const char kTypeMousePressed[];
+extern const char kTypeMouseReleased[];
+extern const char kTypeMouseMoved[];
+extern const char kTypeMouseWheel[];
+} // namespace emulate_touch_from_mouse_event
+} // namespace input
+
+namespace input {
+namespace emulate_touch_from_mouse_event {
+extern const char kButtonNone[];
+extern const char kButtonLeft[];
+extern const char kButtonMiddle[];
+extern const char kButtonRight[];
+} // namespace emulate_touch_from_mouse_event
+} // namespace input
+
+namespace input {
+class InputHandler;
+} // namespace domain
+
+namespace tracing {
+template<int MASK>
+struct StartResponseBuilder {
+ MOVE_ONLY_TYPE_WITH_MOVE_CONSTRUCTOR_FOR_CPP_03(StartResponseBuilder)
+ public:
+ enum {
+ kAllSet = 0,
+ kNoneSet = kAllSet
+ };
+
+
+ static StartResponseBuilder<kNoneSet> Create() {
+ return StartResponseBuilder<kNoneSet>();
+ }
+
+ static scoped_ptr<base::DictionaryValue> ToValue(
+ StartResponseBuilder src) {
+ return src.dict_.Pass();
+ }
+
+ StartResponseBuilder(StartResponseBuilder&& other)
+ : dict_(other.dict_.Pass()) {
+ }
+
+ private:
+ friend struct StartResponseBuilder<0>;
+
+ StartResponseBuilder() : dict_(new base::DictionaryValue()) {
+ }
+
+ template<class T> T& ThisAs() {
+ COMPILE_ASSERT(sizeof(*this) == sizeof(T), cannot_cast);
+ return *reinterpret_cast<T*>(this);
+ }
+
+ scoped_ptr<base::DictionaryValue> dict_;
+};
+
+typedef StartResponseBuilder<0> StartResponse;
+
+} // namespace tracing
+
+namespace tracing {
+template<int MASK>
+struct EndResponseBuilder {
+ MOVE_ONLY_TYPE_WITH_MOVE_CONSTRUCTOR_FOR_CPP_03(EndResponseBuilder)
+ public:
+ enum {
+ kAllSet = 0,
+ kNoneSet = kAllSet
+ };
+
+
+ static EndResponseBuilder<kNoneSet> Create() {
+ return EndResponseBuilder<kNoneSet>();
+ }
+
+ static scoped_ptr<base::DictionaryValue> ToValue(
+ EndResponseBuilder src) {
+ return src.dict_.Pass();
+ }
+
+ EndResponseBuilder(EndResponseBuilder&& other)
+ : dict_(other.dict_.Pass()) {
+ }
+
+ private:
+ friend struct EndResponseBuilder<0>;
+
+ EndResponseBuilder() : dict_(new base::DictionaryValue()) {
+ }
+
+ template<class T> T& ThisAs() {
+ COMPILE_ASSERT(sizeof(*this) == sizeof(T), cannot_cast);
+ return *reinterpret_cast<T*>(this);
+ }
+
+ scoped_ptr<base::DictionaryValue> dict_;
+};
+
+typedef EndResponseBuilder<0> EndResponse;
+
+} // namespace tracing
+
+namespace tracing {
+template<int MASK>
+struct GetCategoriesResponseBuilder {
+ MOVE_ONLY_TYPE_WITH_MOVE_CONSTRUCTOR_FOR_CPP_03(GetCategoriesResponseBuilder)
+ public:
+ enum {
+ kAllSet = 0,
+ kCategories = 1 << 0,
+ kNoneSet = kCategories
+ };
+
+ GetCategoriesResponseBuilder<MASK & ~kCategories>&
+ set_categories(devtools::ListBuilder<std::string> categories) {
+ COMPILE_ASSERT(MASK & kCategories, already_set);
+ dict_->Set("categories",
+ devtools::ListBuilder<std::string>::ToValue(categories.Pass()).release());
+ return ThisAs<GetCategoriesResponseBuilder<MASK & ~kCategories>>();
+ }
+
+ static GetCategoriesResponseBuilder<kNoneSet> Create() {
+ return GetCategoriesResponseBuilder<kNoneSet>();
+ }
+
+ static scoped_ptr<base::DictionaryValue> ToValue(
+ GetCategoriesResponseBuilder src) {
+ return src.dict_.Pass();
+ }
+
+ GetCategoriesResponseBuilder(GetCategoriesResponseBuilder&& other)
+ : dict_(other.dict_.Pass()) {
+ }
+
+ private:
+ friend struct GetCategoriesResponseBuilder<0>;
+
+ GetCategoriesResponseBuilder() : dict_(new base::DictionaryValue()) {
+ }
+
+ template<class T> T& ThisAs() {
+ COMPILE_ASSERT(sizeof(*this) == sizeof(T), cannot_cast);
+ return *reinterpret_cast<T*>(this);
+ }
+
+ scoped_ptr<base::DictionaryValue> dict_;
+};
+
+typedef GetCategoriesResponseBuilder<0> GetCategoriesResponse;
+
+} // namespace tracing
+
+namespace tracing {
+template<int MASK>
+struct DataCollectedParamsBuilder {
+ MOVE_ONLY_TYPE_WITH_MOVE_CONSTRUCTOR_FOR_CPP_03(DataCollectedParamsBuilder)
+ public:
+ enum {
+ kAllSet = 0,
+ kValue = 1 << 0,
+ kNoneSet = kValue
+ };
+
+ DataCollectedParamsBuilder<MASK & ~kValue>&
+ set_value(devtools::ListBuilder<base::DictionaryValue> value) {
+ COMPILE_ASSERT(MASK & kValue, already_set);
+ dict_->Set("value",
+ devtools::ListBuilder<base::DictionaryValue>::ToValue(value.Pass()).release());
+ return ThisAs<DataCollectedParamsBuilder<MASK & ~kValue>>();
+ }
+
+ static DataCollectedParamsBuilder<kNoneSet> Create() {
+ return DataCollectedParamsBuilder<kNoneSet>();
+ }
+
+ static scoped_ptr<base::DictionaryValue> ToValue(
+ DataCollectedParamsBuilder src) {
+ return src.dict_.Pass();
+ }
+
+ DataCollectedParamsBuilder(DataCollectedParamsBuilder&& other)
+ : dict_(other.dict_.Pass()) {
+ }
+
+ private:
+ friend struct DataCollectedParamsBuilder<0>;
+
+ DataCollectedParamsBuilder() : dict_(new base::DictionaryValue()) {
+ }
+
+ template<class T> T& ThisAs() {
+ COMPILE_ASSERT(sizeof(*this) == sizeof(T), cannot_cast);
+ return *reinterpret_cast<T*>(this);
+ }
+
+ scoped_ptr<base::DictionaryValue> dict_;
+};
+
+typedef DataCollectedParamsBuilder<0> DataCollectedParams;
+
+} // namespace tracing
+
+namespace tracing {
+template<int MASK>
+struct TracingCompleteParamsBuilder {
+ MOVE_ONLY_TYPE_WITH_MOVE_CONSTRUCTOR_FOR_CPP_03(TracingCompleteParamsBuilder)
+ public:
+ enum {
+ kAllSet = 0,
+ kNoneSet = kAllSet
+ };
+
+
+ static TracingCompleteParamsBuilder<kNoneSet> Create() {
+ return TracingCompleteParamsBuilder<kNoneSet>();
+ }
+
+ static scoped_ptr<base::DictionaryValue> ToValue(
+ TracingCompleteParamsBuilder src) {
+ return src.dict_.Pass();
+ }
+
+ TracingCompleteParamsBuilder(TracingCompleteParamsBuilder&& other)
+ : dict_(other.dict_.Pass()) {
+ }
+
+ private:
+ friend struct TracingCompleteParamsBuilder<0>;
+
+ TracingCompleteParamsBuilder() : dict_(new base::DictionaryValue()) {
+ }
+
+ template<class T> T& ThisAs() {
+ COMPILE_ASSERT(sizeof(*this) == sizeof(T), cannot_cast);
+ return *reinterpret_cast<T*>(this);
+ }
+
+ scoped_ptr<base::DictionaryValue> dict_;
+};
+
+typedef TracingCompleteParamsBuilder<0> TracingCompleteParams;
+
+} // namespace tracing
+
+namespace tracing {
+template<int MASK>
+struct BufferUsageParamsBuilder {
+ MOVE_ONLY_TYPE_WITH_MOVE_CONSTRUCTOR_FOR_CPP_03(BufferUsageParamsBuilder)
+ public:
+ enum {
+ kAllSet = 0,
+ kValue = 1 << 0,
+ kNoneSet = kValue
+ };
+
+ BufferUsageParamsBuilder<MASK & ~kValue>&
+ set_value(double value) {
+ COMPILE_ASSERT(MASK & kValue, already_set);
+ dict_->SetDouble("value", value);
+ return ThisAs<BufferUsageParamsBuilder<MASK & ~kValue>>();
+ }
+
+ static BufferUsageParamsBuilder<kNoneSet> Create() {
+ return BufferUsageParamsBuilder<kNoneSet>();
+ }
+
+ static scoped_ptr<base::DictionaryValue> ToValue(
+ BufferUsageParamsBuilder src) {
+ return src.dict_.Pass();
+ }
+
+ BufferUsageParamsBuilder(BufferUsageParamsBuilder&& other)
+ : dict_(other.dict_.Pass()) {
+ }
+
+ private:
+ friend struct BufferUsageParamsBuilder<0>;
+
+ BufferUsageParamsBuilder() : dict_(new base::DictionaryValue()) {
+ }
+
+ template<class T> T& ThisAs() {
+ COMPILE_ASSERT(sizeof(*this) == sizeof(T), cannot_cast);
+ return *reinterpret_cast<T*>(this);
+ }
+
+ scoped_ptr<base::DictionaryValue> dict_;
+};
+
+typedef BufferUsageParamsBuilder<0> BufferUsageParams;
+
+} // namespace tracing
+
+namespace tracing {
+class TracingHandler;
+} // namespace domain
+
+namespace tracing {
+class Client : public DevToolsProtocolClient {
+ public:
+ Client(const RawMessageCallback& raw_message_callback);
+ virtual ~Client();
+
+ void SendStartResponse(
+ scoped_refptr<DevToolsProtocol::Command> command,
+ StartResponse params);
+ void SendEndResponse(
+ scoped_refptr<DevToolsProtocol::Command> command,
+ EndResponse params);
+ void SendGetCategoriesResponse(
+ scoped_refptr<DevToolsProtocol::Command> command,
+ GetCategoriesResponse params);
+ void DataCollected(
+ DataCollectedParams params);
+ void TracingComplete(
+ TracingCompleteParams params);
+ void BufferUsage(
+ BufferUsageParams params);
+};
+} // namespace tracing
+
+namespace power {
+namespace get_accuracy_level {
+extern const char kResultHigh[];
+extern const char kResultModerate[];
+extern const char kResultLow[];
+} // namespace get_accuracy_level
+} // namespace power
+
+namespace power {
+template<int MASK>
+struct PowerEventBuilder {
+ MOVE_ONLY_TYPE_WITH_MOVE_CONSTRUCTOR_FOR_CPP_03(PowerEventBuilder)
+ public:
+ enum {
+ kAllSet = 0,
+ kType = 1 << 0,
+ kTimestamp = 1 << 1,
+ kValue = 1 << 2,
+ kNoneSet = kType | kTimestamp | kValue
+ };
+
+ PowerEventBuilder<MASK & ~kType>&
+ set_type(const std::string& type) {
+ COMPILE_ASSERT(MASK & kType, already_set);
+ dict_->SetString("type", type);
+ return ThisAs<PowerEventBuilder<MASK & ~kType>>();
+ }
+
+ PowerEventBuilder<MASK & ~kTimestamp>&
+ set_timestamp(double timestamp) {
+ COMPILE_ASSERT(MASK & kTimestamp, already_set);
+ dict_->SetDouble("timestamp", timestamp);
+ return ThisAs<PowerEventBuilder<MASK & ~kTimestamp>>();
+ }
+
+ PowerEventBuilder<MASK & ~kValue>&
+ set_value(double value) {
+ COMPILE_ASSERT(MASK & kValue, already_set);
+ dict_->SetDouble("value", value);
+ return ThisAs<PowerEventBuilder<MASK & ~kValue>>();
+ }
+
+ static PowerEventBuilder<kNoneSet> Create() {
+ return PowerEventBuilder<kNoneSet>();
+ }
+
+ static scoped_ptr<base::DictionaryValue> ToValue(
+ PowerEventBuilder src) {
+ return src.dict_.Pass();
+ }
+
+ PowerEventBuilder(PowerEventBuilder&& other)
+ : dict_(other.dict_.Pass()) {
+ }
+
+ private:
+ friend struct PowerEventBuilder<0>;
+
+ PowerEventBuilder() : dict_(new base::DictionaryValue()) {
+ }
+
+ template<class T> T& ThisAs() {
+ COMPILE_ASSERT(sizeof(*this) == sizeof(T), cannot_cast);
+ return *reinterpret_cast<T*>(this);
+ }
+
+ scoped_ptr<base::DictionaryValue> dict_;
+};
+
+typedef PowerEventBuilder<0> PowerEvent;
+
+} // namespace power
+
+namespace power {
+template<int MASK>
+struct DataAvailableParamsBuilder {
+ MOVE_ONLY_TYPE_WITH_MOVE_CONSTRUCTOR_FOR_CPP_03(DataAvailableParamsBuilder)
+ public:
+ enum {
+ kAllSet = 0,
+ kValue = 1 << 0,
+ kNoneSet = kValue
+ };
+
+ DataAvailableParamsBuilder<MASK & ~kValue>&
+ set_value(devtools::ListBuilder<devtools::power::PowerEvent> value) {
+ COMPILE_ASSERT(MASK & kValue, already_set);
+ dict_->Set("value",
+ devtools::ListBuilder<devtools::power::PowerEvent>::ToValue(value.Pass()).release());
+ return ThisAs<DataAvailableParamsBuilder<MASK & ~kValue>>();
+ }
+
+ static DataAvailableParamsBuilder<kNoneSet> Create() {
+ return DataAvailableParamsBuilder<kNoneSet>();
+ }
+
+ static scoped_ptr<base::DictionaryValue> ToValue(
+ DataAvailableParamsBuilder src) {
+ return src.dict_.Pass();
+ }
+
+ DataAvailableParamsBuilder(DataAvailableParamsBuilder&& other)
+ : dict_(other.dict_.Pass()) {
+ }
+
+ private:
+ friend struct DataAvailableParamsBuilder<0>;
+
+ DataAvailableParamsBuilder() : dict_(new base::DictionaryValue()) {
+ }
+
+ template<class T> T& ThisAs() {
+ COMPILE_ASSERT(sizeof(*this) == sizeof(T), cannot_cast);
+ return *reinterpret_cast<T*>(this);
+ }
+
+ scoped_ptr<base::DictionaryValue> dict_;
+};
+
+typedef DataAvailableParamsBuilder<0> DataAvailableParams;
+
+} // namespace power
+
+namespace power {
+class PowerHandler;
+} // namespace domain
+
+namespace power {
+class Client : public DevToolsProtocolClient {
+ public:
+ Client(const RawMessageCallback& raw_message_callback);
+ virtual ~Client();
+
+ void DataAvailable(
+ DataAvailableParams params);
+};
+} // namespace power
+
+} // namespace devtools
+
+class DevToolsProtocolHandlerImpl : public DevToolsProtocol::Handler {
+ public:
+ typedef DevToolsProtocolClient::Response Response;
+ typedef DevToolsProtocolClient::ResponseStatus ResponseStatus;
+
+ DevToolsProtocolHandlerImpl();
+ virtual ~DevToolsProtocolHandlerImpl();
+
+ void SetInspectorHandler(
+ devtools::inspector::InspectorHandler* inspector_handler);
+ void SetPageHandler(
+ devtools::page::PageHandler* page_handler);
+ void SetNetworkHandler(
+ devtools::network::NetworkHandler* network_handler);
+ void SetDOMHandler(
+ devtools::dom::DOMHandler* dom_handler);
+ void SetWorkerHandler(
+ devtools::worker::WorkerHandler* worker_handler);
+ void SetInputHandler(
+ devtools::input::InputHandler* input_handler);
+ void SetTracingHandler(
+ devtools::tracing::TracingHandler* tracing_handler);
+ void SetPowerHandler(
+ devtools::power::PowerHandler* power_handler);
+
+ private:
+ scoped_refptr<DevToolsProtocol::Response>
+ OnPageEnable(
+ scoped_refptr<DevToolsProtocol::Command> command);
+ scoped_refptr<DevToolsProtocol::Response>
+ OnPageDisable(
+ scoped_refptr<DevToolsProtocol::Command> command);
+ scoped_refptr<DevToolsProtocol::Response>
+ OnPageReload(
+ scoped_refptr<DevToolsProtocol::Command> command);
+ scoped_refptr<DevToolsProtocol::Response>
+ OnPageNavigate(
+ scoped_refptr<DevToolsProtocol::Command> command);
+ scoped_refptr<DevToolsProtocol::Response>
+ OnPageGetNavigationHistory(
+ scoped_refptr<DevToolsProtocol::Command> command);
+ scoped_refptr<DevToolsProtocol::Response>
+ OnPageNavigateToHistoryEntry(
+ scoped_refptr<DevToolsProtocol::Command> command);
+ scoped_refptr<DevToolsProtocol::Response>
+ OnPageSetGeolocationOverride(
+ scoped_refptr<DevToolsProtocol::Command> command);
+ scoped_refptr<DevToolsProtocol::Response>
+ OnPageClearGeolocationOverride(
+ scoped_refptr<DevToolsProtocol::Command> command);
+ scoped_refptr<DevToolsProtocol::Response>
+ OnPageSetTouchEmulationEnabled(
+ scoped_refptr<DevToolsProtocol::Command> command);
+ scoped_refptr<DevToolsProtocol::Response>
+ OnPageCaptureScreenshot(
+ scoped_refptr<DevToolsProtocol::Command> command);
+ scoped_refptr<DevToolsProtocol::Response>
+ OnPageCanScreencast(
+ scoped_refptr<DevToolsProtocol::Command> command);
+ scoped_refptr<DevToolsProtocol::Response>
+ OnPageCanEmulate(
+ scoped_refptr<DevToolsProtocol::Command> command);
+ scoped_refptr<DevToolsProtocol::Response>
+ OnPageStartScreencast(
+ scoped_refptr<DevToolsProtocol::Command> command);
+ scoped_refptr<DevToolsProtocol::Response>
+ OnPageStopScreencast(
+ scoped_refptr<DevToolsProtocol::Command> command);
+ scoped_refptr<DevToolsProtocol::Response>
+ OnPageHandleJavaScriptDialog(
+ scoped_refptr<DevToolsProtocol::Command> command);
+ scoped_refptr<DevToolsProtocol::Response>
+ OnPageQueryUsageAndQuota(
+ scoped_refptr<DevToolsProtocol::Command> command);
+ scoped_refptr<DevToolsProtocol::Response>
+ OnPageSetColorPickerEnabled(
+ scoped_refptr<DevToolsProtocol::Command> command);
+ scoped_refptr<DevToolsProtocol::Response>
+ OnNetworkClearBrowserCache(
+ scoped_refptr<DevToolsProtocol::Command> command);
+ scoped_refptr<DevToolsProtocol::Response>
+ OnNetworkClearBrowserCookies(
+ scoped_refptr<DevToolsProtocol::Command> command);
+ scoped_refptr<DevToolsProtocol::Response>
+ OnNetworkCanEmulateNetworkConditions(
+ scoped_refptr<DevToolsProtocol::Command> command);
+ scoped_refptr<DevToolsProtocol::Response>
+ OnNetworkEmulateNetworkConditions(
+ scoped_refptr<DevToolsProtocol::Command> command);
+ scoped_refptr<DevToolsProtocol::Response>
+ OnDOMSetFileInputFiles(
+ scoped_refptr<DevToolsProtocol::Command> command);
+ scoped_refptr<DevToolsProtocol::Response>
+ OnWorkerDisconnectFromWorker(
+ scoped_refptr<DevToolsProtocol::Command> command);
+ scoped_refptr<DevToolsProtocol::Response>
+ OnInputEmulateTouchFromMouseEvent(
+ scoped_refptr<DevToolsProtocol::Command> command);
+ scoped_refptr<DevToolsProtocol::Response>
+ OnTracingStart(
+ scoped_refptr<DevToolsProtocol::Command> command);
+ scoped_refptr<DevToolsProtocol::Response>
+ OnTracingEnd(
+ scoped_refptr<DevToolsProtocol::Command> command);
+ scoped_refptr<DevToolsProtocol::Response>
+ OnTracingGetCategories(
+ scoped_refptr<DevToolsProtocol::Command> command);
+ scoped_refptr<DevToolsProtocol::Response>
+ OnPowerStart(
+ scoped_refptr<DevToolsProtocol::Command> command);
+ scoped_refptr<DevToolsProtocol::Response>
+ OnPowerEnd(
+ scoped_refptr<DevToolsProtocol::Command> command);
+ scoped_refptr<DevToolsProtocol::Response>
+ OnPowerCanProfilePower(
+ scoped_refptr<DevToolsProtocol::Command> command);
+ scoped_refptr<DevToolsProtocol::Response>
+ OnPowerGetAccuracyLevel(
+ scoped_refptr<DevToolsProtocol::Command> command);
+
+ devtools::inspector::InspectorHandler* inspector_handler_;
+ devtools::page::PageHandler* page_handler_;
+ devtools::network::NetworkHandler* network_handler_;
+ devtools::dom::DOMHandler* dom_handler_;
+ devtools::worker::WorkerHandler* worker_handler_;
+ devtools::input::InputHandler* input_handler_;
+ devtools::tracing::TracingHandler* tracing_handler_;
+ devtools::power::PowerHandler* power_handler_;
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_DEVTOOLS_PROTOCOL_HANDLER_IMPL_H_
« no previous file with comments | « no previous file | content/browser/devtools/protocol/devtools_protocol_handler_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698