OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Apple Inc. All rights reserved. | 2 * Copyright (C) 2013 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 17 matching lines...) Expand all Loading... |
28 #include <cmath> | 28 #include <cmath> |
29 #include <limits> | 29 #include <limits> |
30 #include "bindings/core/v8/DOMWrapperWorld.h" | 30 #include "bindings/core/v8/DOMWrapperWorld.h" |
31 #include "bindings/core/v8/ScriptPromise.h" | 31 #include "bindings/core/v8/ScriptPromise.h" |
32 #include "bindings/core/v8/ScriptPromiseResolver.h" | 32 #include "bindings/core/v8/ScriptPromiseResolver.h" |
33 #include "bindings/core/v8/ScriptState.h" | 33 #include "bindings/core/v8/ScriptState.h" |
34 #include "bindings/core/v8/V8ThrowException.h" | 34 #include "bindings/core/v8/V8ThrowException.h" |
35 #include "core/dom/DOMArrayBuffer.h" | 35 #include "core/dom/DOMArrayBuffer.h" |
36 #include "core/dom/DOMException.h" | 36 #include "core/dom/DOMException.h" |
37 #include "core/dom/ExceptionCode.h" | 37 #include "core/dom/ExceptionCode.h" |
38 #include "core/dom/ExecutionContext.h" | |
39 #include "core/dom/TaskRunnerHelper.h" | 38 #include "core/dom/TaskRunnerHelper.h" |
40 #include "core/events/Event.h" | 39 #include "core/events/Event.h" |
41 #include "core/events/GenericEventQueue.h" | 40 #include "core/events/GenericEventQueue.h" |
42 #include "modules/encryptedmedia/ContentDecryptionModuleResultPromise.h" | 41 #include "modules/encryptedmedia/ContentDecryptionModuleResultPromise.h" |
43 #include "modules/encryptedmedia/EncryptedMediaUtils.h" | 42 #include "modules/encryptedmedia/EncryptedMediaUtils.h" |
44 #include "modules/encryptedmedia/MediaKeyMessageEvent.h" | 43 #include "modules/encryptedmedia/MediaKeyMessageEvent.h" |
45 #include "modules/encryptedmedia/MediaKeys.h" | 44 #include "modules/encryptedmedia/MediaKeys.h" |
46 #include "platform/ContentDecryptionModuleResult.h" | 45 #include "platform/ContentDecryptionModuleResult.h" |
47 #include "platform/InstanceCounters.h" | 46 #include "platform/InstanceCounters.h" |
48 #include "platform/Timer.h" | 47 #include "platform/Timer.h" |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 MediaKeySession* MediaKeySession::Create( | 358 MediaKeySession* MediaKeySession::Create( |
360 ScriptState* script_state, | 359 ScriptState* script_state, |
361 MediaKeys* media_keys, | 360 MediaKeys* media_keys, |
362 WebEncryptedMediaSessionType session_type) { | 361 WebEncryptedMediaSessionType session_type) { |
363 return new MediaKeySession(script_state, media_keys, session_type); | 362 return new MediaKeySession(script_state, media_keys, session_type); |
364 } | 363 } |
365 | 364 |
366 MediaKeySession::MediaKeySession(ScriptState* script_state, | 365 MediaKeySession::MediaKeySession(ScriptState* script_state, |
367 MediaKeys* media_keys, | 366 MediaKeys* media_keys, |
368 WebEncryptedMediaSessionType session_type) | 367 WebEncryptedMediaSessionType session_type) |
369 : ContextLifecycleObserver(ExecutionContext::From(script_state)), | 368 : ContextLifecycleObserver(script_state->GetExecutionContext()), |
370 async_event_queue_(GenericEventQueue::Create(this)), | 369 async_event_queue_(GenericEventQueue::Create(this)), |
371 media_keys_(media_keys), | 370 media_keys_(media_keys), |
372 session_type_(session_type), | 371 session_type_(session_type), |
373 expiration_(std::numeric_limits<double>::quiet_NaN()), | 372 expiration_(std::numeric_limits<double>::quiet_NaN()), |
374 key_statuses_map_(new MediaKeyStatusMap()), | 373 key_statuses_map_(new MediaKeyStatusMap()), |
375 is_uninitialized_(true), | 374 is_uninitialized_(true), |
376 is_callable_(false), | 375 is_callable_(false), |
377 is_closed_(false), | 376 is_closed_(false), |
378 closed_promise_(new ClosedPromise(ExecutionContext::From(script_state), | 377 closed_promise_(new ClosedPromise(script_state->GetExecutionContext(), |
379 this, | 378 this, |
380 ClosedPromise::kClosed)), | 379 ClosedPromise::kClosed)), |
381 action_timer_( | 380 action_timer_( |
382 TaskRunnerHelper::Get(TaskType::kMiscPlatformAPI, script_state), | 381 TaskRunnerHelper::Get(TaskType::kMiscPlatformAPI, script_state), |
383 this, | 382 this, |
384 &MediaKeySession::ActionTimerFired) { | 383 &MediaKeySession::ActionTimerFired) { |
385 DVLOG(MEDIA_KEY_SESSION_LOG_LEVEL) << __func__ << "(" << this << ")"; | 384 DVLOG(MEDIA_KEY_SESSION_LOG_LEVEL) << __func__ << "(" << this << ")"; |
386 InstanceCounters::IncrementCounter(InstanceCounters::kMediaKeySessionCounter); | 385 InstanceCounters::IncrementCounter(InstanceCounters::kMediaKeySessionCounter); |
387 | 386 |
388 // Create the matching Chromium object. It will not be usable until | 387 // Create the matching Chromium object. It will not be usable until |
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1052 visitor->Trace(async_event_queue_); | 1051 visitor->Trace(async_event_queue_); |
1053 visitor->Trace(pending_actions_); | 1052 visitor->Trace(pending_actions_); |
1054 visitor->Trace(media_keys_); | 1053 visitor->Trace(media_keys_); |
1055 visitor->Trace(key_statuses_map_); | 1054 visitor->Trace(key_statuses_map_); |
1056 visitor->Trace(closed_promise_); | 1055 visitor->Trace(closed_promise_); |
1057 EventTargetWithInlineData::Trace(visitor); | 1056 EventTargetWithInlineData::Trace(visitor); |
1058 ContextLifecycleObserver::Trace(visitor); | 1057 ContextLifecycleObserver::Trace(visitor); |
1059 } | 1058 } |
1060 | 1059 |
1061 } // namespace blink | 1060 } // namespace blink |
OLD | NEW |