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

Side by Side Diff: third_party/WebKit/Source/modules/mediasession/MediaSession.h

Issue 1370453002: Introduce WebMediaSession (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert throwing in the constructor; would needlessly complicate existing tests Created 5 years, 2 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #ifndef MediaSession_h 5 #ifndef MediaSession_h
6 #define MediaSession_h 6 #define MediaSession_h
7 7
8 #include "bindings/core/v8/ScriptPromise.h"
9 #include "bindings/core/v8/ScriptPromiseResolver.h"
mlamouri (slow - plz ping) 2015/10/07 14:19:31 I don't think you need the Resolver header in here
davve 2015/10/08 09:17:35 Done.
8 #include "bindings/core/v8/ScriptWrappable.h" 10 #include "bindings/core/v8/ScriptWrappable.h"
11 #include "modules/ModulesExport.h"
9 #include "platform/heap/Handle.h" 12 #include "platform/heap/Handle.h"
13 #include "public/platform/modules/mediasession/WebMediaSession.h"
mlamouri (slow - plz ping) 2015/10/07 14:19:31 Can you fwd declare WebMediaSession? (Not sure wha
davve 2015/10/08 09:17:35 As you suspected, PassOwnPtr seems to not like tha
14 #include "wtf/OwnPtr.h"
10 15
11 namespace blink { 16 namespace blink {
12 17
13 class MediaSession : public GarbageCollected<MediaSession>, public ScriptWrappab le { 18 class ScriptState;
19 class WebMediaSession;
20
21 class MODULES_EXPORT MediaSession
22 : public GarbageCollectedFinalized<MediaSession>
23 , public ScriptWrappable {
14 DEFINE_WRAPPERTYPEINFO(); 24 DEFINE_WRAPPERTYPEINFO();
15 public: 25 public:
16 static MediaSession* create(); 26 static MediaSession* create(ExecutionContext*);
27 static MediaSession* createForTesting(PassOwnPtr<WebMediaSession>);
mlamouri (slow - plz ping) 2015/10/07 14:19:31 nit: I would prefer to have the test marked as a f
davve 2015/10/08 09:17:35 That would require one to add a FRIEND_TEST_ALL_PR
philipj_slow 2015/10/08 09:34:57 FWIW, there's quite a few fooForTesting in Blink,
mlamouri (slow - plz ping) 2015/10/09 13:01:28 I replied in the new patchset. There is no need to
17 28
18 void activate(); 29 ScriptPromise activate(ScriptState*);
19 void deactivate(); 30 ScriptPromise deactivate(ScriptState*);
20 31
21 DEFINE_INLINE_TRACE() { } 32 DEFINE_INLINE_TRACE() { }
22 33
23 private: 34 private:
24 MediaSession() = default; 35 explicit MediaSession(PassOwnPtr<WebMediaSession>);
36
37 OwnPtr<WebMediaSession> m_webMediaSession;
25 }; 38 };
26 39
27 } // namespace blink 40 } // namespace blink
28 41
29 #endif // MediaSession_h 42 #endif // MediaSession_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698