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

Unified Diff: third_party/grpc/src/node/health_check/health.js

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/node/ext/timeval.cc ('k') | third_party/grpc/src/node/index.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/grpc/src/node/health_check/health.js
diff --git a/third_party/WebKit/Source/platform/plugins/PluginListBuilder.h b/third_party/grpc/src/node/health_check/health.js
similarity index 65%
copy from third_party/WebKit/Source/platform/plugins/PluginListBuilder.h
copy to third_party/grpc/src/node/health_check/health.js
index ece23a9b2ddc3a2f60ab89cae320a597ccc3d757..6ab41571831b803f372fd7f32fd78a972d1ec2a3 100644
--- a/third_party/WebKit/Source/platform/plugins/PluginListBuilder.h
+++ b/third_party/grpc/src/node/health_check/health.js
@@ -1,5 +1,7 @@
/*
- * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Copyright 2015-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,32 +28,40 @@
* 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 PluginListBuilder_h
-#define PluginListBuilder_h
+'use strict';
+
+var grpc = require('../');
-#include "platform/plugins/PluginData.h"
-#include "public/platform/WebPluginListBuilder.h"
-#include "wtf/Allocator.h"
-#include "wtf/Vector.h"
+var _ = require('lodash');
-namespace blink {
+var health_proto = grpc.load(__dirname +
+ '/../../proto/grpc/health/v1/health.proto');
-class PluginListBuilder final : public WebPluginListBuilder {
- DISALLOW_NEW();
-public:
- PluginListBuilder(Vector<PluginInfo>* results) : m_results(results) { }
+var HealthClient = health_proto.grpc.health.v1.Health;
- // WebPluginListBuilder methods:
- void addPlugin(const WebString& name, const WebString& description, const WebString& fileName) override;
- void addMediaTypeToLastPlugin(const WebString& name, const WebString& description) override;
- void addFileExtensionToLastMediaType(const WebString& extension) override;
+function HealthImplementation(statusMap) {
+ this.statusMap = _.clone(statusMap);
+}
-private:
- Vector<PluginInfo>* m_results;
+HealthImplementation.prototype.setStatus = function(service, status) {
+ this.statusMap[service] = status;
};
-} // namespace blink
+HealthImplementation.prototype.check = function(call, callback){
+ var service = call.request.service;
+ var status = _.get(this.statusMap, service, null);
+ if (status === null) {
+ callback({code:grpc.status.NOT_FOUND});
+ } else {
+ callback(null, {status: status});
+ }
+};
-#endif
+module.exports = {
+ Client: HealthClient,
+ service: HealthClient.service,
+ Implementation: HealthImplementation
+};
« no previous file with comments | « third_party/grpc/src/node/ext/timeval.cc ('k') | third_party/grpc/src/node/index.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698