Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/renderer/media/android/webmediaplayer_android.h" | 5 #include "content/renderer/media/android/webmediaplayer_android.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <limits> | 9 #include <limits> |
| 10 | 10 |
| (...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 746 } | 746 } |
| 747 | 747 |
| 748 bool WebMediaPlayerAndroid::hasSingleSecurityOrigin() const { | 748 bool WebMediaPlayerAndroid::hasSingleSecurityOrigin() const { |
| 749 DCHECK(main_thread_checker_.CalledOnValidThread()); | 749 DCHECK(main_thread_checker_.CalledOnValidThread()); |
| 750 if (player_type_ != MEDIA_PLAYER_TYPE_URL) | 750 if (player_type_ != MEDIA_PLAYER_TYPE_URL) |
| 751 return true; | 751 return true; |
| 752 | 752 |
| 753 if (!info_loader_ || !info_loader_->HasSingleOrigin()) | 753 if (!info_loader_ || !info_loader_->HasSingleOrigin()) |
| 754 return false; | 754 return false; |
| 755 | 755 |
| 756 // TODO(qinmin): After fixing crbug.com/592017, remove this command line. | |
| 757 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | |
| 758 if (command_line->HasSwitch(switches::kReduceSecurityForTesting)) | |
| 759 return true; | |
|
dshwang
2016/03/04 16:30:51
skip single security origin check to work around n
| |
| 760 | |
| 756 // TODO(qinmin): The url might be redirected when android media player | 761 // TODO(qinmin): The url might be redirected when android media player |
| 757 // requests the stream. As a result, we cannot guarantee there is only | 762 // requests the stream. As a result, we cannot guarantee there is only |
| 758 // a single origin. Only if the HTTP request was made without credentials, | 763 // a single origin. Only if the HTTP request was made without credentials, |
| 759 // we will honor the return value from HasSingleSecurityOriginInternal() | 764 // we will honor the return value from HasSingleSecurityOriginInternal() |
| 760 // in pre-L android versions. | 765 // in pre-L android versions. |
| 761 // Check http://crbug.com/334204. | 766 // Check http://crbug.com/334204. |
| 762 if (!allow_stored_credentials_) | 767 if (!allow_stored_credentials_) |
| 763 return true; | 768 return true; |
| 764 | 769 |
| 765 return base::android::BuildInfo::GetInstance()->sdk_int() >= | 770 return base::android::BuildInfo::GetInstance()->sdk_int() >= |
| (...skipping 898 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1664 result = PREDICTION_RESULT_PATH_BASED_WAS_BETTER; | 1669 result = PREDICTION_RESULT_PATH_BASED_WAS_BETTER; |
| 1665 } else if (is_hls_url == is_hls) { | 1670 } else if (is_hls_url == is_hls) { |
| 1666 result = PREDICTION_RESULT_URL_BASED_WAS_BETTER; | 1671 result = PREDICTION_RESULT_URL_BASED_WAS_BETTER; |
| 1667 } | 1672 } |
| 1668 UMA_HISTOGRAM_ENUMERATION( | 1673 UMA_HISTOGRAM_ENUMERATION( |
| 1669 "Media.Android.IsHttpLiveStreamingMediaPredictionResult", | 1674 "Media.Android.IsHttpLiveStreamingMediaPredictionResult", |
| 1670 result, PREDICTION_RESULT_MAX); | 1675 result, PREDICTION_RESULT_MAX); |
| 1671 } | 1676 } |
| 1672 | 1677 |
| 1673 } // namespace content | 1678 } // namespace content |
| OLD | NEW |