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

Unified Diff: chrome/app/breakpad_field_trial_win.cc

Issue 10411059: Don't pass class types across EXE/DLL boundaries for SetCommandLine() and SetExperimentList(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix typos Created 8 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/app/breakpad_win.h » ('j') | chrome/app/breakpad_win.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/app/breakpad_field_trial_win.cc
diff --git a/chrome/app/breakpad_field_trial_win.cc b/chrome/app/breakpad_field_trial_win.cc
index f8b04265b84a8c37f00da950bf8b6b0c9a6ab1be..a0dc54457c1a2d61d2edcd52a39c391646e87d49 100644
--- a/chrome/app/breakpad_field_trial_win.cc
+++ b/chrome/app/breakpad_field_trial_win.cc
@@ -13,7 +13,7 @@
#include "chrome/common/child_process_logging.h"
extern "C" void __declspec(dllexport) __cdecl SetExperimentList(
- const std::vector<string16>& experiment_strings) {
+ const wchar_t** experiment_strings, size_t experiment_strings_size) {
// Make sure we were initialized before we start writing data
if (breakpad_win::g_experiment_chunks_offset == 0)
return;
@@ -21,11 +21,11 @@ extern "C" void __declspec(dllexport) __cdecl SetExperimentList(
size_t num_chunks = 0;
size_t current_experiment = 0;
string16 current_chunk(google_breakpad::CustomInfoEntry::kValueMaxLength, 0);
- while (current_experiment < experiment_strings.size() &&
+ while (current_experiment < experiment_strings_size &&
num_chunks < kMaxReportedExperimentChunks) {
// Check if we have enough room to add another experiment to the current
// chunk string. If not, we commit the current chunk string and start over.
- if (current_chunk.size() + experiment_strings[current_experiment].size() >
+ if (current_chunk.size() + wcslen(experiment_strings[current_experiment]) >
google_breakpad::CustomInfoEntry::kValueMaxLength) {
base::wcslcpy(
(*breakpad_win::g_custom_entries)[
@@ -58,14 +58,17 @@ extern "C" void __declspec(dllexport) __cdecl SetExperimentList(
base::wcslcpy(
(*breakpad_win::g_custom_entries)[
breakpad_win::g_num_of_experiments_offset].value,
- base::StringPrintf(L"%d", experiment_strings.size()).c_str(),
+ base::StringPrintf(
+ L"%d", static_cast<int>(experiment_strings_size)).c_str(),
google_breakpad::CustomInfoEntry::kValueMaxLength);
}
namespace testing {
void SetExperimentList(const std::vector<string16>& experiment_strings) {
- ::SetExperimentList(experiment_strings);
+ std::vector<const wchar_t*> cstrings;
+ StringVectorToCStringVector(experiment_strings, &cstrings);
+ ::SetExperimentList(&cstrings[0], cstrings.size());
}
} // namespace testing
« no previous file with comments | « no previous file | chrome/app/breakpad_win.h » ('j') | chrome/app/breakpad_win.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698