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

Unified Diff: components/memory_coordinator/browser/memory_coordinator.cc

Issue 2143353004: Revert of Add MemoryCoordinator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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/memory_coordinator/browser/memory_coordinator.cc
diff --git a/components/memory_coordinator/browser/memory_coordinator.cc b/components/memory_coordinator/browser/memory_coordinator.cc
deleted file mode 100644
index 101426f828009212bbe48d04334377d3dc63eeb0..0000000000000000000000000000000000000000
--- a/components/memory_coordinator/browser/memory_coordinator.cc
+++ /dev/null
@@ -1,56 +0,0 @@
-// 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.
-
-#include "components/memory_coordinator/browser/memory_coordinator.h"
-
-namespace memory_coordinator {
-
-// The implementation of MemoryCoordinatorHandle. See memory_coordinator.mojom
-// for the role of this class.
-class MemoryCoordinatorHandleImpl : public mojom::MemoryCoordinatorHandle {
- public:
- MemoryCoordinatorHandleImpl(mojom::MemoryCoordinatorHandleRequest request)
- : binding_(this, std::move(request)) {
- }
-
- // mojom::MemoryCoordinatorHandle implementations:
-
- void AddChild(mojom::ChildMemoryCoordinatorPtr child) override {
- DCHECK(!child_.is_bound());
- child_ = std::move(child);
- }
-
- mojom::ChildMemoryCoordinatorPtr& child() { return child_; }
- mojo::Binding<mojom::MemoryCoordinatorHandle>& binding() { return binding_; }
-
- private:
- mojom::ChildMemoryCoordinatorPtr child_;
- mojo::Binding<mojom::MemoryCoordinatorHandle> binding_;
-
- DISALLOW_COPY_AND_ASSIGN(MemoryCoordinatorHandleImpl);
-};
-
-MemoryCoordinator::MemoryCoordinator() {}
-
-MemoryCoordinator::~MemoryCoordinator() {}
-
-void MemoryCoordinator::CreateHandle(
- int render_process_id,
- mojom::MemoryCoordinatorHandleRequest request) {
- auto handle = new MemoryCoordinatorHandleImpl(std::move(request));
- handle->binding().set_connection_error_handler(
- base::Bind(&MemoryCoordinator::OnConnectionError, base::Unretained(this),
- render_process_id));
- children_[render_process_id].reset(handle);
-}
-
-size_t MemoryCoordinator::NumChildrenForTesting() {
- return children_.size();
-}
-
-void MemoryCoordinator::OnConnectionError(int render_process_id) {
- children_.erase(render_process_id);
-}
-
-} // namespace memory_coordinator
« no previous file with comments | « components/memory_coordinator/browser/memory_coordinator.h ('k') | components/memory_coordinator/child/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698