OLD | NEW |
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 | 5 |
6 #include "nacl_io/mount_http.h" | 6 #include "nacl_io/mount_http.h" |
7 | 7 |
8 #include <assert.h> | 8 #include <assert.h> |
9 #include <ctype.h> | 9 #include <ctype.h> |
10 #include <errno.h> | 10 #include <errno.h> |
11 #include <fcntl.h> | 11 #include <fcntl.h> |
12 #include <stdio.h> | 12 #include <stdio.h> |
13 #include <string.h> | 13 #include <string.h> |
14 #include <sys/stat.h> | 14 #include <sys/stat.h> |
15 #include <sys/types.h> | 15 #include <sys/types.h> |
16 #include <unistd.h> | |
17 | 16 |
18 #include <vector> | 17 #include <vector> |
19 | 18 |
20 #include <ppapi/c/pp_errors.h> | 19 #include <ppapi/c/pp_errors.h> |
21 | 20 |
22 #include "nacl_io/mount_node_dir.h" | 21 #include "nacl_io/mount_node_dir.h" |
23 #include "nacl_io/mount_node_http.h" | 22 #include "nacl_io/mount_node_http.h" |
24 #include "nacl_io/osinttypes.h" | 23 #include "nacl_io/osinttypes.h" |
| 24 #include "nacl_io/osunistd.h" |
25 #include "sdk_util/auto_lock.h" | 25 #include "sdk_util/auto_lock.h" |
26 | 26 |
27 namespace { | 27 namespace { |
28 | 28 |
29 typedef std::vector<char*> StringList_t; | 29 typedef std::vector<char*> StringList_t; |
30 size_t SplitString(char* str, const char* delim, StringList_t* list) { | 30 size_t SplitString(char* str, const char* delim, StringList_t* list) { |
31 char* item = strtok(str, delim); | 31 char* item = strtok(str, delim); |
32 | 32 |
33 list->clear(); | 33 list->clear(); |
34 while (item) { | 34 while (item) { |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 text[len] = 0; | 423 text[len] = 0; |
424 | 424 |
425 *out_manifest = text; | 425 *out_manifest = text; |
426 return 0; | 426 return 0; |
427 } | 427 } |
428 | 428 |
429 std::string MountHttp::MakeUrl(const Path& path) { | 429 std::string MountHttp::MakeUrl(const Path& path) { |
430 return url_root_ + | 430 return url_root_ + |
431 (path.IsAbsolute() ? path.Range(1, path.Size()) : path.Join()); | 431 (path.IsAbsolute() ? path.Range(1, path.Size()) : path.Join()); |
432 } | 432 } |
OLD | NEW |