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

Unified Diff: chrome/browser/net_benchmarking_impl.h

Issue 2521823008: Migrate chrome_net_benchmarking_message_filter to mojo (Closed)
Patch Set: change all calls to use default sync method Created 4 years 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: 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_

Powered by Google App Engine
This is Rietveld 408576698