Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/v1.0.x' into v1.0.1_upmerge
Browse files Browse the repository at this point in the history
  • Loading branch information
murgatroid99 committed Oct 28, 2016
2 parents 51fc01d + 6040b47 commit 5d6ae93
Show file tree
Hide file tree
Showing 26 changed files with 481 additions and 338 deletions.
4 changes: 2 additions & 2 deletions gRPC-Core.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

Pod::Spec.new do |s|
s.name = 'gRPC-Core'
version = '1.0.0'
version = '1.0.1'
s.version = version
s.summary = 'Core cross-platform gRPC library, written in C'
s.homepage = 'http://www.grpc.io'
Expand Down Expand Up @@ -186,7 +186,7 @@ Pod::Spec.new do |s|
ss.header_mappings_dir = '.'
ss.libraries = 'z'
ss.dependency "#{s.name}/Interface", version
ss.dependency 'BoringSSL', '~> 6.0'
ss.dependency 'BoringSSL', '~> 7.0'

# To save you from scrolling, this is the last part of the podspec.
ss.source_files = 'src/core/lib/profiling/timers.h',
Expand Down
2 changes: 1 addition & 1 deletion gRPC-ProtoRPC.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

Pod::Spec.new do |s|
s.name = 'gRPC-ProtoRPC'
version = '1.0.0'
version = '1.0.1'
s.version = version
s.summary = 'RPC library for Protocol Buffers, based on gRPC'
s.homepage = 'http://www.grpc.io'
Expand Down
2 changes: 1 addition & 1 deletion gRPC-RxLibrary.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

Pod::Spec.new do |s|
s.name = 'gRPC-RxLibrary'
version = '1.0.0'
version = '1.0.1'
s.version = version
s.summary = 'Reactive Extensions library for iOS/OSX.'
s.homepage = 'http://www.grpc.io'
Expand Down
2 changes: 1 addition & 1 deletion gRPC.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

Pod::Spec.new do |s|
s.name = 'gRPC'
version = '1.0.0'
version = '1.0.1'
s.version = version
s.summary = 'gRPC client library for iOS/OSX'
s.homepage = 'http://www.grpc.io'
Expand Down
25 changes: 13 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,38 +25,39 @@
"coverage": "./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha src/node/test",
"install": "./node_modules/.bin/node-pre-gyp install --fallback-to-build"
},
"bundledDependencies": ["node-pre-gyp"],
"bundledDependencies": [
"node-pre-gyp"
],
"dependencies": {
"arguejs": "^0.2.3",
"lodash": "^3.9.3",
"lodash": "^4.15.0",
"nan": "^2.0.0",
"protobufjs": "^4.0.0"
"node-pre-gyp": "^0.6.0",
"protobufjs": "^5.0.0"
},
"devDependencies": {
"async": "^1.5.0",
"async": "^2.0.1",
"body-parser": "^1.15.2",
"express": "^4.14.0",
"google-auth-library": "^0.9.2",
"google-protobuf": "^3.0.0",
"istanbul": "^0.3.21",
"istanbul": "^0.4.4",
"jsdoc": "^3.3.2",
"jshint": "^2.5.0",
"minimist": "^1.1.0",
"mocha": "^2.3.4",
"mocha-jenkins-reporter": "^0.1.9",
"mustache": "^2.0.0",
"mocha": "^3.0.2",
"mocha-jenkins-reporter": "^0.2.3",
"poisson-process": "^0.2.1"
},
"engines": {
"node": ">=0.12.0"
},
"binary": {
"module_name": "grpc_node",
"module_path": "./build/Release/",
"module_path": "src/node/extension_binary",
"host": "https://storage.googleapis.com/",
"remote_path": "grpc-precompiled-binaries/node/{name}/v{version}",
"package_name": "{node_abi}-{platform}-{arch}.tar.gz",
"module_path": "src/node/extension_binary"
"package_name": "{node_abi}-{platform}-{arch}.tar.gz"
},
"files": [
"LICENSE",
Expand All @@ -77,7 +78,7 @@
],
"main": "src/node/index.js",
"license": "BSD-3-Clause",
"jshintConfig" : {
"jshintConfig": {
"bitwise": true,
"curly": true,
"eqeqeq": true,
Expand Down
40 changes: 40 additions & 0 deletions src/compiler/ruby_generator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,43 @@ void PrintService(const ServiceDescriptor *service, const grpc::string &package,

} // namespace

// The following functions are copied directly from the source for the protoc
// ruby generator
// to ensure compatibility (with the exception of int and string type changes).
// See
// https://github.com/google/protobuf/blob/master/src/google/protobuf/compiler/ruby/ruby_generator.cc#L250
// TODO: keep up to date with protoc code generation, though this behavior isn't
// expected to change
bool IsLower(char ch) { return ch >= 'a' && ch <= 'z'; }

char ToUpper(char ch) { return IsLower(ch) ? (ch - 'a' + 'A') : ch; }

// Package names in protobuf are snake_case by convention, but Ruby module
// names must be PascalCased.
//
// foo_bar_baz -> FooBarBaz
grpc::string PackageToModule(const grpc::string &name) {
bool next_upper = true;
grpc::string result;
result.reserve(name.size());

for (grpc::string::size_type i = 0; i < name.size(); i++) {
if (name[i] == '_') {
next_upper = true;
} else {
if (next_upper) {
result.push_back(ToUpper(name[i]));
} else {
result.push_back(name[i]);
}
next_upper = false;
}
}

return result;
}
// end copying of protoc generator for ruby code

grpc::string GetServices(const FileDescriptor *file) {
grpc::string output;
{
Expand Down Expand Up @@ -164,6 +201,9 @@ grpc::string GetServices(const FileDescriptor *file) {
std::map<grpc::string, grpc::string> module_vars = ListToDict({
"module.name", CapitalizeFirst(modules[i]),
});
std::map<grpc::string, grpc::string> module_vars = ListToDict({
"module.name", PackageToModule(modules[i]),
});
out.Print(module_vars, "module $module.name$\n");
out.Indent();
}
Expand Down
14 changes: 9 additions & 5 deletions src/node/ext/byte_buffer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
namespace grpc {
namespace node {

using Nan::MaybeLocal;

using v8::Context;
using v8::Function;
using v8::Local;
using v8::Object;
Expand Down Expand Up @@ -89,15 +89,19 @@ Local<Value> ByteBufferToBuffer(grpc_byte_buffer *buffer) {
Local<Value> MakeFastBuffer(Local<Value> slowBuffer) {
Nan::EscapableHandleScope scope;
Local<Object> globalObj = Nan::GetCurrentContext()->Global();
MaybeLocal<Value> constructorValue = Nan::Get(
globalObj, Nan::New("Buffer").ToLocalChecked());
Local<Function> bufferConstructor = Local<Function>::Cast(
globalObj->Get(Nan::New("Buffer").ToLocalChecked()));
Local<Value> consArgs[3] = {
constructorValue.ToLocalChecked());
const int argc = 3;
Local<Value> consArgs[argc] = {
slowBuffer,
Nan::New<Number>(::node::Buffer::Length(slowBuffer)),
Nan::New<Number>(0)
};
Local<Object> fastBuffer = bufferConstructor->NewInstance(3, consArgs);
return scope.Escape(fastBuffer);
MaybeLocal<Object> fastBuffer = Nan::NewInstance(bufferConstructor,
argc, consArgs);
return scope.Escape(fastBuffer.ToLocalChecked());
}
} // namespace node
} // namespace grpc
8 changes: 4 additions & 4 deletions src/node/ext/call.cc
Original file line number Diff line number Diff line change
Expand Up @@ -669,16 +669,16 @@ NAN_METHOD(Call::New) {
return Nan::ThrowTypeError("Call's fourth argument must be a string");
}
call = new Call(wrapped_call);
info.This()->SetHiddenValue(Nan::New("channel_").ToLocalChecked(),
channel_object);
Nan::Set(info.This(), Nan::New("channel_").ToLocalChecked(),
channel_object);
}
call->Wrap(info.This());
info.GetReturnValue().Set(info.This());
} else {
const int argc = 4;
Local<Value> argv[argc] = {info[0], info[1], info[2], info[3]};
MaybeLocal<Object> maybe_instance = constructor->GetFunction()->NewInstance(
argc, argv);
MaybeLocal<Object> maybe_instance = Nan::NewInstance(
constructor->GetFunction(), argc, argv);
if (maybe_instance.IsEmpty()) {
// There's probably a pending exception
return;
Expand Down
4 changes: 2 additions & 2 deletions src/node/ext/channel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,8 @@ NAN_METHOD(Channel::New) {
} else {
const int argc = 3;
Local<Value> argv[argc] = {info[0], info[1], info[2]};
MaybeLocal<Object> maybe_instance = constructor->GetFunction()->NewInstance(
argc, argv);
MaybeLocal<Object> maybe_instance = Nan::NewInstance(
constructor->GetFunction(), argc, argv);
if (maybe_instance.IsEmpty()) {
// There's probably a pending exception
return;
Expand Down
2 changes: 1 addition & 1 deletion src/node/ext/server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ NAN_METHOD(Server::New) {
const int argc = 1;
Local<Value> argv[argc] = {info[0]};
MaybeLocal<Object> maybe_instance =
constructor->GetFunction()->NewInstance(argc, argv);
Nan::NewInstance(constructor->GetFunction(), argc, argv);
if (maybe_instance.IsEmpty()) {
// There's probably a pending exception
return;
Expand Down
2 changes: 1 addition & 1 deletion src/node/src/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ exports.getProtobufServiceAttrs = function getProtobufServiceAttrs(service,
binaryAsBase64 = options.binaryAsBase64;
longsAsStrings = options.longsAsStrings;
}
return _.object(_.map(service.children, function(method) {
return _.fromPairs(_.map(service.children, function(method) {
return [_.camelCase(method.name), {
path: prefix + method.name,
requestStream: method.requestStream,
Expand Down
4 changes: 2 additions & 2 deletions src/objective-c/!ProtoCompiler-gRPCPlugin.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Pod::Spec.new do |s|
# exclamation mark ensures that other "regular" pods will be able to find it as it'll be installed
# before them.
s.name = '!ProtoCompiler-gRPCPlugin'
v = '1.0.0'
v = '1.0.1'
s.version = v
s.summary = 'The gRPC ProtoC plugin generates Objective-C files from .proto services.'
s.description = <<-DESC
Expand Down Expand Up @@ -95,7 +95,7 @@ Pod::Spec.new do |s|
s.preserve_paths = plugin

# Restrict the protoc version to the one supported by this plugin.
s.dependency '!ProtoCompiler', '3.0.0'
s.dependency '!ProtoCompiler', '3.0.2'
# For the Protobuf dependency not to complain:
s.ios.deployment_target = '7.1'
s.osx.deployment_target = '10.9'
Expand Down
2 changes: 1 addition & 1 deletion src/objective-c/!ProtoCompiler.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Pod::Spec.new do |s|
# exclamation mark ensures that other "regular" pods will be able to find it as it'll be installed
# before them.
s.name = '!ProtoCompiler'
v = '3.0.0'
v = '3.0.2'
s.version = v
s.summary = 'The Protobuf Compiler (protoc) generates Objective-C files from .proto files'
s.description = <<-DESC
Expand Down
Loading

0 comments on commit 5d6ae93

Please sign in to comment.