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

Side by Side Diff: runtime/bin/utils_win.h

Issue 1781883002: Fixes some memory leaks in //runtime/bin (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Fix tests on Windows 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
« no previous file with comments | « runtime/bin/socket_win.cc ('k') | runtime/bin/utils_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef BIN_UTILS_WIN_H_ 5 #ifndef BIN_UTILS_WIN_H_
6 #define BIN_UTILS_WIN_H_ 6 #define BIN_UTILS_WIN_H_
7 7
8 #include "platform/globals.h" 8 #include "platform/globals.h"
9 9
10 namespace dart { 10 namespace dart {
11 namespace bin { 11 namespace bin {
12 12
13 void FormatMessageIntoBuffer(DWORD code, wchar_t* buffer, int buffer_length); 13 void FormatMessageIntoBuffer(DWORD code, wchar_t* buffer, int buffer_length);
14 14
15 // These string utility functions return strings that have been allocated with
16 // Dart_ScopeAllocate(). They should be used only when we are inside an API
17 // scope. If a string returned by one of these functions must persist beyond
18 // the scope, then copy the results into a suitable buffer that you have
19 // allocated.
15 class StringUtilsWin { 20 class StringUtilsWin {
16 public: 21 public:
17 static char* WideToUtf8(wchar_t* wide, 22 static char* WideToUtf8(wchar_t* wide,
18 intptr_t len = -1, 23 intptr_t len = -1,
19 intptr_t* result_len = NULL); 24 intptr_t* result_len = NULL);
20 static const char* WideToUtf8(const wchar_t* wide, 25 static const char* WideToUtf8(const wchar_t* wide,
21 intptr_t len = -1, 26 intptr_t len = -1,
22 intptr_t* result_len = NULL); 27 intptr_t* result_len = NULL);
23 static wchar_t* Utf8ToWide(char* utf8, 28 static wchar_t* Utf8ToWide(char* utf8,
24 intptr_t len = -1, 29 intptr_t len = -1,
25 intptr_t* result_len = NULL); 30 intptr_t* result_len = NULL);
26 static const wchar_t* Utf8ToWide(const char* utf8, 31 static const wchar_t* Utf8ToWide(const char* utf8,
27 intptr_t len = -1, 32 intptr_t len = -1,
28 intptr_t* result_len = NULL); 33 intptr_t* result_len = NULL);
29 }; 34 };
30 35
31 } // namespace bin 36 } // namespace bin
32 } // namespace dart 37 } // namespace dart
33 38
34 #endif // BIN_UTILS_WIN_H_ 39 #endif // BIN_UTILS_WIN_H_
OLDNEW
« no previous file with comments | « runtime/bin/socket_win.cc ('k') | runtime/bin/utils_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698