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

Side by Side 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, 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8StringUtil_h 5 #ifndef V8StringUtil_h
6 #define V8StringUtil_h 6 #define V8StringUtil_h
7 7
8 #include "platform/inspector_protocol/InspectorProtocol.h" 8 #include "platform/inspector_protocol/InspectorProtocol.h"
9 #include "platform/v8_inspector/protocol/Debugger.h" 9 #include "platform/v8_inspector/protocol/Debugger.h"
10 #include "platform/v8_inspector/public/String.h"
10 #include <v8.h> 11 #include <v8.h>
11 12
12 namespace v8_inspector { 13 namespace v8_inspector {
13 14
14 class V8InspectorSession; 15 class V8InspectorSession;
15 16
16 namespace protocol = blink::protocol; 17 namespace protocol = blink::protocol;
17 18
18 std::unique_ptr<protocol::Value> toProtocolValue(v8::Local<v8::Context>, v8::Loc al<v8::Value>, int maxDepth = protocol::Value::maxDepth); 19 std::unique_ptr<protocol::Value> toProtocolValue(v8::Local<v8::Context>, v8::Loc al<v8::Value>, int maxDepth = protocol::Value::maxDepth);
19 20
20 v8::Local<v8::String> toV8String(v8::Isolate*, const String16&); 21 v8::Local<v8::String> toV8String(v8::Isolate*, const String16&);
21 v8::Local<v8::String> toV8StringInternalized(v8::Isolate*, const String16&); 22 v8::Local<v8::String> toV8StringInternalized(v8::Isolate*, const String16&);
22 v8::Local<v8::String> toV8StringInternalized(v8::Isolate*, const char*); 23 v8::Local<v8::String> toV8StringInternalized(v8::Isolate*, const char*);
24 v8::Local<v8::String> toV8String(v8::Isolate*, const StringView&);
23 25
24 String16 toProtocolString(v8::Local<v8::String>); 26 String16 toProtocolString(v8::Local<v8::String>);
25 String16 toProtocolStringWithTypeCheck(v8::Local<v8::Value>); 27 String16 toProtocolStringWithTypeCheck(v8::Local<v8::Value>);
28 String16 toString16(const StringView&);
29 StringView toStringView(const String16&);
30
31 bool stringViewStartsWith(const StringView&, const char*);
32 std::unique_ptr<protocol::Value> parseJSON(const StringView& json);
26 33
27 String16 findSourceURL(const String16& content, bool multiline); 34 String16 findSourceURL(const String16& content, bool multiline);
28 String16 findSourceMapURL(const String16& content, bool multiline); 35 String16 findSourceMapURL(const String16& content, bool multiline);
29 std::vector<std::unique_ptr<protocol::Debugger::SearchMatch>> searchInTextByLine sImpl(V8InspectorSession*, const String16& text, const String16& query, bool cas eSensitive, bool isRegex); 36 std::vector<std::unique_ptr<protocol::Debugger::SearchMatch>> searchInTextByLine sImpl(V8InspectorSession*, const String16& text, const String16& query, bool cas eSensitive, bool isRegex);
30 37
38 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
39 PROTOCOL_DISALLOW_COPY(StringBufferImpl);
40 public:
41 // Destroys string's content.
42 static std::unique_ptr<StringBufferImpl> adopt(String16&);
43 const StringView& string() override { return m_string; }
44
45 private:
46 explicit StringBufferImpl(String16&);
47 String16 m_owner;
48 StringView m_string;
49 };
50
31 } // namespace v8_inspector 51 } // namespace v8_inspector
32 52
33 53
34 #endif // !defined(V8StringUtil_h) 54 #endif // !defined(V8StringUtil_h)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698