| 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
|
|
|