| Index: third_party/grpc/src/core/client_config/subchannel_factory.h
|
| diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptFunction.h b/third_party/grpc/src/core/client_config/subchannel_factory.h
|
| similarity index 53%
|
| copy from third_party/WebKit/Source/bindings/core/v8/ScriptFunction.h
|
| copy to third_party/grpc/src/core/client_config/subchannel_factory.h
|
| index 21592756b5cc08b377a9ee70f2d71cd81ee775d5..c6d8cc90bed7f262577b2f1fe937ccd3d62ee232 100644
|
| --- a/third_party/WebKit/Source/bindings/core/v8/ScriptFunction.h
|
| +++ b/third_party/grpc/src/core/client_config/subchannel_factory.h
|
| @@ -1,5 +1,7 @@
|
| /*
|
| - * Copyright (C) 2013 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,51 +28,39 @@
|
| * 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 ScriptFunction_h
|
| -#define ScriptFunction_h
|
| -
|
| -#include "bindings/core/v8/ScriptValue.h"
|
| -#include "core/CoreExport.h"
|
| -#include "platform/heap/Handle.h"
|
| -#include <v8.h>
|
| -
|
| -namespace blink {
|
| +#ifndef GRPC_INTERNAL_CORE_CLIENT_CONFIG_SUBCHANNEL_FACTORY_H
|
| +#define GRPC_INTERNAL_CORE_CLIENT_CONFIG_SUBCHANNEL_FACTORY_H
|
|
|
| -// A common way of using ScriptFunction is as follows:
|
| -//
|
| -// class DerivedFunction : public ScriptFunction {
|
| -// // This returns a V8 function which the DerivedFunction is bound to.
|
| -// // The DerivedFunction is destructed when the V8 function is
|
| -// // garbage-collected.
|
| -// static v8::Local<v8::Function> createFunction(ScriptState* scriptState)
|
| -// {
|
| -// DerivedFunction* self = new DerivedFunction(scriptState);
|
| -// return self->bindToV8Function();
|
| -// }
|
| -// };
|
| -class CORE_EXPORT ScriptFunction : public GarbageCollectedFinalized<ScriptFunction> {
|
| -public:
|
| - virtual ~ScriptFunction() { }
|
| - ScriptState* getScriptState() const { return m_scriptState.get(); }
|
| - DEFINE_INLINE_VIRTUAL_TRACE() { }
|
| +#include "src/core/channel/channel_stack.h"
|
| +#include "src/core/client_config/subchannel.h"
|
|
|
| -protected:
|
| - explicit ScriptFunction(ScriptState* scriptState)
|
| - : m_scriptState(scriptState)
|
| - {
|
| - }
|
| +typedef struct grpc_subchannel_factory grpc_subchannel_factory;
|
| +typedef struct grpc_subchannel_factory_vtable grpc_subchannel_factory_vtable;
|
|
|
| - v8::Local<v8::Function> bindToV8Function();
|
| -
|
| -private:
|
| - virtual ScriptValue call(ScriptValue) = 0;
|
| - static void callCallback(const v8::FunctionCallbackInfo<v8::Value>&);
|
| +/** Constructor for new configured channels.
|
| + Creating decorators around this type is encouraged to adapt behavior. */
|
| +struct grpc_subchannel_factory {
|
| + const grpc_subchannel_factory_vtable *vtable;
|
| +};
|
|
|
| - RefPtr<ScriptState> m_scriptState;
|
| +struct grpc_subchannel_factory_vtable {
|
| + void (*ref)(grpc_subchannel_factory *factory);
|
| + void (*unref)(grpc_exec_ctx *exec_ctx, grpc_subchannel_factory *factory);
|
| + grpc_subchannel *(*create_subchannel)(grpc_exec_ctx *exec_ctx,
|
| + grpc_subchannel_factory *factory,
|
| + grpc_subchannel_args *args);
|
| };
|
|
|
| -} // namespace blink
|
| +void grpc_subchannel_factory_ref(grpc_subchannel_factory *factory);
|
| +void grpc_subchannel_factory_unref(grpc_exec_ctx *exec_ctx,
|
| + grpc_subchannel_factory *factory);
|
| +
|
| +/** Create a new grpc_subchannel */
|
| +grpc_subchannel *grpc_subchannel_factory_create_subchannel(
|
| + grpc_exec_ctx *exec_ctx, grpc_subchannel_factory *factory,
|
| + grpc_subchannel_args *args);
|
|
|
| -#endif
|
| +#endif /* GRPC_INTERNAL_CORE_CLIENT_CONFIG_SUBCHANNEL_FACTORY_H */
|
|
|