Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/crash_service_uploader.h" | 5 #include "chrome/browser/tracing/crash_service_uploader.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| 11 #include "base/files/file_util.h" | 11 #include "base/files/file_util.h" |
| 12 #include "base/format_macros.h" | 12 #include "base/format_macros.h" |
| 13 #include "base/json/json_writer.h" | 13 #include "base/json/json_writer.h" |
| 14 #include "base/strings/string_number_conversions.h" | 14 #include "base/strings/string_number_conversions.h" |
| 15 #include "base/strings/string_split.h" | 15 #include "base/strings/string_split.h" |
| 16 #include "base/strings/string_util.h" | 16 #include "base/strings/string_util.h" |
| 17 #include "base/strings/stringprintf.h" | 17 #include "base/strings/stringprintf.h" |
| 18 #include "base/time/time.h" | 18 #include "base/time/time.h" |
| 19 #include "build/build_config.h" | 19 #include "build/build_config.h" |
| 20 #include "components/data_use_measurement/core/data_use_user_data.h" | |
| 20 #include "components/tracing/common/tracing_switches.h" | 21 #include "components/tracing/common/tracing_switches.h" |
| 21 #include "components/version_info/version_info.h" | 22 #include "components/version_info/version_info.h" |
| 22 #include "content/public/browser/browser_thread.h" | 23 #include "content/public/browser/browser_thread.h" |
| 23 #include "content/public/common/content_switches.h" | 24 #include "content/public/common/content_switches.h" |
| 24 #include "net/base/mime_util.h" | 25 #include "net/base/mime_util.h" |
| 25 #include "net/base/network_delegate.h" | 26 #include "net/base/network_delegate.h" |
| 26 #include "net/proxy/proxy_config.h" | 27 #include "net/proxy/proxy_config.h" |
| 27 #include "net/proxy/proxy_config_service.h" | 28 #include "net/proxy/proxy_config_service.h" |
| 28 #include "net/url_request/url_fetcher.h" | 29 #include "net/url_request/url_fetcher.h" |
| 29 #include "net/url_request/url_request_context.h" | 30 #include "net/url_request/url_request_context.h" |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 303 const std::string& post_data) { | 304 const std::string& post_data) { |
| 304 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 305 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 305 DCHECK(!url_fetcher_.get()); | 306 DCHECK(!url_fetcher_.get()); |
| 306 | 307 |
| 307 std::string content_type = kUploadContentType; | 308 std::string content_type = kUploadContentType; |
| 308 content_type.append("; boundary="); | 309 content_type.append("; boundary="); |
| 309 content_type.append(kMultipartBoundary); | 310 content_type.append(kMultipartBoundary); |
| 310 | 311 |
| 311 url_fetcher_ = | 312 url_fetcher_ = |
| 312 net::URLFetcher::Create(GURL(upload_url), net::URLFetcher::POST, this); | 313 net::URLFetcher::Create(GURL(upload_url), net::URLFetcher::POST, this); |
| 314 data_use_measurement::DataUseUserData::AttachToFetcher( | |
| 315 url_fetcher_.get(), | |
| 316 data_use_measurement::DataUseUserData::TRACING_CRASH_UPLOADER); | |
|
oystein (OOO til 10th of July)
2016/10/14 22:15:59
Yeah as primiano mentioned, I would just call this
| |
| 313 url_fetcher_->SetRequestContext(request_context_); | 317 url_fetcher_->SetRequestContext(request_context_); |
| 314 url_fetcher_->SetUploadData(content_type, post_data); | 318 url_fetcher_->SetUploadData(content_type, post_data); |
| 315 url_fetcher_->Start(); | 319 url_fetcher_->Start(); |
| 316 } | 320 } |
| OLD | NEW |