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

Unified Diff: extensions/browser/api/cast_channel/cast_channel_api.cc

Issue 627573002: Enable passing cast channel certificate authority keys. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Code review feedback changes. Created 6 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 side-by-side diff with in-line comments
Download patch
Index: extensions/browser/api/cast_channel/cast_channel_api.cc
diff --git a/extensions/browser/api/cast_channel/cast_channel_api.cc b/extensions/browser/api/cast_channel/cast_channel_api.cc
index 9d711a48c0c7910804a435ce46cd76f4fa3ae8c6..2a44627c1594fbb6f9bbca29744a4309791202f7 100644
--- a/extensions/browser/api/cast_channel/cast_channel_api.cc
+++ b/extensions/browser/api/cast_channel/cast_channel_api.cc
@@ -14,6 +14,7 @@
#include "base/time/default_tick_clock.h"
#include "base/values.h"
#include "content/public/browser/browser_thread.h"
+#include "extensions/browser/api/cast_channel/cast_auth_util.h"
#include "extensions/browser/api/cast_channel/cast_socket.h"
#include "extensions/browser/api/cast_channel/logger.h"
#include "extensions/browser/event_router.h"
@@ -510,4 +511,31 @@ void CastChannelGetLogsFunction::AsyncWorkStart() {
AsyncWorkCompleted();
}
+CastChannelSetAuthorityKeysFunction::CastChannelSetAuthorityKeysFunction() {
+}
+
+CastChannelSetAuthorityKeysFunction::~CastChannelSetAuthorityKeysFunction() {
+}
+
+bool CastChannelSetAuthorityKeysFunction::Prepare() {
+ params_ = cast_channel::SetAuthorityKeys::Params::Create(*args_);
+ EXTENSION_FUNCTION_VALIDATE(params_.get());
+ return true;
+}
+
+void CastChannelSetAuthorityKeysFunction::AsyncWorkStart() {
+ LOG(ERROR) << "CastChannelSetAuthorityKeysFunction::AsyncWorkStart";
+ std::string& signature = params_->signature;
+ std::string& keys = params_->keys;
+ if (signature.size() > 0 && keys.size() > 0 &&
Ryan Sleevi 2014/10/11 02:22:36 When using the STL, prefer .empty() instead of .si
vadimgo 2014/10/13 22:14:24 Done.
+ cast_channel::SetTrustedCertificateAuthorities(signature, keys)) {
+ // Intentionally returns a blank.
+ SetResult(new base::StringValue(std::string()));
+ } else {
+ SetError("Unable to set authority keys.");
+ }
+
+ AsyncWorkCompleted();
+}
+
} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698