Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(180)

Side by Side Diff: third_party/WebKit/Source/modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.cpp

Issue 2821443002: Revert of Move ScriptState::GetExecutionContext (Part 5) (Closed)
Patch Set: Revert Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #include "modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.h" 5 #include "modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "bindings/core/v8/ScriptPromise.h" 9 #include "bindings/core/v8/ScriptPromise.h"
10 #include "bindings/core/v8/ScriptPromiseResolver.h" 10 #include "bindings/core/v8/ScriptPromiseResolver.h"
11 #include "bindings/core/v8/ScriptState.h" 11 #include "bindings/core/v8/ScriptState.h"
12 #include "bindings/core/v8/V8ThrowException.h" 12 #include "bindings/core/v8/V8ThrowException.h"
13 #include "core/dom/DOMException.h" 13 #include "core/dom/DOMException.h"
14 #include "core/dom/Document.h" 14 #include "core/dom/Document.h"
15 #include "core/dom/ExceptionCode.h" 15 #include "core/dom/ExceptionCode.h"
16 #include "core/dom/ExecutionContext.h"
17 #include "core/frame/Deprecation.h" 16 #include "core/frame/Deprecation.h"
18 #include "core/frame/Settings.h" 17 #include "core/frame/Settings.h"
19 #include "core/inspector/ConsoleMessage.h" 18 #include "core/inspector/ConsoleMessage.h"
20 #include "modules/encryptedmedia/EncryptedMediaUtils.h" 19 #include "modules/encryptedmedia/EncryptedMediaUtils.h"
21 #include "modules/encryptedmedia/MediaKeySession.h" 20 #include "modules/encryptedmedia/MediaKeySession.h"
22 #include "modules/encryptedmedia/MediaKeySystemAccess.h" 21 #include "modules/encryptedmedia/MediaKeySystemAccess.h"
23 #include "modules/encryptedmedia/MediaKeysController.h" 22 #include "modules/encryptedmedia/MediaKeysController.h"
24 #include "platform/EncryptedMediaRequest.h" 23 #include "platform/EncryptedMediaRequest.h"
25 #include "platform/Histogram.h" 24 #include "platform/Histogram.h"
26 #include "platform/network/ParsedContentType.h" 25 #include "platform/network/ParsedContentType.h"
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 259
261 } // namespace 260 } // namespace
262 261
263 ScriptPromise NavigatorRequestMediaKeySystemAccess::requestMediaKeySystemAccess( 262 ScriptPromise NavigatorRequestMediaKeySystemAccess::requestMediaKeySystemAccess(
264 ScriptState* script_state, 263 ScriptState* script_state,
265 Navigator& navigator, 264 Navigator& navigator,
266 const String& key_system, 265 const String& key_system,
267 const HeapVector<MediaKeySystemConfiguration>& supported_configurations) { 266 const HeapVector<MediaKeySystemConfiguration>& supported_configurations) {
268 DVLOG(3) << __func__; 267 DVLOG(3) << __func__;
269 268
270 ExecutionContext* execution_context = ExecutionContext::From(script_state); 269 ExecutionContext* execution_context = script_state->GetExecutionContext();
271 Document* document = ToDocument(execution_context); 270 Document* document = ToDocument(execution_context);
272 271
273 // From https://w3c.github.io/encrypted-media/#common-key-systems 272 // From https://w3c.github.io/encrypted-media/#common-key-systems
274 // All user agents MUST support the common key systems described in this 273 // All user agents MUST support the common key systems described in this
275 // section. 274 // section.
276 // 9.1 Clear Key: The "org.w3.clearkey" Key System uses plain-text clear 275 // 9.1 Clear Key: The "org.w3.clearkey" Key System uses plain-text clear
277 // (unencrypted) key(s) to decrypt the source. 276 // (unencrypted) key(s) to decrypt the source.
278 // 277 //
279 // Do not check settings for Clear Key. 278 // Do not check settings for Clear Key.
280 if (key_system != "org.w3.clearkey") { 279 if (key_system != "org.w3.clearkey") {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 WebEncryptedMediaClient* media_client = 332 WebEncryptedMediaClient* media_client =
334 controller->EncryptedMediaClient(execution_context); 333 controller->EncryptedMediaClient(execution_context);
335 media_client->RequestMediaKeySystemAccess( 334 media_client->RequestMediaKeySystemAccess(
336 WebEncryptedMediaRequest(initializer)); 335 WebEncryptedMediaRequest(initializer));
337 336
338 // 7. Return promise. 337 // 7. Return promise.
339 return promise; 338 return promise;
340 } 339 }
341 340
342 } // namespace blink 341 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.cpp ('k') | third_party/WebKit/Source/modules/fetch/Body.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698