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

Unified Diff: android_webview/native/aw_media_url_interceptor.cc

Issue 2863233002: [WebView] Move files from native to browser (Closed)
Patch Set: Created 3 years, 7 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: android_webview/native/aw_media_url_interceptor.cc
diff --git a/android_webview/native/aw_media_url_interceptor.cc b/android_webview/native/aw_media_url_interceptor.cc
deleted file mode 100644
index 3ec6eeacf11101d5ba62e47bf3157de55081d11c..0000000000000000000000000000000000000000
--- a/android_webview/native/aw_media_url_interceptor.cc
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright 2014 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.
-
-#include <string>
-
-#include "android_webview/common/url_constants.h"
-#include "android_webview/native/aw_media_url_interceptor.h"
-#include "base/android/apk_assets.h"
-#include "base/strings/string_util.h"
-#include "content/public/common/url_constants.h"
-
-namespace android_webview {
-
-bool AwMediaUrlInterceptor::Intercept(const std::string& url,
- int* fd,
- int64_t* offset,
- int64_t* size) const {
- std::string asset_file_prefix(url::kFileScheme);
- asset_file_prefix.append(url::kStandardSchemeSeparator);
- asset_file_prefix.append(android_webview::kAndroidAssetPath);
-
- if (base::StartsWith(url, asset_file_prefix, base::CompareCase::SENSITIVE)) {
- std::string filename(url);
- base::ReplaceFirstSubstringAfterOffset(
- &filename, 0, asset_file_prefix, "assets/");
- base::MemoryMappedFile::Region region =
- base::MemoryMappedFile::Region::kWholeFile;
- *fd = base::android::OpenApkAsset(filename, &region);
- *offset = region.offset;
- *size = region.size;
- return *fd != -1;
- }
-
- return false;
-}
-
-} // namespace android_webview

Powered by Google App Engine
This is Rietveld 408576698