| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "chrome/browser/tracing/background_tracing_field_trial.h" | 5 #include "chrome/browser/tracing/background_tracing_field_trial.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
| 10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 const scoped_refptr<base::RefCountedString>& file_contents, | 39 const scoped_refptr<base::RefCountedString>& file_contents, |
| 40 scoped_ptr<base::DictionaryValue> metadata, | 40 scoped_ptr<base::DictionaryValue> metadata, |
| 41 base::Closure callback) { | 41 base::Closure callback) { |
| 42 TraceCrashServiceUploader* uploader = new TraceCrashServiceUploader( | 42 TraceCrashServiceUploader* uploader = new TraceCrashServiceUploader( |
| 43 g_browser_process->system_request_context()); | 43 g_browser_process->system_request_context()); |
| 44 | 44 |
| 45 if (GURL(upload_url).is_valid()) | 45 if (GURL(upload_url).is_valid()) |
| 46 uploader->SetUploadURL(upload_url); | 46 uploader->SetUploadURL(upload_url); |
| 47 | 47 |
| 48 uploader->DoUpload( | 48 uploader->DoUpload( |
| 49 file_contents->data(), metadata.Pass(), | 49 file_contents->data(), false, metadata.Pass(), |
| 50 content::TraceUploader::UploadProgressCallback(), | 50 content::TraceUploader::UploadProgressCallback(), |
| 51 base::Bind(&OnUploadComplete, base::Owned(uploader), callback)); | 51 base::Bind(&OnUploadComplete, base::Owned(uploader), callback)); |
| 52 } | 52 } |
| 53 | 53 |
| 54 } // namespace | 54 } // namespace |
| 55 | 55 |
| 56 void SetConfigTextFilterForTesting(ConfigTextFilterForTesting predicate) { | 56 void SetConfigTextFilterForTesting(ConfigTextFilterForTesting predicate) { |
| 57 g_config_text_filter_for_testing = predicate; | 57 g_config_text_filter_for_testing = predicate; |
| 58 } | 58 } |
| 59 | 59 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 81 content::BackgroundTracingConfig::FromDict(dict); | 81 content::BackgroundTracingConfig::FromDict(dict); |
| 82 if (!config) | 82 if (!config) |
| 83 return; | 83 return; |
| 84 | 84 |
| 85 content::BackgroundTracingManager::GetInstance()->SetActiveScenario( | 85 content::BackgroundTracingManager::GetInstance()->SetActiveScenario( |
| 86 config.Pass(), base::Bind(&UploadCallback, upload_url), | 86 config.Pass(), base::Bind(&UploadCallback, upload_url), |
| 87 content::BackgroundTracingManager::ANONYMIZE_DATA); | 87 content::BackgroundTracingManager::ANONYMIZE_DATA); |
| 88 } | 88 } |
| 89 | 89 |
| 90 } // namespace tracing | 90 } // namespace tracing |
| OLD | NEW |