| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 "chrome/browser/media/android/cdm/media_drm_storage_factory.h" | 5 #include "chrome/browser/media/android/cdm/media_drm_storage_factory.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 content::BrowserContext* browser_context = web_contents->GetBrowserContext(); | 32 content::BrowserContext* browser_context = web_contents->GetBrowserContext(); |
| 33 DCHECK(browser_context) << "BrowserContext not available."; | 33 DCHECK(browser_context) << "BrowserContext not available."; |
| 34 | 34 |
| 35 Profile* profile = Profile::FromBrowserContext(browser_context); | 35 Profile* profile = Profile::FromBrowserContext(browser_context); |
| 36 DCHECK(profile) << "Profile not available."; | 36 DCHECK(profile) << "Profile not available."; |
| 37 | 37 |
| 38 PrefService* pref_service = profile->GetPrefs(); | 38 PrefService* pref_service = profile->GetPrefs(); |
| 39 DCHECK(pref_service) << "PrefService not available."; | 39 DCHECK(pref_service) << "PrefService not available."; |
| 40 | 40 |
| 41 url::Origin origin = render_frame_host->GetLastCommittedOrigin(); | 41 url::Origin origin = render_frame_host->GetLastCommittedOrigin(); |
| 42 if (origin.unique()) { | 42 if (origin.opaque()) { |
| 43 DVLOG(1) << __func__ << ": Unique origin."; | 43 DVLOG(1) << __func__ << ": Opaque origin."; |
| 44 return; | 44 return; |
| 45 } | 45 } |
| 46 | 46 |
| 47 // The object will be deleted on connection error, or when the frame navigates | 47 // The object will be deleted on connection error, or when the frame navigates |
| 48 // away. | 48 // away. |
| 49 new cdm::MediaDrmStorageImpl(render_frame_host, pref_service, origin, | 49 new cdm::MediaDrmStorageImpl(render_frame_host, pref_service, origin, |
| 50 std::move(request)); | 50 std::move(request)); |
| 51 } | 51 } |
| 52 | 52 |
| 53 } // namespace chrome | 53 } // namespace chrome |
| OLD | NEW |