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

Side by Side Diff: mojo/shell/connect_to_application_params.cc

Issue 1568073002: Reduce string copies in GURL creation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
« no previous file with comments | « mojo/shell/application_instance.cc ('k') | mojo/shell/fetcher/network_fetcher.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 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 "mojo/shell/connect_to_application_params.h" 5 #include "mojo/shell/connect_to_application_params.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "mojo/shell/application_instance.h" 9 #include "mojo/shell/application_instance.h"
10 10
(...skipping 19 matching lines...) Expand all
30 target_url_request_->url = target_.url().spec(); 30 target_url_request_->url = target_.url().spec();
31 } 31 }
32 32
33 void ConnectToApplicationParams::SetTargetURL(const GURL& target_url) { 33 void ConnectToApplicationParams::SetTargetURL(const GURL& target_url) {
34 target_ = Identity(target_url, target_.qualifier(), target_.filter()); 34 target_ = Identity(target_url, target_.qualifier(), target_.filter());
35 target_url_request_ = URLRequest::New(); 35 target_url_request_ = URLRequest::New();
36 target_url_request_->url = target_.url().spec(); 36 target_url_request_->url = target_.url().spec();
37 } 37 }
38 38
39 void ConnectToApplicationParams::SetTargetURLRequest(URLRequestPtr request) { 39 void ConnectToApplicationParams::SetTargetURLRequest(URLRequestPtr request) {
40 Identity target = request ? Identity(GURL(request->url), target_.qualifier(), 40 Identity target = request ? Identity(GURL(request->url.get()),
41 target_.filter()) 41 target_.qualifier(), target_.filter())
42 : Identity(); 42 : Identity();
43 SetTargetURLRequest(std::move(request), target); 43 SetTargetURLRequest(std::move(request), target);
44 } 44 }
45 45
46 void ConnectToApplicationParams::SetTargetURLRequest(URLRequestPtr request, 46 void ConnectToApplicationParams::SetTargetURLRequest(URLRequestPtr request,
47 const Identity& target) { 47 const Identity& target) {
48 target_url_request_ = std::move(request); 48 target_url_request_ = std::move(request);
49 target_ = target; 49 target_ = target;
50 } 50 }
51 51
52 } // namespace shell 52 } // namespace shell
53 } // namespace mojo 53 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/shell/application_instance.cc ('k') | mojo/shell/fetcher/network_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698