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

Side by Side Diff: Source/core/platform/graphics/CDMSessionChromium.h

Issue 16387015: Make unprefixed EME APIs use platform and Chromium. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 6 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 10 matching lines...) Expand all
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #ifndef LinkResource_h 31 #ifndef CDMSessionChromium_h
32 #define LinkResource_h 32 #define CDMSessionChromium_h
33 33
34 #include "core/loader/cache/CachedResourceRequest.h" 34 #include "core/platform/graphics/CDMSession.h"
35 #include "core/platform/KURL.h" 35 #include "public/platform/WebCDMSession.h"
36 #include "wtf/Forward.h" 36 #include "wtf/OwnPtr.h"
37 #include "wtf/RefCounted.h"
38 #include "wtf/text/WTFString.h" 37 #include "wtf/text/WTFString.h"
39 38
39 namespace WebKit {
40 class WebCDM;
41 }
42
40 namespace WebCore { 43 namespace WebCore {
41 44
42 class HTMLLinkElement; 45 class CDMSessionChromium : public CDMSession, private WebKit::WebCDMSession::Cli ent {
abarth-chromium 2013/06/07 00:08:23 There's no need for any of these Chromium files.
ddorwin 2013/06/10 22:52:34 Done.
46 public:
47 CDMSessionChromium(WebKit::WebCDM&, CDMSessionClient*);
48 virtual ~CDMSessionChromium() { }
43 49
44 class LinkResource : public RefCounted<LinkResource> { 50 // CDMSession
45 public: 51 virtual WTF::String sessionId() const OVERRIDE;
46 enum Type { 52 virtual void generateKeyRequest(const WTF::String& mimeType, const WTF::Uint 8Array& initData) OVERRIDE;
47 Style, 53 virtual void update(const WTF::Uint8Array& key) OVERRIDE;
48 Import 54 virtual void close() OVERRIDE;
49 };
50 55
51 explicit LinkResource(HTMLLinkElement*); 56 // WebKit::WebCDMSession::Client
52 virtual ~LinkResource(); 57 virtual void keyAdded() OVERRIDE;
53 58 virtual void keyError(MediaKeyErrorCode, unsigned long systemCode) OVERRIDE;
54 virtual Type type() const = 0; 59 virtual void keyMessage(const unsigned char* message, unsigned messageLength , const WebKit::WebURL& destinationURL) OVERRIDE;
55 virtual void process() = 0;
56 virtual void ownerRemoved() = 0;
57
58 protected:
59 HTMLLinkElement* m_owner;
60 };
61
62 class LinkRequestBuilder {
63 public:
64 explicit LinkRequestBuilder(HTMLLinkElement* owner);
65
66 bool isValid() const { return !m_url.isEmpty() && m_url.isValid(); }
67 const KURL& url() const { return m_url; }
68 const String& charset() const { return m_charset; }
69 CachedResourceRequest build(bool blocking) const;
70 60
71 private: 61 private:
72 HTMLLinkElement* m_owner; 62 OwnPtr<WebKit::WebCDMSession> m_session;
73 KURL m_url; 63
74 String m_charset; 64 CDMSessionClient* m_client;
75 }; 65 };
76 66
77 } // namespace WebCore 67 } // namespace WebCore
78 68
79 #endif // LinkResource_h 69 #endif // CDMSessionChromium_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698