OLD | NEW |
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 Loading... |
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 |
OLD | NEW |