OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #if defined(ENABLE_PEPPER_CDMS) | 5 #if defined(ENABLE_PEPPER_CDMS) |
6 #include "content/renderer/media/cdm/pepper_cdm_wrapper_impl.h" | 6 #include "content/renderer/media/cdm/pepper_cdm_wrapper_impl.h" |
7 | 7 |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" | 10 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 const std::string& pluginType, | 31 const std::string& pluginType, |
32 const GURL& security_origin) { | 32 const GURL& security_origin) { |
33 DCHECK(frame); | 33 DCHECK(frame); |
34 | 34 |
35 // The frame security origin could be different from the origin where the CDM | 35 // The frame security origin could be different from the origin where the CDM |
36 // creation was initiated, e.g. due to navigation. | 36 // creation was initiated, e.g. due to navigation. |
37 // Note: The code will continue after navigation to the "same" origin, even | 37 // Note: The code will continue after navigation to the "same" origin, even |
38 // though the CDM is no longer necessary. | 38 // though the CDM is no longer necessary. |
39 // TODO: Consider avoiding this possibility entirely. http://crbug.com/575236 | 39 // TODO: Consider avoiding this possibility entirely. http://crbug.com/575236 |
40 GURL frame_security_origin( | 40 GURL frame_security_origin( |
41 blink::WebStringToGURL(frame->securityOrigin().toString())); | 41 blink::WebStringToGURL(frame->getSecurityOrigin().toString())); |
42 if (frame_security_origin != security_origin) { | 42 if (frame_security_origin != security_origin) { |
43 LOG(ERROR) << "Frame has a different origin than the EME call."; | 43 LOG(ERROR) << "Frame has a different origin than the EME call."; |
44 return scoped_ptr<PepperCdmWrapper>(); | 44 return scoped_ptr<PepperCdmWrapper>(); |
45 } | 45 } |
46 | 46 |
47 ScopedHelperPlugin helper_plugin(blink::WebHelperPlugin::create( | 47 ScopedHelperPlugin helper_plugin(blink::WebHelperPlugin::create( |
48 blink::WebString::fromUTF8(pluginType), frame)); | 48 blink::WebString::fromUTF8(pluginType), frame)); |
49 if (!helper_plugin) | 49 if (!helper_plugin) |
50 return scoped_ptr<PepperCdmWrapper>(); | 50 return scoped_ptr<PepperCdmWrapper>(); |
51 | 51 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 helper_plugin_.reset(); | 88 helper_plugin_.reset(); |
89 } | 89 } |
90 | 90 |
91 ContentDecryptorDelegate* PepperCdmWrapperImpl::GetCdmDelegate() { | 91 ContentDecryptorDelegate* PepperCdmWrapperImpl::GetCdmDelegate() { |
92 return plugin_instance_->GetContentDecryptorDelegate(); | 92 return plugin_instance_->GetContentDecryptorDelegate(); |
93 } | 93 } |
94 | 94 |
95 } // namespace content | 95 } // namespace content |
96 | 96 |
97 #endif // defined(ENABLE_PEPPER_CDMS) | 97 #endif // defined(ENABLE_PEPPER_CDMS) |
OLD | NEW |