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

Side by Side Diff: src/trusted/service_runtime/load_file.c

Issue 12226119: Factor out duplicated GioMemoryFileSnapshotCtor() + NaClAppLoadFile() calls (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: Created 7 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « src/trusted/service_runtime/load_file.h ('k') | src/trusted/service_runtime/mmap_test.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright (c) 2013 The Native Client Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file.
5 */
6
7 #include "native_client/src/trusted/service_runtime/load_file.h"
8
9 #include "native_client/src/shared/gio/gio.h"
10 #include "native_client/src/trusted/service_runtime/nacl_valgrind_hooks.h"
11 #include "native_client/src/trusted/service_runtime/sel_ldr.h"
12
13
14 NaClErrorCode NaClAppLoadFileFromFilename(struct NaClApp *nap,
15 const char *filename) {
16 struct GioMemoryFileSnapshot gio_file;
17 struct Gio *gio;
18 NaClErrorCode err;
19
20 NaClFileNameForValgrind(filename);
21
22 if (!GioMemoryFileSnapshotCtor(&gio_file, filename)) {
23 return LOAD_OPEN_ERROR;
24 }
25 gio = &gio_file.base.base;
26 err = NaClAppLoadFile(gio, nap);
27 if (err != LOAD_OK) {
28 return err;
29 }
30 if (gio->vtbl->Close(gio) != 0) {
31 err = LOAD_INTERNAL;
32 }
33 gio->vtbl->Dtor(gio);
34 return err;
35 }
OLDNEW
« no previous file with comments | « src/trusted/service_runtime/load_file.h ('k') | src/trusted/service_runtime/mmap_test.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698