summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/AwesomePlayer.cpp
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2011-02-24 14:42:48 -0800
committerAndreas Huber <andih@google.com>2011-02-24 14:42:48 -0800
commit7314fa17093d514199fedcb55ac41136a1b31cb3 (patch)
tree87378f5d573dd94da744bdecf42f011dad05abea /media/libstagefright/AwesomePlayer.cpp
parent9287abf2657bee9464965c37bdaa866d023c9d89 (diff)
downloadframeworks_av-7314fa17093d514199fedcb55ac41136a1b31cb3.zip
frameworks_av-7314fa17093d514199fedcb55ac41136a1b31cb3.tar.gz
frameworks_av-7314fa17093d514199fedcb55ac41136a1b31cb3.tar.bz2
Suppress the logging of URLs when in incognito mode.
Change-Id: Ib951b495eae15669e160ef54686eab0eeb9b366a related-to-bug: 3336575
Diffstat (limited to 'media/libstagefright/AwesomePlayer.cpp')
-rw-r--r--media/libstagefright/AwesomePlayer.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/media/libstagefright/AwesomePlayer.cpp b/media/libstagefright/AwesomePlayer.cpp
index 1b63ab2..45be459 100644
--- a/media/libstagefright/AwesomePlayer.cpp
+++ b/media/libstagefright/AwesomePlayer.cpp
@@ -245,6 +245,22 @@ status_t AwesomePlayer::setDataSource_l(
if (headers) {
mUriHeaders = *headers;
+
+ ssize_t index = mUriHeaders.indexOfKey(String8("x-hide-urls-from-log"));
+ if (index >= 0) {
+ // Browser is in "incognito" mode, suppress logging URLs.
+
+ // This isn't something that should be passed to the server.
+ mUriHeaders.removeItemsAt(index);
+
+ mFlags |= INCOGNITO;
+ }
+ }
+
+ if (!(mFlags & INCOGNITO)) {
+ LOGI("setDataSource_l('%s')", mUri.string());
+ } else {
+ LOGI("setDataSource_l(URL suppressed)");
}
// The actual work will be done during preparation in the call to
@@ -1525,7 +1541,8 @@ status_t AwesomePlayer::finishSetDataSource_l() {
if (!strncasecmp("http://", mUri.string(), 7)
|| !strncasecmp("https://", mUri.string(), 8)) {
- mConnectingDataSource = new NuHTTPDataSource;
+ mConnectingDataSource = new NuHTTPDataSource(
+ (mFlags & INCOGNITO) ? NuHTTPDataSource::kFlagIncognito : 0);
mLock.unlock();
status_t err = mConnectingDataSource->connect(mUri, &mUriHeaders);