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

Unified Diff: third_party/WebKit/Source/platform/v8_inspector/V8StringUtil.h

Issue 2260233002: [DevTools] Migrate v8_inspector/public from String16 to String{View,Buffer}. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: small fixes 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/v8_inspector/V8StringUtil.h
diff --git a/third_party/WebKit/Source/platform/v8_inspector/V8StringUtil.h b/third_party/WebKit/Source/platform/v8_inspector/V8StringUtil.h
index 2245c8fed6a94124d44d04ffacad1ceaad1d1055..d0ffaefca37facb77702f8dc3f0f606e31055b76 100644
--- a/third_party/WebKit/Source/platform/v8_inspector/V8StringUtil.h
+++ b/third_party/WebKit/Source/platform/v8_inspector/V8StringUtil.h
@@ -7,6 +7,7 @@
#include "platform/inspector_protocol/InspectorProtocol.h"
#include "platform/v8_inspector/protocol/Debugger.h"
+#include "platform/v8_inspector/public/String.h"
#include <v8.h>
namespace v8_inspector {
@@ -20,14 +21,33 @@ std::unique_ptr<protocol::Value> toProtocolValue(v8::Local<v8::Context>, v8::Loc
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&);
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 {
esprehn 2016/08/23 17:35:39 this is very weird to have the String.h define an
dgozman 2016/08/24 00:45:01 Yep. StringBufferImpl wants to hide m_owner from p
+ PROTOCOL_DISALLOW_COPY(StringBufferImpl);
+public:
+ // Destroys string's content.
+ static std::unique_ptr<StringBufferImpl> adopt(String16&);
+ const StringView& string() override { return m_string; }
+
+private:
+ explicit StringBufferImpl(String16&);
+ String16 m_owner;
+ StringView m_string;
+};
+
} // namespace v8_inspector

Powered by Google App Engine
This is Rietveld 408576698