| Index: third_party/WebKit/Source/platform/v8_inspector/StringUtil.h
|
| diff --git a/third_party/WebKit/Source/platform/v8_inspector/V8StringUtil.h b/third_party/WebKit/Source/platform/v8_inspector/StringUtil.h
|
| similarity index 57%
|
| rename from third_party/WebKit/Source/platform/v8_inspector/V8StringUtil.h
|
| rename to third_party/WebKit/Source/platform/v8_inspector/StringUtil.h
|
| index db1e4d08d91f9ff667410cff4d33cc2282202d31..d73e62148426242bfb0933153585c2aa67ff065b 100644
|
| --- a/third_party/WebKit/Source/platform/v8_inspector/V8StringUtil.h
|
| +++ b/third_party/WebKit/Source/platform/v8_inspector/StringUtil.h
|
| @@ -2,42 +2,54 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#ifndef V8StringUtil_h
|
| -#define V8StringUtil_h
|
| +#ifndef StringUtil_h
|
| +#define StringUtil_h
|
|
|
| -#include "platform/inspector_protocol/InspectorProtocol.h"
|
| -#include "platform/v8_inspector/protocol/Debugger.h"
|
| +#include "platform/v8_inspector/Allocator.h"
|
| +#include "platform/v8_inspector/String16.h"
|
| #include "platform/v8_inspector/public/StringBuffer.h"
|
| #include "platform/v8_inspector/public/StringView.h"
|
| +
|
| #include <v8.h>
|
|
|
| namespace v8_inspector {
|
|
|
| -class V8InspectorSession;
|
| +namespace protocol {
|
| +
|
| +class Value;
|
| +
|
| +using String = v8_inspector::String16;
|
| +using StringBuilder = v8_inspector::String16Builder;
|
| +
|
| +class StringUtil {
|
| +public:
|
| + static String substring(const String& s, unsigned pos, unsigned len) { return s.substring(pos, len); }
|
| + static String fromInteger(int number) { return String::fromInteger(number); }
|
| + static String fromDouble(double number) { return String::fromDouble(number); }
|
| + static const size_t kNotFound = String::kNotFound;
|
| + static void builderReserve(StringBuilder& builder, unsigned capacity) { builder.reserveCapacity(capacity); }
|
| +};
|
| +
|
| +std::unique_ptr<protocol::Value> parseJSON(const StringView& json);
|
| +std::unique_ptr<protocol::Value> parseJSON(const String16& json);
|
|
|
| -namespace protocol = blink::protocol;
|
| +} // namespace protocol
|
|
|
| -std::unique_ptr<protocol::Value> toProtocolValue(v8::Local<v8::Context>, v8::Local<v8::Value>, int maxDepth = protocol::Value::maxDepth);
|
| +std::unique_ptr<protocol::Value> toProtocolValue(v8::Local<v8::Context>, v8::Local<v8::Value>, int maxDepth = 1000);
|
|
|
| v8::Local<v8::String> toV8String(v8::Isolate*, const String16&);
|
| v8::Local<v8::String> toV8StringInternalized(v8::Isolate*, const String16&);
|
| v8::Local<v8::String> toV8StringInternalized(v8::Isolate*, const char*);
|
| v8::Local<v8::String> toV8String(v8::Isolate*, const StringView&);
|
| -
|
| +// TODO(dgozman): rename to toString16.
|
| String16 toProtocolString(v8::Local<v8::String>);
|
| String16 toProtocolStringWithTypeCheck(v8::Local<v8::Value>);
|
| String16 toString16(const StringView&);
|
| StringView toStringView(const String16&);
|
| -
|
| bool stringViewStartsWith(const StringView&, const char*);
|
| -std::unique_ptr<protocol::Value> parseJSON(const StringView& json);
|
| -
|
| -String16 findSourceURL(const String16& content, bool multiline);
|
| -String16 findSourceMapURL(const String16& content, bool multiline);
|
| -std::vector<std::unique_ptr<protocol::Debugger::SearchMatch>> searchInTextByLinesImpl(V8InspectorSession*, const String16& text, const String16& query, bool caseSensitive, bool isRegex);
|
|
|
| class StringBufferImpl : public StringBuffer {
|
| - PROTOCOL_DISALLOW_COPY(StringBufferImpl);
|
| + V8_INSPECTOR_DISALLOW_COPY(StringBufferImpl);
|
| public:
|
| // Destroys string's content.
|
| static std::unique_ptr<StringBufferImpl> adopt(String16&);
|
| @@ -52,4 +64,4 @@ private:
|
| } // namespace v8_inspector
|
|
|
|
|
| -#endif // !defined(V8StringUtil_h)
|
| +#endif // !defined(StringUtil_h)
|
|
|