| OLD | NEW |
| 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 #ifndef CHROME_COMMON_CHILD_PROCESS_LOGGING_H_ | 5 #ifndef CHROME_COMMON_CHILD_PROCESS_LOGGING_H_ |
| 6 #define CHROME_COMMON_CHILD_PROCESS_LOGGING_H_ | 6 #define CHROME_COMMON_CHILD_PROCESS_LOGGING_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| 11 | 11 |
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/mac/crash_logging.h" | 13 #include "base/mac/crash_logging.h" |
| 14 #include "googleurl/src/gurl.h" | 14 #include "googleurl/src/gurl.h" |
| 15 | 15 |
| 16 class CommandLine; | 16 class CommandLine; |
| 17 | 17 |
| 18 namespace content { | 18 namespace content { |
| 19 struct GPUInfo; | 19 struct GPUInfo; |
| 20 } | 20 } |
| 21 | 21 |
| 22 // The maximum number of active extensions we will report. | 22 // The maximum number of active extensions we will report. |
| 23 // Also used in chrome/app, but we define it here to avoid a common->app | 23 // Also used in chrome/app, but we define it here to avoid a common->app |
| 24 // dependency. | 24 // dependency. |
| 25 static const int kMaxReportedActiveExtensions = 10; | 25 static const int kMaxReportedActiveExtensions = 10; |
| 26 | 26 |
| 27 // The maximum number of experiment chunks we will report. |
| 28 // Also used in chrome/app, but we define it here to avoid a common->app |
| 29 // dependency. |
| 30 static const int kMaxReportedExperimentChunks = 15; |
| 31 |
| 27 // The maximum number of command line switches to include in the crash | 32 // The maximum number of command line switches to include in the crash |
| 28 // report's metadata. Note that the mini-dump itself will also contain the | 33 // report's metadata. Note that the mini-dump itself will also contain the |
| 29 // (original) command line arguments within the PEB. | 34 // (original) command line arguments within the PEB. |
| 30 // Also used in chrome/app, but we define it here to avoid a common->app | 35 // Also used in chrome/app, but we define it here to avoid a common->app |
| 31 // dependency. | 36 // dependency. |
| 32 static const size_t kMaxSwitches = 15; | 37 static const size_t kMaxSwitches = 15; |
| 33 | 38 |
| 34 namespace child_process_logging { | 39 namespace child_process_logging { |
| 35 | 40 |
| 36 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 41 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 // Sets a number of views/tabs opened in this process. | 84 // Sets a number of views/tabs opened in this process. |
| 80 void SetNumberOfViews(int number_of_views); | 85 void SetNumberOfViews(int number_of_views); |
| 81 | 86 |
| 82 // Sets the data on the gpu to send along with crash reports. | 87 // Sets the data on the gpu to send along with crash reports. |
| 83 void SetGpuInfo(const content::GPUInfo& gpu_info); | 88 void SetGpuInfo(const content::GPUInfo& gpu_info); |
| 84 | 89 |
| 85 // Sets the command line arguments to send along with crash reports to the | 90 // Sets the command line arguments to send along with crash reports to the |
| 86 // values in |command_line|. | 91 // values in |command_line|. |
| 87 void SetCommandLine(const CommandLine* command_line); | 92 void SetCommandLine(const CommandLine* command_line); |
| 88 | 93 |
| 94 // Initialize the list of experiment info to send along with crash reports. |
| 95 void InitExperimentList(); |
| 96 |
| 97 // Add a new experiment group info to send along with crash reports. |
| 98 void AddFieldTrialGroup(const std::string& field_trial_name, |
| 99 const std::string& group_name); |
| 100 |
| 89 #if defined(OS_LINUX) || defined(OS_OPENBSD) || defined(OS_MACOSX) | 101 #if defined(OS_LINUX) || defined(OS_OPENBSD) || defined(OS_MACOSX) |
| 90 // Sets the product channel data to send along with crash reports to |channel|. | 102 // Sets the product channel data to send along with crash reports to |channel|. |
| 91 void SetChannel(const std::string& channel); | 103 void SetChannel(const std::string& channel); |
| 92 #endif | 104 #endif |
| 93 | 105 |
| 94 // Simple wrapper class that sets the active URL in it's constructor and clears | 106 // Simple wrapper class that sets the active URL in it's constructor and clears |
| 95 // the active URL in the destructor. | 107 // the active URL in the destructor. |
| 96 class ScopedActiveURLSetter { | 108 class ScopedActiveURLSetter { |
| 97 public: | 109 public: |
| 98 explicit ScopedActiveURLSetter(const GURL& url) { | 110 explicit ScopedActiveURLSetter(const GURL& url) { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 119 | 131 |
| 120 extern const int kMaxNumCrashURLChunks; | 132 extern const int kMaxNumCrashURLChunks; |
| 121 extern const int kMaxNumURLChunkValueLength; | 133 extern const int kMaxNumURLChunkValueLength; |
| 122 extern const char *kUrlChunkFormatStr; | 134 extern const char *kUrlChunkFormatStr; |
| 123 | 135 |
| 124 } // namespace child_process_logging | 136 } // namespace child_process_logging |
| 125 | 137 |
| 126 #endif // defined(OS_MACOSX) | 138 #endif // defined(OS_MACOSX) |
| 127 | 139 |
| 128 #endif // CHROME_COMMON_CHILD_PROCESS_LOGGING_H_ | 140 #endif // CHROME_COMMON_CHILD_PROCESS_LOGGING_H_ |
| OLD | NEW |