diff options
Diffstat (limited to 'media/libstagefright/AwesomePlayer.cpp')
-rw-r--r-- | media/libstagefright/AwesomePlayer.cpp | 19 |
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); |