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

Unified Diff: shell/android/url_response_disk_cache_delegate_impl.h

Issue 1364243002: Bundle core applicatons in the shell. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 3 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: shell/android/url_response_disk_cache_delegate_impl.h
diff --git a/shell/android/url_response_disk_cache_delegate_impl.h b/shell/android/url_response_disk_cache_delegate_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..c1f12abbf12eb1a0b65a4b728c51501a85824e8d
--- /dev/null
+++ b/shell/android/url_response_disk_cache_delegate_impl.h
@@ -0,0 +1,46 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SHELL_ANDROID_URL_RESPONSE_DISK_CACHE_DELEGATE_IMPL_H_
+#define SHELL_ANDROID_URL_RESPONSE_DISK_CACHE_DELEGATE_IMPL_H_
+
+#include <map>
+
+#include "base/android/scoped_java_ref.h"
+#include "services/url_response_disk_cache/url_response_disk_cache_delegate.h"
+#include "shell/context.h"
+
+struct AAssetManager;
+
+namespace shell {
+
+class URLResponseDiskCacheDelegateImpl
+ : public mojo::URLResponseDiskCacheDelegate {
+ public:
+ URLResponseDiskCacheDelegateImpl(Context* contest, jobject j_asset_manager);
+ ~URLResponseDiskCacheDelegateImpl() override;
+
+ private:
+ // mojo:URLResponseDiskCacheDelegate implementation:
+ void GetInitialPath(scoped_refptr<base::TaskRunner> task_runner,
+ const std::string& url,
+ const base::FilePath& target,
+ const base::Callback<void(bool)>& callback) override;
+
+ bool ExtractAsset(const std::string& asset_name,
+ const base::FilePath& target);
+
+ void PopulateAssetsIfNeeded();
+
+ Context* context_;
+ base::android::ScopedJavaGlobalRef<jobject> j_asset_manager_;
+ std::map<std::string, std::string> url_to_asset_name_;
+ AAssetManager* asset_manager_;
+
+ DISALLOW_COPY_AND_ASSIGN(URLResponseDiskCacheDelegateImpl);
+};
+
+} // namespace shell
+
+#endif // SHELL_ANDROID_URL_RESPONSE_DISK_CACHE_DELEGATE_IMPL_H_

Powered by Google App Engine
This is Rietveld 408576698