OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2011 The Native Client Authors. All rights reserved. | 2 * Copyright (c) 2011 The Native Client Authors. All rights reserved. |
3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
5 */ | 5 */ |
6 #include <assert.h> | 6 #include <assert.h> |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <stdio.h> | 8 #include <stdio.h> |
9 #include <vector> | 9 #include <vector> |
10 #include "../base/UrlLoaderJob.h" | 10 #include "../base/UrlLoaderJob.h" |
11 #include "../util/Path.h" | 11 #include "../util/Path.h" |
12 #include "../util/SimpleAutoLock.h" | 12 #include "../util/PthreadHelpers.h" |
13 #include "AppEngineMount.h" | 13 #include "AppEngineMount.h" |
14 #include "AppEngineNode.h" | 14 #include "AppEngineNode.h" |
15 | 15 |
16 AppEngineMount::AppEngineMount(MainThreadRunner *runner, | 16 AppEngineMount::AppEngineMount(MainThreadRunner *runner, |
17 const std::string& base_url) { | 17 const std::string& base_url) { |
18 if (pthread_mutex_init(&ae_lock_, NULL)) assert(0); | 18 if (pthread_mutex_init(&ae_lock_, NULL)) assert(0); |
19 runner_ = runner; | 19 runner_ = runner; |
20 base_url_ = base_url; | 20 base_url_ = base_url; |
21 slots_.Alloc(); | 21 slots_.Alloc(); |
22 int slot = CreateNode("/", NULL); | 22 int slot = CreateNode("/", NULL); |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 | 318 |
319 // Cache this result in the node. At this point, we consider the node | 319 // Cache this result in the node. At this point, we consider the node |
320 // to be a directory for the rest of run-time. | 320 // to be a directory for the rest of run-time. |
321 if (num_bytes > 0) { | 321 if (num_bytes > 0) { |
322 node->set_is_dir(true); | 322 node->set_is_dir(true); |
323 return true; | 323 return true; |
324 } | 324 } |
325 // Assume its not for now, but don't stick to that. | 325 // Assume its not for now, but don't stick to that. |
326 return false; | 326 return false; |
327 } | 327 } |
OLD | NEW |