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

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

Issue 13888007: Rewrite scoped_array<T> to scoped_ptr<T[]> in sandbox. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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 | « sandbox/win/src/handle_closer.cc ('k') | sandbox/win/src/interception_unittest.cc » ('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 // For information about interceptions as a whole see 5 // For information about interceptions as a whole see
6 // http://dev.chromium.org/developers/design-documents/sandbox . 6 // http://dev.chromium.org/developers/design-documents/sandbox .
7 7
8 #include <set> 8 #include <set>
9 9
10 #include "sandbox/win/src/interception.h" 10 #include "sandbox/win/src/interception.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 113
114 interceptions_.push_back(module_to_unload); 114 interceptions_.push_back(module_to_unload);
115 return true; 115 return true;
116 } 116 }
117 117
118 bool InterceptionManager::InitializeInterceptions() { 118 bool InterceptionManager::InitializeInterceptions() {
119 if (interceptions_.empty()) 119 if (interceptions_.empty())
120 return true; // Nothing to do here 120 return true; // Nothing to do here
121 121
122 size_t buffer_bytes = GetBufferSize(); 122 size_t buffer_bytes = GetBufferSize();
123 scoped_array<char> local_buffer(new char[buffer_bytes]); 123 scoped_ptr<char[]> local_buffer(new char[buffer_bytes]);
124 124
125 if (!SetupConfigBuffer(local_buffer.get(), buffer_bytes)) 125 if (!SetupConfigBuffer(local_buffer.get(), buffer_bytes))
126 return false; 126 return false;
127 127
128 void* remote_buffer; 128 void* remote_buffer;
129 if (!CopyDataToChild(local_buffer.get(), buffer_bytes, &remote_buffer)) 129 if (!CopyDataToChild(local_buffer.get(), buffer_bytes, &remote_buffer))
130 return false; 130 return false;
131 131
132 bool hot_patch_needed = (0 != buffer_bytes); 132 bool hot_patch_needed = (0 != buffer_bytes);
133 if (!PatchNtdll(hot_patch_needed)) 133 if (!PatchNtdll(hot_patch_needed))
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 ::FreeLibrary(local_interceptor); 541 ::FreeLibrary(local_interceptor);
542 #endif 542 #endif
543 543
544 if (it != interceptions_.end()) 544 if (it != interceptions_.end())
545 return false; 545 return false;
546 546
547 return true; 547 return true;
548 } 548 }
549 549
550 } // namespace sandbox 550 } // namespace sandbox
OLDNEW
« no previous file with comments | « sandbox/win/src/handle_closer.cc ('k') | sandbox/win/src/interception_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698