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

Side by Side Diff: chrome/app/breakpad_linux.cc

Issue 115876: Limit Breakpad Linux to 8 url-chunk entries. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 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 | « no previous file | no next file » | 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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 <fcntl.h> 5 #include <fcntl.h>
6 #include <sys/socket.h> 6 #include <sys/socket.h>
7 #include <sys/uio.h> 7 #include <sys/uio.h>
8 #include <unistd.h> 8 #include <unistd.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 iov[18].iov_base = mime_boundary; 197 iov[18].iov_base = mime_boundary;
198 iov[18].iov_len = sizeof(mime_boundary) - 1; 198 iov[18].iov_len = sizeof(mime_boundary) - 1;
199 iov[19].iov_base = const_cast<char*>(rn); 199 iov[19].iov_base = const_cast<char*>(rn);
200 iov[19].iov_len = sizeof(rn); 200 iov[19].iov_len = sizeof(rn);
201 201
202 sys_writev(fd, iov, 20); 202 sys_writev(fd, iov, 20);
203 203
204 if (crash_url_length) { 204 if (crash_url_length) {
205 unsigned i = 0, done = 0; 205 unsigned i = 0, done = 0;
206 static const unsigned kMaxCrashChunkSize = 64; 206 static const unsigned kMaxCrashChunkSize = 64;
207 static const unsigned kMaxUrlLength = 8 * kMaxCrashChunkSize;
208 if (crash_url_length > kMaxUrlLength)
209 crash_url_length = kMaxUrlLength;
207 210
208 while (crash_url_length) { 211 while (crash_url_length) {
209 char num[16]; 212 char num[16];
210 const unsigned num_len = my_int_len(++i); 213 const unsigned num_len = my_int_len(++i);
211 my_itos(num, i, num_len); 214 my_itos(num, i, num_len);
212 215
213 iov[0].iov_base = const_cast<char*>(form_data_msg); 216 iov[0].iov_base = const_cast<char*>(form_data_msg);
214 iov[0].iov_len = sizeof(form_data_msg) - 1; 217 iov[0].iov_len = sizeof(form_data_msg) - 1;
215 iov[1].iov_base = const_cast<char*>(url_chunk_msg); 218 iov[1].iov_base = const_cast<char*>(url_chunk_msg);
216 iov[1].iov_len = sizeof(url_chunk_msg) - 1; 219 iov[1].iov_len = sizeof(url_chunk_msg) - 1;
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 477
475 // Determine the process type and take appropriate action. 478 // Determine the process type and take appropriate action.
476 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); 479 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess();
477 const std::wstring process_type = 480 const std::wstring process_type =
478 parsed_command_line.GetSwitchValue(switches::kProcessType); 481 parsed_command_line.GetSwitchValue(switches::kProcessType);
479 if (process_type.empty()) 482 if (process_type.empty())
480 EnableCrashDumping(); 483 EnableCrashDumping();
481 else if (process_type == switches::kRendererProcess) 484 else if (process_type == switches::kRendererProcess)
482 EnableRendererCrashDumping(); 485 EnableRendererCrashDumping();
483 } 486 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698