OLD | NEW |
---|---|
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 Loading... | |
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 |
OLD | NEW |