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

Unified Diff: content/browser/loader/loader_test_service_impl.h

Issue 1461283002: [DO NOT COMMIT] mojo datapipe performance measurement Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 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: content/browser/loader/loader_test_service_impl.h
diff --git a/content/browser/loader/loader_test_service_impl.h b/content/browser/loader/loader_test_service_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..789414a70bf260e28b4fb40fe2dc7ace5b6a0d61
--- /dev/null
+++ b/content/browser/loader/loader_test_service_impl.h
@@ -0,0 +1,53 @@
+// Copyright 2015 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.
+
+#include <unordered_map>
+
+#include "base/callback.h"
+#include "base/macros.h"
+#include "base/memory/scoped_ptr.h"
+#include "content/common/loader_test.mojom.h"
+#include "mojo/public/cpp/bindings/binding.h"
+
+#ifndef CONTENT_BROWSER_LOADER_LOADER_SERVICE_IMPL_H_
+#define CONTENT_BROWSER_LOADER_LOADER_SERVICE_IMPL_H_
+
+namespace content {
+
+class LoaderTestServiceContext;
+
+// Implements the LoaderTestService Mojo interface.
+class LoaderTestServiceImpl final : public LoaderTestService {
+ public:
+ // |context| must outlive this object. |update_callback| will be called when
+ // location updates are sent, allowing the client to know when the service
+ // is being used.
+ LoaderTestServiceImpl(mojo::InterfaceRequest<LoaderTestService> request,
+ LoaderTestServiceContext* context);
+ ~LoaderTestServiceImpl() override;
+
+ private:
+ class Job;
+ void OnConnectionError();
+
+ // LoaderTestService:
+ void Transmit(mojo::ScopedDataPipeConsumerHandle pipe,
+ const TransmitCallback& callback) override;
+ void Hash(mojo::ScopedDataPipeConsumerHandle pipe,
+ const HashCallback& callback) override;
+
+ void DeleteJob(int id);
+
+ mojo::Binding<LoaderTestService> binding_;
+ // Owns this.
+ LoaderTestServiceContext* context_;
+ int job_id_;
+ std::unordered_map<int, scoped_ptr<Job>> jobs_;
+
+ DISALLOW_COPY_AND_ASSIGN(LoaderTestServiceImpl);
+};
+
+} // namespace content
+
+#endif // CONTENT_LOADER_LOADER_SERVICE_IMPL_H_
« no previous file with comments | « content/browser/loader/loader_test_service_context.cc ('k') | content/browser/loader/loader_test_service_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698