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

Unified Diff: chrome/browser/chrome_net_benchmarking_impl.h

Issue 2521823008: Migrate chrome_net_benchmarking_message_filter to mojo (Closed)
Patch Set: change ClearPredictorCache to run on UI thread via PostTask 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/chrome_net_benchmarking_impl.h
diff --git a/chrome/browser/chrome_net_benchmarking_impl.h b/chrome/browser/chrome_net_benchmarking_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..3bc038577f2624d602414a0699d0927959a51b79
--- /dev/null
+++ b/chrome/browser/chrome_net_benchmarking_impl.h
@@ -0,0 +1,54 @@
+// 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_CHROME_NET_BENCHMARKING_IMPL_H_
+#define CHROME_BROWSER_CHROME_NET_BENCHMARKING_IMPL_H_
+
+#include "base/macros.h"
+#include "chrome/browser/profiles/profile.h"
+#include "chrome/common/chrome_net_benchmarking.mojom.h"
+
+namespace net {
+class URLRequestContextGetter;
+}
+
+class Profile;
+
+// This class handles Chrome-specific benchmarking IPC messages
+// for the renderer process.
+class ChromeNetBenchmarkingImpl
+ : public chrome::mojom::ChromeNetBenchmarking {
+ public:
+ ChromeNetBenchmarkingImpl(
+ Profile* profile,
+ net::URLRequestContextGetter* request_context);
+ ~ChromeNetBenchmarkingImpl() override;
+
+ static void Create(
+ Profile* profile,
+ net::URLRequestContextGetter* request_context,
+ chrome::mojom::ChromeNetBenchmarkingRequest request);
+
+ private:
+ // chrome:mojom:ChromeNetBenchmarking.
+ void CloseCurrentConnections() override;
+ void SetCacheMode(bool enabled) override;
+ void ClearCache(const ClearCacheCallback& callback) override;
+ void ClearHostResolverCache() override;
+ void ClearPredictorCache() override;
+
+ // Returns true if benchmarking is enabled for chrome.
+ bool CheckBenchmarkingEnabled() const;
+
+ // 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(ChromeNetBenchmarkingImpl);
+};
+
+#endif // CHROME_BROWSER_CHROME_NET_BENCHMARKING_IMPL_H_
+

Powered by Google App Engine
This is Rietveld 408576698