| 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_
|
|
|