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 | 16 |
17 #include <vector> | 17 #include <vector> |
18 | 18 |
19 #include <ppapi/c/pp_errors.h> | 19 #include <ppapi/c/pp_errors.h> |
20 | 20 |
21 #include "nacl_io/mount_node_dir.h" | 21 #include "nacl_io/mount_node_dir.h" |
22 #include "nacl_io/mount_node_http.h" | 22 #include "nacl_io/mount_node_http.h" |
23 #include "nacl_io/osinttypes.h" | 23 #include "nacl_io/osinttypes.h" |
24 #include "nacl_io/osunistd.h" | 24 #include "nacl_io/osunistd.h" |
25 | 25 |
| 26 namespace nacl_io { |
| 27 |
26 namespace { | 28 namespace { |
27 | 29 |
28 typedef std::vector<char*> StringList_t; | 30 typedef std::vector<char*> StringList_t; |
29 size_t SplitString(char* str, const char* delim, StringList_t* list) { | 31 size_t SplitString(char* str, const char* delim, StringList_t* list) { |
30 char* item = strtok(str, delim); | 32 char* item = strtok(str, delim); |
31 | 33 |
32 list->clear(); | 34 list->clear(); |
33 while (item) { | 35 while (item) { |
34 list->push_back(item); | 36 list->push_back(item); |
35 item = strtok(NULL, delim); | 37 item = strtok(NULL, delim); |
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 | 394 |
393 text[len] = 0; | 395 text[len] = 0; |
394 *out_manifest = text; | 396 *out_manifest = text; |
395 return 0; | 397 return 0; |
396 } | 398 } |
397 | 399 |
398 std::string MountHttp::MakeUrl(const Path& path) { | 400 std::string MountHttp::MakeUrl(const Path& path) { |
399 return url_root_ + | 401 return url_root_ + |
400 (path.IsAbsolute() ? path.Range(1, path.Size()) : path.Join()); | 402 (path.IsAbsolute() ? path.Range(1, path.Size()) : path.Join()); |
401 } | 403 } |
| 404 |
| 405 } // namespace nacl_io |
OLD | NEW |