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

Unified Diff: third_party/WebKit/Source/platform/inspector_protocol/Values_cpp.template

Issue 2238423002: [DevTools] Generate all files in inspector_protocol. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2240663003
Patch Set: Created 4 years, 4 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: third_party/WebKit/Source/platform/inspector_protocol/Values_cpp.template
diff --git a/third_party/WebKit/Source/platform/inspector_protocol/Values.cpp b/third_party/WebKit/Source/platform/inspector_protocol/Values_cpp.template
similarity index 95%
rename from third_party/WebKit/Source/platform/inspector_protocol/Values.cpp
rename to third_party/WebKit/Source/platform/inspector_protocol/Values_cpp.template
index 33a89da25aea436d58eeee25e6c26f52ae2ae638..482ec46ab44af7bd3e8c3e962539477ab6caaf54 100644
--- a/third_party/WebKit/Source/platform/inspector_protocol/Values.cpp
+++ b/third_party/WebKit/Source/platform/inspector_protocol/Values_cpp.template
@@ -2,11 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "platform/inspector_protocol/Values.h"
-
-#include "platform/inspector_protocol/Parser.h"
-#include "platform/inspector_protocol/String16.h"
-
#include <algorithm>
#include <cmath>
@@ -15,9 +10,9 @@ namespace protocol {
namespace {
-const char* const nullString = "null";
-const char* const trueString = "true";
-const char* const falseString = "false";
+const char* const nullValueString = "null";
+const char* const trueValueString = "true";
+const char* const falseValueString = "false";
inline bool escapeChar(UChar c, String16Builder* dst)
{
@@ -109,7 +104,7 @@ String16 Value::toJSONString() const
void Value::writeJSON(String16Builder* output) const
{
DCHECK(m_type == TypeNull);
- output->append(nullString, 4);
+ output->append(nullValueString, 4);
}
std::unique_ptr<Value> Value::clone() const
@@ -151,12 +146,12 @@ void FundamentalValue::writeJSON(String16Builder* output) const
DCHECK(type() == TypeBoolean || type() == TypeInteger || type() == TypeDouble);
if (type() == TypeBoolean) {
if (m_boolValue)
- output->append(trueString, 4);
+ output->append(trueValueString, 4);
else
- output->append(falseString, 5);
+ output->append(falseValueString, 5);
} else if (type() == TypeDouble) {
if (!std::isfinite(m_doubleValue)) {
- output->append(nullString, 4);
+ output->append(nullValueString, 4);
return;
}
output->append(String16::fromDouble(m_doubleValue));

Powered by Google App Engine
This is Rietveld 408576698