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

Unified Diff: ui/base/resource/resource_bundle_android.h

Issue 1181953002: Load non-locale .pak files directly from the .apk on Android (rather than extracting on start-up). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@raw-paks
Patch Set: Fix content_browsertests Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: ui/base/resource/resource_bundle_android.h
diff --git a/ui/base/resource/resource_bundle_android.h b/ui/base/resource/resource_bundle_android.h
index d1400f8972150135f8fa03af66692ca567b60d3c..213753e5684fbd6d2fbb841e51e2695e20de2839 100644
--- a/ui/base/resource/resource_bundle_android.h
+++ b/ui/base/resource/resource_bundle_android.h
@@ -5,10 +5,29 @@
#ifndef UI_BASE_RESOURCE_RESOURCE_BUNDLE_ANDROID_H_
#define UI_BASE_RESOURCE_RESOURCE_BUNDLE_ANDROID_H_
+#include <jni.h>
+#include <string>
+
#include "base/basictypes.h"
+#include "base/files/memory_mapped_file.h"
+#include "ui/base/ui_base_export.h"
namespace ui {
+// Loads "resources.apk" from the .apk. Falls back to loading from disk, which
+// is necessary for tests.
+UI_BASE_EXPORT void LoadMainAndroidPackFile(
+ const char* path_within_apk,
+ const base::FilePath& disk_file_path);
+
+// Returns the file descriptor and region for resources.pak.
+UI_BASE_EXPORT int GetMainAndroidPackFd(
+ base::MemoryMappedFile::Region* out_region);
+
+// Returns the file descriptor and region for chrome_100_percent.pak
+UI_BASE_EXPORT int GetCommonResourcesPackFd(
+ base::MemoryMappedFile::Region* out_region);
+
// Checks whether the locale data pak is contained within the .apk.
bool AssetContainedInApk(const std::string& filename);
@@ -17,4 +36,3 @@ bool RegisterResourceBundleAndroid(JNIEnv* env);
} // namespace ui
#endif // UI_BASE_RESOURCE_RESOURCE_BUNDLE_ANDROID_H_
-

Powered by Google App Engine
This is Rietveld 408576698