Chromium Code Reviews| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 57 // is open. | 57 // is open. |
| 58 // | 58 // |
| 59 // WeakPtr<MediaKeys> is used instead of having MediaKeys and MediaKeySession | 59 // WeakPtr<MediaKeys> is used instead of having MediaKeys and MediaKeySession |
| 60 // keep references to each other, and then having to inform the other object | 60 // keep references to each other, and then having to inform the other object |
| 61 // when it gets destroyed. | 61 // when it gets destroyed. |
| 62 // | 62 // |
| 63 // Because this object controls the lifetime of the WebContentDecryptionModuleSe ssion, | 63 // Because this object controls the lifetime of the WebContentDecryptionModuleSe ssion, |
| 64 // it may outlive any JavaScript references as long as the MediaKeys object is a live. | 64 // it may outlive any JavaScript references as long as the MediaKeys object is a live. |
| 65 // The WebContentDecryptionModuleSession has the same lifetime as this object. | 65 // The WebContentDecryptionModuleSession has the same lifetime as this object. |
| 66 class MediaKeySession FINAL | 66 class MediaKeySession FINAL |
| 67 : public RefCountedGarbageCollected<MediaKeySession>, public ActiveDOMObject , public ScriptWrappable, public EventTargetWithInlineData | 67 : public GarbageCollectedFinalized<MediaKeySession>, public ActiveDOMObject, public ScriptWrappable, public EventTargetWithInlineData |
|
tkent
2014/06/12 02:21:57
This still need to be RefCountedGarbageCollected w
haraken
2014/06/12 02:26:27
Good point, and we also need to introduce adoptRef
| |
| 68 , private blink::WebContentDecryptionModuleSession::Client { | 68 , private blink::WebContentDecryptionModuleSession::Client { |
| 69 DEFINE_EVENT_TARGET_REFCOUNTING(RefCountedGarbageCollected<MediaKeySession>) ; | |
| 70 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(MediaKeySession); | 69 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(MediaKeySession); |
| 71 public: | 70 public: |
| 72 static MediaKeySession* create(ExecutionContext*, blink::WebContentDecryptio nModule*, MediaKeys*); | 71 static MediaKeySession* create(ExecutionContext*, blink::WebContentDecryptio nModule*, MediaKeys*); |
| 73 virtual ~MediaKeySession(); | 72 virtual ~MediaKeySession(); |
| 74 | 73 |
| 75 const String& keySystem() const { return m_keySystem; } | 74 const String& keySystem() const { return m_keySystem; } |
| 76 String sessionId() const; | 75 String sessionId() const; |
| 77 | 76 |
| 78 void setError(MediaKeyError*); | 77 void setError(MediaKeyError*); |
| 79 MediaKeyError* error() { return m_error.get(); } | 78 MediaKeyError* error() { return m_error.get(); } |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 132 // Is the CDM finished with this session? | 131 // Is the CDM finished with this session? |
| 133 bool m_isClosed; | 132 bool m_isClosed; |
| 134 | 133 |
| 135 Deque<OwnPtr<PendingAction> > m_pendingActions; | 134 Deque<OwnPtr<PendingAction> > m_pendingActions; |
| 136 Timer<MediaKeySession> m_actionTimer; | 135 Timer<MediaKeySession> m_actionTimer; |
| 137 }; | 136 }; |
| 138 | 137 |
| 139 } | 138 } |
| 140 | 139 |
| 141 #endif // MediaKeySession_h | 140 #endif // MediaKeySession_h |
| OLD | NEW |