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

Unified Diff: sandbox/win/src/job.h

Issue 319573006: Add sandbox support for process memory limits (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ready for review Created 6 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: sandbox/win/src/job.h
diff --git a/sandbox/win/src/job.h b/sandbox/win/src/job.h
index 7c215efc8e63f87e97bb12fa7916437c44602d9c..1b107d3b84d6c2499b648a8e4a76318d57898648 100644
--- a/sandbox/win/src/job.h
+++ b/sandbox/win/src/job.h
@@ -17,7 +17,7 @@ namespace sandbox {
// job.AssignProcessToJob(process_handle);
class Job {
public:
- Job() : job_handle_(NULL) { }
+ Job() : job_handle_(NULL), process_memory_limit_(0) { }
~Job();
@@ -33,6 +33,8 @@ class Job {
const wchar_t* job_name,
DWORD ui_exceptions);
+ DWORD SetProcessMemoryLimit(size_t limit);
+
// Assigns the process referenced by process_handle to the job.
// If the function succeeds, the return value is ERROR_SUCCESS. If the
// function fails, the return value is the win32 error code corresponding to
@@ -54,6 +56,8 @@ class Job {
private:
// Handle to the job referenced by the object.
HANDLE job_handle_;
+ // Per-process memory limit for each process in the job.
+ size_t process_memory_limit_;
DISALLOW_COPY_AND_ASSIGN(Job);
};

Powered by Google App Engine
This is Rietveld 408576698