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

Side by Side Diff: mojo/shell/package_manager/content_handler_unittest.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
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 <stdint.h> 5 #include <stdint.h>
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/at_exit.h" 9 #include "base/at_exit.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 ~TestPackageManagerImpl() override {} 139 ~TestPackageManagerImpl() override {}
140 140
141 void set_mime_type(const std::string& mime_type) { 141 void set_mime_type(const std::string& mime_type) {
142 mime_type_ = mime_type; 142 mime_type_ = mime_type;
143 } 143 }
144 144
145 // PackageManagerImpl: 145 // PackageManagerImpl:
146 void FetchRequest( 146 void FetchRequest(
147 URLRequestPtr request, 147 URLRequestPtr request,
148 const Fetcher::FetchCallback& loader_callback) override { 148 const Fetcher::FetchCallback& loader_callback) override {
149 new TestFetcher(loader_callback, GURL(request->url), mime_type_); 149 new TestFetcher(loader_callback, GURL(request->url.get()), mime_type_);
150 } 150 }
151 151
152 private: 152 private:
153 std::string mime_type_; 153 std::string mime_type_;
154 154
155 DISALLOW_COPY_AND_ASSIGN(TestPackageManagerImpl); 155 DISALLOW_COPY_AND_ASSIGN(TestPackageManagerImpl);
156 }; 156 };
157 157
158 } // namespace 158 } // namespace
159 159
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 params->SetTargetURL(GURL("test:test")); 315 params->SetTargetURL(GURL("test:test"));
316 params->set_connect_callback( 316 params->set_connect_callback(
317 [&content_handler_id](uint32_t t) { content_handler_id = t; }); 317 [&content_handler_id](uint32_t t) { content_handler_id = t; });
318 application_manager_->ConnectToApplication(std::move(params)); 318 application_manager_->ConnectToApplication(std::move(params));
319 EXPECT_EQ(0u, content_handler_id); 319 EXPECT_EQ(0u, content_handler_id);
320 } 320 }
321 321
322 } // namespace test 322 } // namespace test
323 } // namespace package_manager 323 } // namespace package_manager
324 } // namespace mojo 324 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698