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

Side by Side 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, 10 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_BROWSER_PROCESS_RESOURCE_IMPL_H_
6 #define CONTENT_BROWSER_PROCESS_RESOURCE_IMPL_H_
7
8 #include "base/basictypes.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "base/synchronization/lock.h"
11 #include "content/public/common/process_resource_service.mojom.h"
12 #include "content/public/browser/process_resource.h"
13
14 namespace content {
15
16 // This class lives on the IO thread.
17 class CONTENT_EXPORT ProcessResourceImpl : public ProcessResource {
18 public:
19 explicit ProcessResourceImpl(ProcessResourceServicePtr service);
20
21 // ProcessResource implementation. Call from any thread.
22 void Refresh() override;
23 bool ReportsV8MemoryStats() const override;
24 size_t GetV8MemoryAllocated() const override;
25 size_t GetV8MemoryUsed() const override;
26
27 private:
28 ~ProcessResourceImpl() override;
29
30 // Run on IO thread.
31 void RefreshOnIOThread();
32 void OnGetResourceDataDone(ResourceDataPtr data);
33
34 // Always accessed on IO thread.
35 ProcessResourceServicePtr service_;
36 bool update_in_progress_;
37
38 // Accessed on any thread.
39 mutable base::Lock lock_;
40 ResourceDataPtr stats_;
41
42 DISALLOW_COPY_AND_ASSIGN(ProcessResourceImpl);
43 };
44
45 } // namespace content
46
47 #endif // CONTENT_BROWSER_PROCESS_RESOURCE_IMPL_H_
OLDNEW
« 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