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

Side by Side Diff: chrome/tools/test/image_diff/image_diff.cc

Issue 3105: Enforce Terminate on Heap Corruption in most of our executable on Windows XP ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 3 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 | « chrome/tools/profiles/generate_profile.cc ('k') | net/tools/tld_cleanup/tld_cleanup.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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 // This file input format is based loosely on 5 // This file input format is based loosely on
6 // WebKitTools/DumpRenderTree/ImageDiff.m 6 // WebKitTools/DumpRenderTree/ImageDiff.m
7 7
8 // The exact format of this tool's output to stdout is important, to match 8 // The exact format of this tool's output to stdout is important, to match
9 // what the run-webkit-tests script expects. 9 // what the run-webkit-tests script expects.
10 10
11 #include <algorithm> 11 #include <algorithm>
12 #include <vector> 12 #include <vector>
13 13
14 #include "base/basictypes.h" 14 #include "base/basictypes.h"
15 #include "base/command_line.h" 15 #include "base/command_line.h"
16 #include "base/gfx/png_decoder.h" 16 #include "base/gfx/png_decoder.h"
17 #include "base/logging.h" 17 #include "base/logging.h"
18 #include "base/process_util.h"
18 #include "base/scoped_ptr.h" 19 #include "base/scoped_ptr.h"
19 20
20 // Causes the app to remain open, waiting for pairs of filenames on stdin. 21 // Causes the app to remain open, waiting for pairs of filenames on stdin.
21 // The caller is then responsible for terminating this app. 22 // The caller is then responsible for terminating this app.
22 static const wchar_t kOptionPollStdin[] = L"use-stdin"; 23 static const wchar_t kOptionPollStdin[] = L"use-stdin";
23 24
24 // Return codes used by this utility. 25 // Return codes used by this utility.
25 static const int kStatusSame = 0; 26 static const int kStatusSame = 0;
26 static const int kStatusDifferent = 1; 27 static const int kStatusDifferent = 1;
27 static const int kStatusError = 2; 28 static const int kStatusError = 2;
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 actual_image.Clear(); 222 actual_image.Clear();
222 baseline_image.Clear(); 223 baseline_image.Clear();
223 } 224 }
224 225
225 fflush(stdout); 226 fflush(stdout);
226 } 227 }
227 */ 228 */
228 } 229 }
229 230
230 int main(int argc, const char* argv[]) { 231 int main(int argc, const char* argv[]) {
232 process_util::EnableTerminationOnHeapCorruption();
231 CommandLine parsed_command_line; 233 CommandLine parsed_command_line;
232 if (parsed_command_line.HasSwitch(kOptionPollStdin)) { 234 if (parsed_command_line.HasSwitch(kOptionPollStdin)) {
233 // Watch stdin for filenames. 235 // Watch stdin for filenames.
234 char stdin_buffer[2048]; 236 char stdin_buffer[2048];
235 char filename1_buffer[2048]; 237 char filename1_buffer[2048];
236 bool have_filename1 = false; 238 bool have_filename1 = false;
237 while (fgets(stdin_buffer, sizeof(stdin_buffer), stdin)) { 239 while (fgets(stdin_buffer, sizeof(stdin_buffer), stdin)) {
238 char *newLine = strchr(stdin_buffer, '\n'); 240 char *newLine = strchr(stdin_buffer, '\n');
239 if (newLine) 241 if (newLine)
240 *newLine = '\0'; 242 *newLine = '\0';
(...skipping 17 matching lines...) Expand all
258 } 260 }
259 261
260 if (argc == 3) { 262 if (argc == 3) {
261 return CompareImages(argv[1], argv[2]); 263 return CompareImages(argv[1], argv[2]);
262 } 264 }
263 265
264 PrintHelp(); 266 PrintHelp();
265 return kStatusError; 267 return kStatusError;
266 } 268 }
267 269
OLDNEW
« no previous file with comments | « chrome/tools/profiles/generate_profile.cc ('k') | net/tools/tld_cleanup/tld_cleanup.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698