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

Side by Side Diff: headless/lib/browser/headless_browser_context_impl.cc

Issue 2255133002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 | « no previous file | headless/lib/browser/headless_content_browser_client.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 "headless/lib/browser/headless_browser_context_impl.h" 5 #include "headless/lib/browser/headless_browser_context_impl.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 } 375 }
376 DCHECK(options_->protocol_handlers_.find(kHeadlessMojomProtocol) == 376 DCHECK(options_->protocol_handlers_.find(kHeadlessMojomProtocol) ==
377 options_->protocol_handlers_.end()); 377 options_->protocol_handlers_.end());
378 options_->protocol_handlers_[kHeadlessMojomProtocol] = 378 options_->protocol_handlers_[kHeadlessMojomProtocol] =
379 std::move(headless_mojom_protocol_handler); 379 std::move(headless_mojom_protocol_handler);
380 380
381 // Unless you know what you're doing it's unsafe to allow http/https for a 381 // Unless you know what you're doing it's unsafe to allow http/https for a
382 // context with mojo bindings. 382 // context with mojo bindings.
383 if (!enable_http_and_https_if_mojo_used_) { 383 if (!enable_http_and_https_if_mojo_used_) {
384 options_->protocol_handlers_[url::kHttpScheme] = 384 options_->protocol_handlers_[url::kHttpScheme] =
385 base::WrapUnique(new BlackHoleProtocolHandler()); 385 base::MakeUnique<BlackHoleProtocolHandler>();
386 options_->protocol_handlers_[url::kHttpsScheme] = 386 options_->protocol_handlers_[url::kHttpsScheme] =
387 base::WrapUnique(new BlackHoleProtocolHandler()); 387 base::MakeUnique<BlackHoleProtocolHandler>();
388 } 388 }
389 } 389 }
390 390
391 return browser_->CreateBrowserContext(this); 391 return browser_->CreateBrowserContext(this);
392 } 392 }
393 393
394 HeadlessBrowserContext::Builder::MojoBindings::MojoBindings() {} 394 HeadlessBrowserContext::Builder::MojoBindings::MojoBindings() {}
395 395
396 HeadlessBrowserContext::Builder::MojoBindings::MojoBindings( 396 HeadlessBrowserContext::Builder::MojoBindings::MojoBindings(
397 const std::string& mojom_name, 397 const std::string& mojom_name,
398 const std::string& js_bindings) 398 const std::string& js_bindings)
399 : mojom_name(mojom_name), js_bindings(js_bindings) {} 399 : mojom_name(mojom_name), js_bindings(js_bindings) {}
400 400
401 HeadlessBrowserContext::Builder::MojoBindings::~MojoBindings() {} 401 HeadlessBrowserContext::Builder::MojoBindings::~MojoBindings() {}
402 402
403 } // namespace headless 403 } // namespace headless
OLDNEW
« no previous file with comments | « no previous file | headless/lib/browser/headless_content_browser_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698