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

Unified Diff: ppapi/cpp/private/content_decryptor_private.h

Issue 10827280: Add PPAPI decryptor implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Partially address xhwang's comments, and fix some StringVar crashiness Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: ppapi/cpp/private/content_decryptor_private.h
diff --git a/ppapi/cpp/private/content_decryptor_private.h b/ppapi/cpp/private/content_decryptor_private.h
new file mode 100644
index 0000000000000000000000000000000000000000..1d2c77a4c8df3bde8ac9f0560619235da61faadf
--- /dev/null
+++ b/ppapi/cpp/private/content_decryptor_private.h
@@ -0,0 +1,64 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef PPAPI_CPP_PRIVATE_CONTENT_DECRYPTOR_PRIVATE_H_
+#define PPAPI_CPP_PRIVATE_CONTENT_DECRYPTOR_PRIVATE_H_
+
+#include "ppapi/cpp/instance_handle.h"
+#include "ppapi/cpp/var.h"
+#include "ppapi/cpp/var_array_buffer.h"
+#include "ppapi/cpp/dev/buffer_dev.h"
+#include "ppapi/c/private/ppb_content_decryptor_private.h"
+#include "ppapi/c/private/ppp_content_decryptor_private.h"
dmichael (off chromium) 2012/08/15 17:44:37 nit: include order. The /c/ stuff should come firs
Tom Finegan 2012/08/16 03:10:48 Done.
+
+namespace pp {
+
+class Instance;
+
+class ContentDecryptor_Private {
+ public:
+ explicit ContentDecryptor_Private(Instance* instance);
+ virtual ~ContentDecryptor_Private();
+
+ // PPP_ContentDecryptor_Private functions exposed as virtual functions
+ // for you to override.
+ virtual bool GenerateKeyRequest(const std::string& key_system,
dmichael (off chromium) 2012/08/15 17:44:37 Re-thinking it, if you just have to turn around an
Tom Finegan 2012/08/16 03:10:48 It's going to require extraction to a string withi
dmichael (off chromium) 2012/08/16 17:02:28 My point was that some of these strings will *also
Tom Finegan 2012/08/16 18:10:58 Added a TODO re this being an optimization.
+ pp::VarArrayBuffer init_data) = 0;
+ virtual bool AddKey(const std::string& session_id,
+ pp::VarArrayBuffer key) = 0;
+ virtual bool CancelKeyRequest(const std::string& session_id) = 0;
+ virtual bool Decrypt(pp::Buffer_Dev encrypted_buffer,
+ int32_t request_id) = 0;
+ virtual bool DecryptAndDecode(pp::Buffer_Dev encrypted_buffer,
+ int32_t request_id) = 0;
+
+ // PPB_ContentDecryptor_Private methods for passing data from the decryptor
+ // to the browser.
+ void NeedKey(const std::string& key_system,
+ const std::string& session_id,
+ const std::string& init_data);
+ void KeyAdded(const std::string& key_system,
+ const std::string& session_id);
+ void KeyMessage(const std::string& key_system,
+ const std::string& session_id,
+ pp::Buffer_Dev message,
+ const std::string& default_url);
+ void KeyError(const std::string& key_system,
+ const std::string& session_id,
+ int32_t media_error,
+ int32_t system_code);
+ void DeliverBlock(pp::Buffer_Dev decrypted_block,
+ int32_t request_id);
+ void DeliverFrame(pp::Buffer_Dev decrypted_frame,
+ int32_t request_id);
+ void DeliverSamples(pp::Buffer_Dev decrypted_samples,
+ int32_t request_id);
+
+ private:
+ InstanceHandle associated_instance_;
+};
+
+} // namespace pp
+
+#endif // PPAPI_CPP_PRIVATE_CONTENT_DECRYPTOR_PRIVATE_H_
« no previous file with comments | « no previous file | ppapi/cpp/private/content_decryptor_private.cc » ('j') | ppapi/cpp/private/content_decryptor_private.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698