| Index: third_party/grpc/include/grpc++/impl/codegen/status.h
|
| diff --git a/third_party/WebKit/Source/core/html/forms/BaseButtonInputType.h b/third_party/grpc/include/grpc++/impl/codegen/status.h
|
| similarity index 57%
|
| copy from third_party/WebKit/Source/core/html/forms/BaseButtonInputType.h
|
| copy to third_party/grpc/include/grpc++/impl/codegen/status.h
|
| index 2c6f31b406b5ac2b630f932fb8fb9ee04aa84276..a509d311d4250e29b4826b322c04aa2982b57bce 100644
|
| --- a/third_party/WebKit/Source/core/html/forms/BaseButtonInputType.h
|
| +++ b/third_party/grpc/include/grpc++/impl/codegen/status.h
|
| @@ -1,5 +1,7 @@
|
| /*
|
| - * Copyright (C) 2010 Google Inc. All rights reserved.
|
| + *
|
| + * Copyright 2016, 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,40 +28,49 @@
|
| * 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 BaseButtonInputType_h
|
| -#define BaseButtonInputType_h
|
| +#ifndef GRPCXX_IMPL_CODEGEN_STATUS_H
|
| +#define GRPCXX_IMPL_CODEGEN_STATUS_H
|
| +
|
| +#include <grpc++/impl/codegen/config.h>
|
| +#include <grpc++/impl/codegen/status_code_enum.h>
|
| +
|
| +namespace grpc {
|
|
|
| -#include "core/html/forms/InputType.h"
|
| -#include "core/html/forms/KeyboardClickableInputTypeView.h"
|
| +/// Did it work? If it didn't, why?
|
| +///
|
| +/// See \a grpc::StatusCode for details on the available code and their meaning.
|
| +class Status {
|
| + public:
|
| + /// Construct an OK instance.
|
| + Status() : code_(StatusCode::OK) {}
|
|
|
| -namespace blink {
|
| + /// Construct an instance with associated \a code and \a details (also
|
| + // referred to as "error_message").
|
| + Status(StatusCode code, const grpc::string& details)
|
| + : code_(code), details_(details) {}
|
|
|
| -// Base of button, image, reset, and submit types.
|
| -class BaseButtonInputType : public InputType, public KeyboardClickableInputTypeView {
|
| - USING_GARBAGE_COLLECTED_MIXIN(BaseButtonInputType);
|
| -public:
|
| - DECLARE_VIRTUAL_TRACE();
|
| - using InputType::element;
|
| + // Pre-defined special status objects.
|
| + /// An OK pre-defined instance.
|
| + static const Status& OK;
|
| + /// A CANCELLED pre-defined instance.
|
| + static const Status& CANCELLED;
|
|
|
| -protected:
|
| - explicit BaseButtonInputType(HTMLInputElement&);
|
| - void valueAttributeChanged() override;
|
| - void createShadowSubtree() override;
|
| + /// Return the instance's error code.
|
| + StatusCode error_code() const { return code_; }
|
| + /// Return the instance's error message.
|
| + grpc::string error_message() const { return details_; }
|
|
|
| -private:
|
| - InputTypeView* createView() override;
|
| - bool shouldSaveAndRestoreFormControlState() const override;
|
| - void appendToFormData(FormData&) const override;
|
| - LayoutObject* createLayoutObject(const ComputedStyle&) const override;
|
| - bool storesValueSeparateFromAttribute() override;
|
| - void setValue(const String&, bool, TextFieldEventBehavior) override;
|
| - bool matchesDefaultPseudoClass() override;
|
| + /// Is the status OK?
|
| + bool ok() const { return code_ == StatusCode::OK; }
|
|
|
| - String displayValue() const;
|
| + private:
|
| + StatusCode code_;
|
| + grpc::string details_;
|
| };
|
|
|
| -} // namespace blink
|
| +} // namespace grpc
|
|
|
| -#endif // BaseButtonInputType_h
|
| +#endif // GRPCXX_IMPL_CODEGEN_STATUS_H
|
|
|