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

Side by Side Diff: third_party/WebKit/Source/core/inspector/V8InspectorString.cpp

Issue 2251343003: [DevTools] Generate separate copies of inspector_protocol. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: win compile 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 #include "core/inspector/V8InspectorString.h" 5 #include "core/inspector/V8InspectorString.h"
6 6
7 #include "core/inspector/protocol/Protocol.h"
8
7 namespace blink { 9 namespace blink {
8 10
9 v8_inspector::StringView toV8InspectorStringView(const StringView& string) 11 v8_inspector::StringView toV8InspectorStringView(const StringView& string)
10 { 12 {
11 if (string.isNull()) 13 if (string.isNull())
12 return v8_inspector::StringView(); 14 return v8_inspector::StringView();
13 if (string.is8Bit()) 15 if (string.is8Bit())
14 return v8_inspector::StringView(reinterpret_cast<const uint8_t*>(string. characters8()), string.length()); 16 return v8_inspector::StringView(reinterpret_cast<const uint8_t*>(string. characters8()), string.length());
15 return v8_inspector::StringView(reinterpret_cast<const uint16_t*>(string.cha racters16()), string.length()); 17 return v8_inspector::StringView(reinterpret_cast<const uint16_t*>(string.cha racters16()), string.length());
16 } 18 }
(...skipping 10 matching lines...) Expand all
27 return String(reinterpret_cast<const UChar*>(string.characters16()), string. length()); 29 return String(reinterpret_cast<const UChar*>(string.characters16()), string. length());
28 } 30 }
29 31
30 String toCoreString(std::unique_ptr<v8_inspector::StringBuffer> buffer) 32 String toCoreString(std::unique_ptr<v8_inspector::StringBuffer> buffer)
31 { 33 {
32 if (!buffer) 34 if (!buffer)
33 return String(); 35 return String();
34 return toCoreString(buffer->string()); 36 return toCoreString(buffer->string());
35 } 37 }
36 38
39 namespace protocol {
40
41 std::unique_ptr<protocol::Value> parseJSON(const String& string)
42 {
43 if (string.isNull())
44 return nullptr;
45 if (string.is8Bit())
46 return parseJSON(reinterpret_cast<const uint8_t*>(string.characters8()), string.length());
47 return parseJSON(reinterpret_cast<const uint16_t*>(string.characters16()), s tring.length());
48 }
49
50 } // namespace protocol
51
37 } // namespace blink 52 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698