OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 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. | |
4 | |
5 #include <string> | |
6 | |
7 #include "android_webview/native/aw_assets.h" | |
8 #include "android_webview/native/aw_media_url_interceptor.h" | |
9 #include "base/strings/string_util.h" | |
10 | |
11 namespace android_webview { | |
12 | |
13 bool AwMediaUrlInterceptor::Intercept(const std::string& url, | |
mnaganov (inactive)
2014/07/25 08:28:54
'namespace' doesn't increase indentation. This cod
Ignacio Solla
2014/07/25 11:05:48
Done.
| |
14 int* fd, int64* offset, int64* size) const{ | |
15 const std::string asset_file_prefix("file:///android_asset/"); | |
mnaganov (inactive)
2014/07/25 08:28:54
Please use android_webview/common/url_constants.h
Ignacio Solla
2014/07/25 11:05:48
Done.
| |
16 | |
17 if (StartsWithASCII(url, asset_file_prefix, true)) { | |
18 std::string filename(url); | |
19 ReplaceFirstSubstringAfterOffset(&filename, 0, asset_file_prefix, ""); | |
20 return AwAssets::OpenAsset(filename, fd, offset, size); | |
21 } | |
22 | |
23 return false; | |
24 } | |
25 | |
26 } // namespace android_webview | |
27 | |
OLD | NEW |