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

Side by Side Diff: components/copresence/rpc/rpc_handler.cc

Issue 818103002: Make callers of CommandLine use it via the base:: namespace. (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
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/copresence/rpc/rpc_handler.h" 5 #include "components/copresence/rpc/rpc_handler.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/guid.h" 9 #include "base/guid.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after
615 response_handler); 615 response_handler);
616 } 616 }
617 617
618 void RpcHandler::SendHttpPost(net::URLRequestContextGetter* url_context_getter, 618 void RpcHandler::SendHttpPost(net::URLRequestContextGetter* url_context_getter,
619 const std::string& rpc_name, 619 const std::string& rpc_name,
620 const std::string& api_key, 620 const std::string& api_key,
621 const std::string& auth_token, 621 const std::string& auth_token,
622 scoped_ptr<MessageLite> request_proto, 622 scoped_ptr<MessageLite> request_proto,
623 const PostCleanupCallback& callback) { 623 const PostCleanupCallback& callback) {
624 // Create the base URL to call. 624 // Create the base URL to call.
625 CommandLine* command_line = CommandLine::ForCurrentProcess(); 625 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
626 const std::string copresence_server_host = 626 const std::string copresence_server_host =
627 command_line->HasSwitch(switches::kCopresenceServer) ? 627 command_line->HasSwitch(switches::kCopresenceServer) ?
628 command_line->GetSwitchValueASCII(switches::kCopresenceServer) : 628 command_line->GetSwitchValueASCII(switches::kCopresenceServer) :
629 kDefaultCopresenceServer; 629 kDefaultCopresenceServer;
630 630
631 // Create the request and keep a pointer until it completes. 631 // Create the request and keep a pointer until it completes.
632 HttpPost* http_post = new HttpPost( 632 HttpPost* http_post = new HttpPost(
633 url_context_getter, 633 url_context_getter,
634 copresence_server_host, 634 copresence_server_host,
635 rpc_name, 635 rpc_name,
636 api_key, 636 api_key,
637 auth_token, 637 auth_token,
638 command_line->GetSwitchValueASCII(switches::kCopresenceTracingToken), 638 command_line->GetSwitchValueASCII(switches::kCopresenceTracingToken),
639 *request_proto); 639 *request_proto);
640 640
641 http_post->Start(base::Bind(callback, http_post)); 641 http_post->Start(base::Bind(callback, http_post));
642 pending_posts_.insert(http_post); 642 pending_posts_.insert(http_post);
643 } 643 }
644 644
645 } // namespace copresence 645 } // namespace copresence
OLDNEW
« no previous file with comments | « components/autofill/core/browser/autofill_manager.cc ('k') | components/password_manager/core/browser/password_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698