OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include <jni.h> | 5 #include <jni.h> |
6 | 6 |
7 #include "base/android/apk_assets.h" | 7 #include "base/android/apk_assets.h" |
8 | 8 |
| 9 #include "base/android/context_utils.h" |
9 #include "base/android/jni_array.h" | 10 #include "base/android/jni_array.h" |
10 #include "base/android/jni_string.h" | 11 #include "base/android/jni_string.h" |
11 #include "base/android/scoped_java_ref.h" | 12 #include "base/android/scoped_java_ref.h" |
12 #include "jni/ApkAssets_jni.h" | 13 #include "jni/ApkAssets_jni.h" |
13 | 14 |
14 namespace base { | 15 namespace base { |
15 namespace android { | 16 namespace android { |
16 | 17 |
17 bool RegisterApkAssets(JNIEnv* env) { | 18 bool RegisterApkAssets(JNIEnv* env) { |
18 return RegisterNativesImpl(env); | 19 return RegisterNativesImpl(env); |
(...skipping 23 matching lines...) Expand all Loading... |
42 base::MemoryMappedFile::Region::kWholeFile; | 43 base::MemoryMappedFile::Region::kWholeFile; |
43 int asset_fd = OpenApkAsset(file_path, ®ion); | 44 int asset_fd = OpenApkAsset(file_path, ®ion); |
44 if (asset_fd != -1) { | 45 if (asset_fd != -1) { |
45 base::GlobalDescriptors::GetInstance()->Set(key, asset_fd, region); | 46 base::GlobalDescriptors::GetInstance()->Set(key, asset_fd, region); |
46 } | 47 } |
47 return asset_fd != -1; | 48 return asset_fd != -1; |
48 } | 49 } |
49 | 50 |
50 } // namespace android | 51 } // namespace android |
51 } // namespace base | 52 } // namespace base |
OLD | NEW |