Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(247)

Side by Side Diff: android_webview/native/public/aw_assets.h

Issue 937863003: Add AwAssets into android_webview/native/public (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Just move aw_assets to public totally Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 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 #ifndef ANDROID_WEBVIEW_NATIVE_AW_ASSETS_H_ 5 #ifndef ANDROID_WEBVIEW_NATIVE_PUBLIC_AW_ASSETS_H_
6 #define ANDROID_WEBVIEW_NATIVE_AW_ASSETS_H_ 6 #define ANDROID_WEBVIEW_NATIVE_PUBLIC_AW_ASSETS_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/android/jni_android.h" 10 #include "base/android/jni_android.h"
11 #include "base/posix/global_descriptors.h" 11 #include "base/posix/global_descriptors.h"
12 12
13 namespace android_webview { 13 namespace android_webview {
14 namespace AwAssets { 14 namespace AwAssets {
15 15
16 // Called by native to retrieve an asset (e.g. a .pak file) from the apk. 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. 17 // Returns: true in case of success, false otherwise.
18 // Output arguments: 18 // Output arguments:
19 // - |fd|: file descriptor to the apk. The caller takes the ownership. 19 // - |fd|: file descriptor to the apk. The caller takes the ownership.
20 // - |offset|: offset in bytes from the start of the file 20 // - |offset|: offset in bytes from the start of the file
21 // - |size|: size in bytes of the asset / resource. 21 // - |size|: size in bytes of the asset / resource.
22 bool OpenAsset(const std::string& filename, 22 bool OpenAsset(const std::string& filename,
23 int* fd, 23 int* fd,
24 int64* offset, 24 int64* offset,
25 int64* size); 25 int64* size);
26 26
27 bool RegisterAssetWithGlobalDescriptors(base::GlobalDescriptors::Key key, 27 bool RegisterAssetWithGlobalDescriptors(base::GlobalDescriptors::Key key,
28 const std::string& asset_filename); 28 const std::string& asset_filename);
29 29
30 } // namespace AwAssets 30 } // namespace AwAssets
31 31
32 bool RegisterAwAssets(JNIEnv* env); 32 bool RegisterAwAssets(JNIEnv* env);
33 33
34 } // namsespace android_webview 34 } // namsespace android_webview
35 35
36 #endif // ANDROID_WEBVIEW_NATIVE_AW_ASSETS_H_ 36 #endif // ANDROID_WEBVIEW_NATIVE_PUBLIC_AW_ASSETS_H_
OLDNEW
« no previous file with comments | « android_webview/native/aw_media_url_interceptor.cc ('k') | android_webview/native/public/aw_assets.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698