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

Side by Side Diff: components/feedback/feedback_uploader_chrome.cc

Issue 774933004: Prefix CommandLine usage with base namespace (Part 9: components) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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
« no previous file with comments | « no previous file | components/gcm_driver/gcm_channel_status_syncer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "components/feedback/feedback_uploader_chrome.h" 5 #include "components/feedback/feedback_uploader_chrome.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/task_runner_util.h" 10 #include "base/task_runner_util.h"
(...skipping 15 matching lines...) Expand all
26 const char kProtoBufMimeType[] = "application/x-protobuf"; 26 const char kProtoBufMimeType[] = "application/x-protobuf";
27 27
28 } // namespace 28 } // namespace
29 29
30 FeedbackUploaderChrome::FeedbackUploaderChrome( 30 FeedbackUploaderChrome::FeedbackUploaderChrome(
31 content::BrowserContext* context) 31 content::BrowserContext* context)
32 : FeedbackUploader(context ? context->GetPath() : base::FilePath(), 32 : FeedbackUploader(context ? context->GetPath() : base::FilePath(),
33 BrowserThread::GetBlockingPool()), 33 BrowserThread::GetBlockingPool()),
34 context_(context) { 34 context_(context) {
35 CHECK(context_); 35 CHECK(context_);
36 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kFeedbackServer)) 36 const base::CommandLine& command_line =
37 url_ = CommandLine::ForCurrentProcess()->GetSwitchValueASCII( 37 *base::CommandLine::ForCurrentProcess();
38 switches::kFeedbackServer); 38 if (command_line.HasSwitch(switches::kFeedbackServer))
39 url_ = command_line.GetSwitchValueASCII(switches::kFeedbackServer);
39 } 40 }
40 41
41 void FeedbackUploaderChrome::DispatchReport(const std::string& data) { 42 void FeedbackUploaderChrome::DispatchReport(const std::string& data) {
42 GURL post_url(url_); 43 GURL post_url(url_);
43 44
44 net::URLFetcher* fetcher = net::URLFetcher::Create( 45 net::URLFetcher* fetcher = net::URLFetcher::Create(
45 post_url, net::URLFetcher::POST, 46 post_url, net::URLFetcher::POST,
46 new FeedbackUploaderDelegate( 47 new FeedbackUploaderDelegate(
47 data, 48 data,
48 base::Bind(&FeedbackUploaderChrome::UpdateUploadTimer, AsWeakPtr()), 49 base::Bind(&FeedbackUploaderChrome::UpdateUploadTimer, AsWeakPtr()),
49 base::Bind(&FeedbackUploaderChrome::RetryReport, AsWeakPtr()))); 50 base::Bind(&FeedbackUploaderChrome::RetryReport, AsWeakPtr())));
50 51
51 fetcher->SetUploadData(std::string(kProtoBufMimeType), data); 52 fetcher->SetUploadData(std::string(kProtoBufMimeType), data);
52 fetcher->SetRequestContext(context_->GetRequestContext()); 53 fetcher->SetRequestContext(context_->GetRequestContext());
53 fetcher->SetLoadFlags(net::LOAD_DO_NOT_SAVE_COOKIES | 54 fetcher->SetLoadFlags(net::LOAD_DO_NOT_SAVE_COOKIES |
54 net::LOAD_DO_NOT_SEND_COOKIES); 55 net::LOAD_DO_NOT_SEND_COOKIES);
55 fetcher->Start(); 56 fetcher->Start();
56 } 57 }
57 58
58 } // namespace feedback 59 } // namespace feedback
OLDNEW
« no previous file with comments | « no previous file | components/gcm_driver/gcm_channel_status_syncer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698