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

Side by Side Diff: third_party/WebKit/Source/platform/v8_inspector/public/V8ToProtocolValue.cpp

Issue 1767883002: DevTools: generate string16-based handlers for v8_inspector. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 "platform/v8_inspector/public/V8ToProtocolValue.h" 5 #include "platform/v8_inspector/public/V8ToProtocolValue.h"
6 6
7 namespace blink { 7 namespace blink {
8 8
9 static String coreString(v8::Local<v8::String> v8String) 9 static String16 coreString(v8::Local<v8::String> v8String)
dgozman 2016/03/08 01:35:12 rename method
10 { 10 {
11 int length = v8String->Length(); 11 int length = v8String->Length();
12 UChar* buffer; 12 UChar* buffer;
13 String result = String::createUninitialized(length, buffer); 13 String16 result = String16::createUninitialized(length, buffer);
14 v8String->Write(reinterpret_cast<uint16_t*>(buffer), 0, length); 14 v8String->Write(reinterpret_cast<uint16_t*>(buffer), 0, length);
15 return result; 15 return result;
16 } 16 }
17 17
18 PassOwnPtr<protocol::Value> toProtocolValue(v8::Local<v8::Context> context, v8:: Local<v8::Value> value, int maxDepth) 18 PassOwnPtr<protocol::Value> toProtocolValue(v8::Local<v8::Context> context, v8:: Local<v8::Value> value, int maxDepth)
19 { 19 {
20 if (value.IsEmpty()) { 20 if (value.IsEmpty()) {
21 ASSERT_NOT_REACHED(); 21 ASSERT_NOT_REACHED();
22 return nullptr; 22 return nullptr;
23 } 23 }
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 return nullptr; 77 return nullptr;
78 jsonObject->setValue(coreString(propertyName), propertyValue.release ()); 78 jsonObject->setValue(coreString(propertyName), propertyValue.release ());
79 } 79 }
80 return jsonObject.release(); 80 return jsonObject.release();
81 } 81 }
82 ASSERT_NOT_REACHED(); 82 ASSERT_NOT_REACHED();
83 return nullptr; 83 return nullptr;
84 } 84 }
85 85
86 } // namespace blink 86 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698