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

Unified Diff: media/base/provision_fetcher.h

Issue 1427183002: Move MediaDrmBridge provision communication to native side. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: For on-demand provisioning the fetcher is created in content/ and depends on the renderer. Created 5 years, 1 month 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: media/base/provision_fetcher.h
diff --git a/media/base/provision_fetcher.h b/media/base/provision_fetcher.h
new file mode 100644
index 0000000000000000000000000000000000000000..3f1e796300139d845e62387c952d2a4ca9c23948
--- /dev/null
+++ b/media/base/provision_fetcher.h
@@ -0,0 +1,39 @@
+// Copyright 2015 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 MEDIA_BASE_PROVISION_FETCHER_H
+#define MEDIA_BASE_PROVISION_FETCHER_H
+
+#include <string>
xhwang 2015/11/06 23:08:19 style nit: one empty line here
Tima Vaisburd 2015/11/11 03:03:34 Done.
+#include "base/callback.h"
+#include "base/memory/scoped_ptr.h"
xhwang 2015/11/06 23:08:19 not used?
Tima Vaisburd 2015/11/11 03:03:34 Removed
+#include "media/base/media_export.h"
+
+namespace media {
+
+// The interface to retrieve provision information for MediaDrmBridge.
+class MEDIA_EXPORT ProvisionFetcher {
+ public:
+ // After provision information is retrieved this callback will be called
+ // with the status flag (success/failure) and the provision response in
+ // case of success.
+ using ResponseCB =
+ base::Callback<void(bool success, const std::string& response)>;
+
+ virtual ~ProvisionFetcher() {}
+
+ // Requests the provision information with |default_url| and |request_data|
+ // and calls |cb| callback with the response. The input parameters
+ // |default_url| and |request_data| corresponds to Java class
+ // MediaDrm.ProvisionRequest.
+ // The implementation must call |cb| on the same thread that this method
xhwang 2015/11/06 23:08:19 nit: s/cb/response_cb Also, the callback should b
Tima Vaisburd 2015/11/11 03:03:34 Done.
+ // is called.
+ virtual void Retrieve(const std::string& default_url,
+ const std::string& request_data,
+ const ResponseCB& response_cb) = 0;
+};
xhwang 2015/11/06 23:08:19 DISALLOW_COPY_AND_ASSIGN
Tima Vaisburd 2015/11/11 03:03:34 Why do we need to require this here?
xhwang 2015/11/11 09:53:21 Acknowledged.
+
+} // namespace media
+
+#endif // MEDIA_BASE_PROVISION_FETCHER_H

Powered by Google App Engine
This is Rietveld 408576698