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

Side by Side Diff: sandbox/win/src/broker_services.cc

Issue 319573006: Add sandbox support for process memory limits (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: feedback 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/common/sandbox_win.cc ('k') | sandbox/win/src/job.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "sandbox/win/src/broker_services.h" 5 #include "sandbox/win/src/broker_services.h"
6 6
7 #include <AclAPI.h> 7 #include <AclAPI.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 ::SetEvent(no_targets); 271 ::SetEvent(no_targets);
272 272
273 DCHECK(target_counter >= 0); 273 DCHECK(target_counter >= 0);
274 break; 274 break;
275 } 275 }
276 276
277 case JOB_OBJECT_MSG_ACTIVE_PROCESS_LIMIT: { 277 case JOB_OBJECT_MSG_ACTIVE_PROCESS_LIMIT: {
278 break; 278 break;
279 } 279 }
280 280
281 case JOB_OBJECT_MSG_PROCESS_MEMORY_LIMIT: {
282 BOOL res = ::TerminateJobObject(tracker->job,
ananta 2014/06/07 01:09:17 Alignment seems off here.
jschuh 2014/06/07 03:00:50 Done.
283 SBOX_FATAL_MEMORY_EXCEEDED);
284 DCHECK(res);
285 break;
286 }
287
281 default: { 288 default: {
282 NOTREACHED(); 289 NOTREACHED();
283 break; 290 break;
284 } 291 }
285 } 292 }
286 } else if (THREAD_CTRL_REMOVE_PEER == key) { 293 } else if (THREAD_CTRL_REMOVE_PEER == key) {
287 // Remove a process from our list of peers. 294 // Remove a process from our list of peers.
288 AutoLock lock(&broker->lock_); 295 AutoLock lock(&broker->lock_);
289 PeerTrackerMap::iterator it = 296 PeerTrackerMap::iterator it =
290 broker->peer_map_.find(reinterpret_cast<DWORD>(ovl)); 297 broker->peer_map_.find(reinterpret_cast<DWORD>(ovl));
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 return SBOX_ERROR_UNSUPPORTED; 565 return SBOX_ERROR_UNSUPPORTED;
559 566
560 base::string16 name = LookupAppContainer(sid); 567 base::string16 name = LookupAppContainer(sid);
561 if (name.empty()) 568 if (name.empty())
562 return SBOX_ERROR_INVALID_APP_CONTAINER; 569 return SBOX_ERROR_INVALID_APP_CONTAINER;
563 570
564 return DeleteAppContainer(sid); 571 return DeleteAppContainer(sid);
565 } 572 }
566 573
567 } // namespace sandbox 574 } // namespace sandbox
OLDNEW
« no previous file with comments | « content/common/sandbox_win.cc ('k') | sandbox/win/src/job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698