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

Side by Side Diff: components/nacl/loader/nacl_listener.cc

Issue 656363002: Type conversion fixes, components/ edition. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "components/nacl/loader/nacl_listener.h" 5 #include "components/nacl/loader/nacl_listener.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <fcntl.h> 8 #include <fcntl.h>
9 #include <stdlib.h> 9 #include <stdlib.h>
10 #include <string.h> 10 #include <string.h>
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 &ipc_path))) { 201 &ipc_path))) {
202 return false; 202 return false;
203 } 203 }
204 if (ipc_fd == IPC::InvalidPlatformFileForTransit()) { 204 if (ipc_fd == IPC::InvalidPlatformFileForTransit()) {
205 return false; 205 return false;
206 } 206 }
207 base::PlatformFile handle = 207 base::PlatformFile handle =
208 IPC::PlatformFileForTransitToPlatformFile(ipc_fd); 208 IPC::PlatformFileForTransitToPlatformFile(ipc_fd);
209 #if defined(OS_WIN) 209 #if defined(OS_WIN)
210 // On Windows, valid handles are 32 bit unsigned integers so this is safe. 210 // On Windows, valid handles are 32 bit unsigned integers so this is safe.
211 *fd = reinterpret_cast<uintptr_t>(handle); 211 *fd = reinterpret_cast<int32>(handle);
212 #else 212 #else
213 *fd = handle; 213 *fd = handle;
214 #endif 214 #endif
215 // It doesn't matter if the path is invalid UTF8 as long as it's consistent 215 // It doesn't matter if the path is invalid UTF8 as long as it's consistent
216 // and unforgeable. 216 // and unforgeable.
217 *path = ipc_path.AsUTF8Unsafe(); 217 *path = ipc_path.AsUTF8Unsafe();
218 return true; 218 return true;
219 } 219 }
220 220
221 private: 221 private:
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 } 491 }
492 492
493 void NaClListener::OnFileTokenResolved( 493 void NaClListener::OnFileTokenResolved(
494 uint64_t token_lo, 494 uint64_t token_lo,
495 uint64_t token_hi, 495 uint64_t token_hi,
496 IPC::PlatformFileForTransit ipc_fd, 496 IPC::PlatformFileForTransit ipc_fd,
497 base::FilePath file_path) { 497 base::FilePath file_path) {
498 resolved_cb_.Run(ipc_fd, file_path); 498 resolved_cb_.Run(ipc_fd, file_path);
499 resolved_cb_.Reset(); 499 resolved_cb_.Reset();
500 } 500 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698