OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. | 2 * Copyright (c) 2012 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 "HTTP2Mount.h" | 6 #include "HTTP2Mount.h" |
7 #include "HTTP2Node.h" | 7 #include "HTTP2Node.h" |
8 #include "HTTP2FSOpenJob.h" | 8 #include "HTTP2FSOpenJob.h" |
9 #include "HTTP2OpenJob.h" | 9 #include "HTTP2OpenJob.h" |
10 #include "HTTP2ReadJob.h" | 10 #include "HTTP2ReadJob.h" |
11 #include "../util/DebugPrint.h" | 11 #include "../util/DebugPrint.h" |
12 #include "../util/SimpleAutoLock.h" | 12 #include "../util/PthreadHelpers.h" |
13 #include <set> | 13 #include <set> |
14 #include <assert.h> | 14 #include <assert.h> |
15 #include <errno.h> | 15 #include <errno.h> |
16 #include <stdio.h> | 16 #include <stdio.h> |
17 #include <string.h> | 17 #include <string.h> |
18 | 18 |
19 HTTP2Mount::HTTP2Mount(MainThreadRunner *runner, std::string base_url) : | 19 HTTP2Mount::HTTP2Mount(MainThreadRunner *runner, std::string base_url) : |
20 runner_(runner), base_url_(base_url), fs_(NULL), fs_expected_size_(0), | 20 runner_(runner), base_url_(base_url), fs_(NULL), fs_expected_size_(0), |
21 fs_base_path_(""), fs_opened_(false), progress_handler_(NULL) { | 21 fs_base_path_(""), fs_opened_(false), progress_handler_(NULL) { |
22 | 22 |
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 ReadManifest(path, -1); | 354 ReadManifest(path, -1); |
355 } | 355 } |
356 | 356 |
357 void HTTP2Mount::ReadManifest(const std::string& path, ssize_t size) { | 357 void HTTP2Mount::ReadManifest(const std::string& path, ssize_t size) { |
358 int slot = AddFile(path, size); | 358 int slot = AddFile(path, size); |
359 std::string s; | 359 std::string s; |
360 ReadAll(this, slot, &s); | 360 ReadAll(this, slot, &s); |
361 ParseManifest(s); | 361 ParseManifest(s); |
362 // TODO(eugenis): cleanup the cache by removing all unknown files. | 362 // TODO(eugenis): cleanup the cache by removing all unknown files. |
363 } | 363 } |
OLD | NEW |