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

Side by Side Diff: chrome/browser/media/webrtc_log_uploader.cc

Issue 1117703002: Adjust URLFetcher::Create API so that object is returned as scoped_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unneeded Pass() calls Created 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/media/webrtc_log_uploader.h" 5 #include "chrome/browser/media/webrtc_log_uploader.h"
6 6
7 #include "base/files/file_enumerator.h" 7 #include "base/files/file_enumerator.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 DCHECK(create_thread_checker_.CalledOnValidThread()); 442 DCHECK(create_thread_checker_.CalledOnValidThread());
443 443
444 if (shutting_down_) 444 if (shutting_down_)
445 return; 445 return;
446 446
447 std::string content_type = kUploadContentType; 447 std::string content_type = kUploadContentType;
448 content_type.append("; boundary="); 448 content_type.append("; boundary=");
449 content_type.append(kMultipartBoundary); 449 content_type.append(kMultipartBoundary);
450 450
451 net::URLFetcher* url_fetcher = 451 net::URLFetcher* url_fetcher =
452 net::URLFetcher::Create(GURL(chrome::kUploadURL), 452 net::URLFetcher::Create(GURL(chrome::kUploadURL), net::URLFetcher::POST,
453 net::URLFetcher::POST, this); 453 this).release();
454 url_fetcher->SetRequestContext(g_browser_process->system_request_context()); 454 url_fetcher->SetRequestContext(g_browser_process->system_request_context());
455 url_fetcher->SetUploadData(content_type, *post_data); 455 url_fetcher->SetUploadData(content_type, *post_data);
456 url_fetcher->Start(); 456 url_fetcher->Start();
457 upload_done_data_[url_fetcher] = upload_done_data; 457 upload_done_data_[url_fetcher] = upload_done_data;
458 } 458 }
459 459
460 void WebRtcLogUploader::DecreaseLogCount() { 460 void WebRtcLogUploader::DecreaseLogCount() {
461 DCHECK(create_thread_checker_.CalledOnValidThread()); 461 DCHECK(create_thread_checker_.CalledOnValidThread());
462 --log_count_; 462 --log_count_;
463 } 463 }
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
565 if (!success) { 565 if (!success) {
566 error_message = "Uploading failed, response code: " + 566 error_message = "Uploading failed, response code: " +
567 base::IntToString(response_code); 567 base::IntToString(response_code);
568 } 568 }
569 content::BrowserThread::PostTask( 569 content::BrowserThread::PostTask(
570 content::BrowserThread::UI, FROM_HERE, 570 content::BrowserThread::UI, FROM_HERE,
571 base::Bind(upload_done_data.callback, success, report_id, 571 base::Bind(upload_done_data.callback, success, report_id,
572 error_message)); 572 error_message));
573 } 573 }
574 } 574 }
OLDNEW
« no previous file with comments | « chrome/browser/local_discovery/privet_url_fetcher.cc ('k') | chrome/browser/metrics/variations/variations_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698