Supervised user whitelists: Cleanup
[chromium-blink-merge.git] / android_webview / native / public / aw_assets.h
blob9eacabf033272f5421c2e37f127a5d1ac076006e
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef ANDROID_WEBVIEW_NATIVE_PUBLIC_AW_ASSETS_H_
6 #define ANDROID_WEBVIEW_NATIVE_PUBLIC_AW_ASSETS_H_
8 #include <string>
10 #include "base/android/jni_android.h"
11 #include "base/posix/global_descriptors.h"
13 namespace android_webview {
14 namespace AwAssets {
16 // Called by native to retrieve an asset (e.g. a .pak file) from the apk.
17 // Returns: true in case of success, false otherwise.
18 // Output arguments:
19 // - |fd|: file descriptor to the apk. The caller takes the ownership.
20 // - |offset|: offset in bytes from the start of the file
21 // - |size|: size in bytes of the asset / resource.
22 bool OpenAsset(const std::string& filename,
23 int* fd,
24 int64* offset,
25 int64* size);
27 bool RegisterAssetWithGlobalDescriptors(base::GlobalDescriptors::Key key,
28 const std::string& asset_filename);
30 } // namespace AwAssets
32 bool RegisterAwAssets(JNIEnv* env);
34 } // namsespace android_webview
36 #endif // ANDROID_WEBVIEW_NATIVE_PUBLIC_AW_ASSETS_H_