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

Unified Diff: components/grpc_support/environment.h

Issue 2273403003: Moving gRPC support interfaces out of cronet and into a new component. (Closed)
Patch Set: Add cronet_c_for_graph back to sources. Might fix GN, probably won't compile Created 4 years, 4 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
Index: components/grpc_support/environment.h
diff --git a/components/grpc_support/environment.h b/components/grpc_support/environment.h
new file mode 100644
index 0000000000000000000000000000000000000000..74e0722f8dde43653682d429897a9ac4da4bf323
--- /dev/null
+++ b/components/grpc_support/environment.h
@@ -0,0 +1,31 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_GRPC_SUPPORT_ENVIRONMENT_H_
+#define COMPONENTS_GRPC_SUPPORT_ENVIRONMENT_H_
+
+#include <string>
+
+#include "base/callback.h"
+#include "base/tracked_objects.h"
+
+namespace net {
+class URLRequestContext;
+}
+
+namespace grpc_support {
+
+// Abstract base class for gRPC environment.
+class Environment {
+ public:
+ virtual bool IsOnNetworkThread() = 0;
+ virtual void PostToNetworkThread(const tracked_objects::Location& from_here,
+ const base::Closure& task) = 0;
+ virtual net::URLRequestContext* GetURLRequestContext() const = 0;
+ virtual std::string UserAgent() = 0;
+};
+
+} // namespace grpc_support
+
+#endif // COMPONENTS_GRPC_SUPPORT_ENVIRONMENT_H_

Powered by Google App Engine
This is Rietveld 408576698