Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(89)

Side by Side Diff: src/client/linux/handler/minidump_descriptor.cc

Issue 452003: Restore dump path setting functionality to Linux ExceptionHandler (Closed)
Patch Set: Created 12 years, 6 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 Google Inc. 1 // Copyright (c) 2012 Google Inc.
2 // All rights reserved. 2 // All rights reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are 5 // modification, are permitted provided that the following conditions are
6 // met: 6 // met:
7 // 7 //
8 // * Redistributions of source code must retain the above copyright 8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer. 9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above 10 // * Redistributions in binary form must reproduce the above
(...skipping 27 matching lines...) Expand all
38 MinidumpDescriptor::MinidumpDescriptor(const MinidumpDescriptor& descriptor) 38 MinidumpDescriptor::MinidumpDescriptor(const MinidumpDescriptor& descriptor)
39 : fd_(descriptor.fd_), 39 : fd_(descriptor.fd_),
40 directory_(descriptor.directory_), 40 directory_(descriptor.directory_),
41 c_path_(NULL) { 41 c_path_(NULL) {
42 // The copy constructor is not allowed to be called on a MinidumpDescriptor 42 // The copy constructor is not allowed to be called on a MinidumpDescriptor
43 // with a valid path_, as getting its c_path_ would require the heap which 43 // with a valid path_, as getting its c_path_ would require the heap which
44 // can cause problems in compromised environments. 44 // can cause problems in compromised environments.
45 assert(descriptor.path_.empty()); 45 assert(descriptor.path_.empty());
46 } 46 }
47 47
48 MinidumpDescriptor& MinidumpDescriptor::operator=(
49 const MinidumpDescriptor& descriptor) {
50 assert(descriptor.path_.empty());
51
52 fd_ = descriptor.fd_;
53 directory_ = descriptor.directory_;
54 path_.clear();
55 c_path_ = NULL;
digit 2012/09/13 15:53:59 Would it make sense to call UpdatePath() here if d
56 return *this;
57 }
58
48 void MinidumpDescriptor::UpdatePath() { 59 void MinidumpDescriptor::UpdatePath() {
49 assert(fd_ == -1 && !directory_.empty()); 60 assert(fd_ == -1 && !directory_.empty());
50 61
51 GUID guid; 62 GUID guid;
52 char guid_str[kGUIDStringLength + 1]; 63 char guid_str[kGUIDStringLength + 1];
53 bool r = CreateGUID(&guid) && GUIDToString(&guid, guid_str, sizeof(guid_str)); 64 bool r = CreateGUID(&guid) && GUIDToString(&guid, guid_str, sizeof(guid_str));
54 assert(r); 65 assert(r);
55 66
56 path_.clear(); 67 path_.clear();
57 path_ = directory_ + "/" + guid_str + ".dmp"; 68 path_ = directory_ + "/" + guid_str + ".dmp";
58 c_path_ = path_.c_str(); 69 c_path_ = path_.c_str();
59 } 70 }
60 71
61 } // namespace google_breakpad 72 } // namespace google_breakpad
OLDNEW
« no previous file with comments | « src/client/linux/handler/exception_handler_unittest.cc ('k') | src/client/linux/handler/minidump_descriptor.h » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld 1004:630ec63f810e-tainted