Index: chrome/browser/net_benchmarking_impl.h |
diff --git a/chrome/browser/net_benchmarking_impl.h b/chrome/browser/net_benchmarking_impl.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..87042c18610ec053ee71a66213b5c92169ca39f0 |
--- /dev/null |
+++ b/chrome/browser/net_benchmarking_impl.h |
@@ -0,0 +1,50 @@ |
+// Copyright (c) 2011 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 CHROME_BROWSER_NET_BENCHMARKING_IMPL_H_ |
+#define CHROME_BROWSER_NET_BENCHMARKING_IMPL_H_ |
+ |
+#include "base/macros.h" |
+#include "chrome/browser/profiles/profile.h" |
+#include "chrome/common/net_benchmarking.mojom.h" |
+ |
+namespace net { |
+class URLRequestContextGetter; |
+} |
+ |
+class Profile; |
+ |
+// This class handles Chrome-specific benchmarking IPC messages |
+// for the renderer process. |
+class NetBenchmarkingImpl : public chrome::mojom::NetBenchmarking { |
sky
2016/12/13 02:02:52
The reason we use mojom in the namespace everywher
dvallet
2016/12/13 05:20:04
Done.
Just to note that from the documentation i
|
+ public: |
+ NetBenchmarkingImpl(Profile* profile, |
+ net::URLRequestContextGetter* request_context); |
+ ~NetBenchmarkingImpl() override; |
+ |
+ static void Create(Profile* profile, |
+ net::URLRequestContextGetter* request_context, |
+ chrome::mojom::NetBenchmarkingRequest request); |
+ static bool CheckBenchmarkingEnabled(); |
+ |
+ private: |
+ // chrome:mojom:NetBenchmarking. |
+ void CloseCurrentConnections( |
+ const CloseCurrentConnectionsCallback& callback) override; |
+ void ClearCache(const ClearCacheCallback& callback) override; |
+ void ClearHostResolverCache( |
+ const ClearHostResolverCacheCallback& callback) override; |
+ void ClearPredictorCache( |
+ const ClearPredictorCacheCallback& callback) override; |
+ |
+ // The Profile associated with our renderer process. This should only be |
+ // accessed on the UI thread! |
+ // TODO(623967): Store the Predictor* here instead of the Profile. |
+ Profile* profile_; |
+ scoped_refptr<net::URLRequestContextGetter> request_context_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(NetBenchmarkingImpl); |
+}; |
+ |
+#endif // CHROME_BROWSER_NET_BENCHMARKING_IMPL_H_ |