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

Side by Side Diff: sandbox/win/src/crosscall_server.cc

Issue 109843003: Replace wstring with string16 in sandbox (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « sandbox/win/src/crosscall_server.h ('k') | sandbox/win/src/file_policy_test.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 Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <string> 5 #include <string>
6 #include <vector> 6 #include <vector>
7 7
8 #include "sandbox/win/src/crosscall_server.h" 8 #include "sandbox/win/src/crosscall_server.h"
9 #include "sandbox/win/src/crosscall_params.h" 9 #include "sandbox/win/src/crosscall_params.h"
10 #include "sandbox/win/src/crosscall_client.h" 10 #include "sandbox/win/src/crosscall_client.h"
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 void* start = GetRawParameter(index, &size, &type); 230 void* start = GetRawParameter(index, &size, &type);
231 if ((NULL == start) || (sizeof(void*) != size) || (VOIDPTR_TYPE != type)) { 231 if ((NULL == start) || (sizeof(void*) != size) || (VOIDPTR_TYPE != type)) {
232 return false; 232 return false;
233 } 233 }
234 *param = *(reinterpret_cast<void**>(start)); 234 *param = *(reinterpret_cast<void**>(start));
235 return true; 235 return true;
236 } 236 }
237 237
238 // Covers the common case of reading a string. Note that the string is not 238 // Covers the common case of reading a string. Note that the string is not
239 // scanned for invalid characters. 239 // scanned for invalid characters.
240 bool CrossCallParamsEx::GetParameterStr(uint32 index, std::wstring* string) { 240 bool CrossCallParamsEx::GetParameterStr(uint32 index, base::string16* string) {
241 uint32 size = 0; 241 uint32 size = 0;
242 ArgType type; 242 ArgType type;
243 void* start = GetRawParameter(index, &size, &type); 243 void* start = GetRawParameter(index, &size, &type);
244 if (WCHAR_TYPE != type) { 244 if (WCHAR_TYPE != type) {
245 return false; 245 return false;
246 } 246 }
247 247
248 // Check if this is an empty string. 248 // Check if this is an empty string.
249 if (size == 0) { 249 if (size == 0) {
250 *string = L""; 250 *string = L"";
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 for (; it != ipc_calls_.end(); ++it) { 292 for (; it != ipc_calls_.end(); ++it) {
293 if (it->params.Matches(ipc)) { 293 if (it->params.Matches(ipc)) {
294 *callback = it->callback; 294 *callback = it->callback;
295 return this; 295 return this;
296 } 296 }
297 } 297 }
298 return NULL; 298 return NULL;
299 } 299 }
300 300
301 } // namespace sandbox 301 } // namespace sandbox
OLDNEW
« no previous file with comments | « sandbox/win/src/crosscall_server.h ('k') | sandbox/win/src/file_policy_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698