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

Unified Diff: content/browser/process_resource_impl.h

Issue 862813002: WIP: Prototype OOP V8 PAC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Slight cleanup and report JS memory usage. Created 5 years, 11 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
« no previous file with comments | « content/browser/browser_child_process_host_impl.cc ('k') | content/browser/process_resource_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/process_resource_impl.h
diff --git a/content/browser/process_resource_impl.h b/content/browser/process_resource_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..9f7c2dc329f9cfceaab9fc04f5c8cfc8c625f9b3
--- /dev/null
+++ b/content/browser/process_resource_impl.h
@@ -0,0 +1,47 @@
+// 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.
+
+#ifndef CONTENT_BROWSER_PROCESS_RESOURCE_IMPL_H_
+#define CONTENT_BROWSER_PROCESS_RESOURCE_IMPL_H_
+
+#include "base/basictypes.h"
+#include "base/memory/scoped_ptr.h"
+#include "base/synchronization/lock.h"
+#include "content/public/common/process_resource_service.mojom.h"
+#include "content/public/browser/process_resource.h"
+
+namespace content {
+
+// This class lives on the IO thread.
+class CONTENT_EXPORT ProcessResourceImpl : public ProcessResource {
+ public:
+ explicit ProcessResourceImpl(ProcessResourceServicePtr service);
+
+ // ProcessResource implementation. Call from any thread.
+ void Refresh() override;
+ bool ReportsV8MemoryStats() const override;
+ size_t GetV8MemoryAllocated() const override;
+ size_t GetV8MemoryUsed() const override;
+
+ private:
+ ~ProcessResourceImpl() override;
+
+ // Run on IO thread.
+ void RefreshOnIOThread();
+ void OnGetResourceDataDone(ResourceDataPtr data);
+
+ // Always accessed on IO thread.
+ ProcessResourceServicePtr service_;
+ bool update_in_progress_;
+
+ // Accessed on any thread.
+ mutable base::Lock lock_;
+ ResourceDataPtr stats_;
+
+ DISALLOW_COPY_AND_ASSIGN(ProcessResourceImpl);
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_PROCESS_RESOURCE_IMPL_H_
« no previous file with comments | « content/browser/browser_child_process_host_impl.cc ('k') | content/browser/process_resource_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698