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

Unified Diff: third_party/grpc/src/cpp/common/auth_property_iterator.cc

Issue 1932353002: Initial checkin of gRPC to third_party/ Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « third_party/grpc/src/cpp/codegen/grpc_library.cc ('k') | third_party/grpc/src/cpp/common/call.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/grpc/src/cpp/common/auth_property_iterator.cc
diff --git a/third_party/WebKit/Source/web/WebFileChooserCompletionImpl.h b/third_party/grpc/src/cpp/common/auth_property_iterator.cc
similarity index 51%
copy from third_party/WebKit/Source/web/WebFileChooserCompletionImpl.h
copy to third_party/grpc/src/cpp/common/auth_property_iterator.cc
index ef1c4ed1a1144232b71190e4309a290ef852f90a..a47abaf4b8dc1952cb7ed8a01b9a126dde6057a6 100644
--- a/third_party/WebKit/Source/web/WebFileChooserCompletionImpl.h
+++ b/third_party/grpc/src/cpp/common/auth_property_iterator.cc
@@ -1,5 +1,7 @@
/*
- * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Copyright 2015, Google Inc.
+ * All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -26,30 +28,58 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
*/
-#ifndef WebFileChooserCompletionImpl_h
-#define WebFileChooserCompletionImpl_h
+#include <grpc++/security/auth_context.h>
+
+#include <grpc/grpc_security.h>
+
+namespace grpc {
+
+AuthPropertyIterator::AuthPropertyIterator()
+ : property_(nullptr), ctx_(nullptr), index_(0), name_(nullptr) {}
+
+AuthPropertyIterator::AuthPropertyIterator(
+ const grpc_auth_property* property, const grpc_auth_property_iterator* iter)
+ : property_(property),
+ ctx_(iter->ctx),
+ index_(iter->index),
+ name_(iter->name) {}
+
+AuthPropertyIterator::~AuthPropertyIterator() {}
-#include "platform/FileChooser.h"
-#include "public/platform/WebString.h"
-#include "public/platform/WebVector.h"
-#include "public/web/WebFileChooserCompletion.h"
-#include "wtf/PassRefPtr.h"
+AuthPropertyIterator& AuthPropertyIterator::operator++() {
+ grpc_auth_property_iterator iter = {ctx_, index_, name_};
+ property_ = grpc_auth_property_iterator_next(&iter);
+ ctx_ = iter.ctx;
+ index_ = iter.index;
+ name_ = iter.name;
+ return *this;
+}
-namespace blink {
+AuthPropertyIterator AuthPropertyIterator::operator++(int) {
+ AuthPropertyIterator tmp(*this);
+ operator++();
+ return tmp;
+}
-class WebFileChooserCompletionImpl final : public WebFileChooserCompletion {
-public:
- explicit WebFileChooserCompletionImpl(PassRefPtr<FileChooser>);
- ~WebFileChooserCompletionImpl() override;
- void didChooseFile(const WebVector<WebString>& fileNames) override;
- void didChooseFile(const WebVector<SelectedFileInfo>& files) override;
+bool AuthPropertyIterator::operator==(const AuthPropertyIterator& rhs) const {
+ if (property_ == nullptr || rhs.property_ == nullptr) {
+ return property_ == rhs.property_;
+ } else {
+ return index_ == rhs.index_;
+ }
+}
-private:
- RefPtr<FileChooser> m_fileChooser;
-};
+bool AuthPropertyIterator::operator!=(const AuthPropertyIterator& rhs) const {
+ return !operator==(rhs);
+}
-} // namespace blink
+const AuthProperty AuthPropertyIterator::operator*() {
+ return std::pair<grpc::string_ref, grpc::string_ref>(
+ property_->name,
+ grpc::string_ref(property_->value, property_->value_length));
+}
-#endif
+} // namespace grpc
« no previous file with comments | « third_party/grpc/src/cpp/codegen/grpc_library.cc ('k') | third_party/grpc/src/cpp/common/call.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698