OLD | NEW |
1 // Copyright 2010 The Chromium Authors. All rights reserved. | 1 // Copyright 2010 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 GLStringQuery_h | 5 #ifndef GLStringQuery_h |
6 #define GLStringQuery_h | 6 #define GLStringQuery_h |
7 | 7 |
8 #include "gpu/command_buffer/client/gles2_interface.h" | 8 #include "gpu/command_buffer/client/gles2_interface.h" |
9 #include "platform/wtf/text/WTFString.h" | 9 #include "platform/wtf/text/WTFString.h" |
10 | 10 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 if (!length) | 71 if (!length) |
72 return WTF::g_empty_string; | 72 return WTF::g_empty_string; |
73 LChar* log_ptr; | 73 LChar* log_ptr; |
74 RefPtr<WTF::StringImpl> name_impl = | 74 RefPtr<WTF::StringImpl> name_impl = |
75 WTF::StringImpl::CreateUninitialized(length, log_ptr); | 75 WTF::StringImpl::CreateUninitialized(length, log_ptr); |
76 GLsizei returned_length = 0; | 76 GLsizei returned_length = 0; |
77 Traits::LogFunction(gl_, id, length, &returned_length, log_ptr); | 77 Traits::LogFunction(gl_, id, length, &returned_length, log_ptr); |
78 // The returnedLength excludes the null terminator. If this check wasn't | 78 // The returnedLength excludes the null terminator. If this check wasn't |
79 // true, then we'd need to tell the returned String the real length. | 79 // true, then we'd need to tell the returned String the real length. |
80 DCHECK_EQ(returned_length + 1, length); | 80 DCHECK_EQ(returned_length + 1, length); |
81 return String(name_impl.Release()); | 81 return String(std::move(name_impl)); |
82 } | 82 } |
83 | 83 |
84 private: | 84 private: |
85 gpu::gles2::GLES2Interface* gl_; | 85 gpu::gles2::GLES2Interface* gl_; |
86 }; | 86 }; |
87 | 87 |
88 } // namespace blink | 88 } // namespace blink |
89 #endif // GLStringQuery_h | 89 #endif // GLStringQuery_h |
OLD | NEW |