| Index: ios/web/web_state/navigation_context_impl.mm
|
| diff --git a/ios/web/web_state/navigation_context_impl.mm b/ios/web/web_state/navigation_context_impl.mm
|
| index 3262e0bd2002337fa6b0f319170dac233228604c..5e971304f226a74f9826abb083ef6a53c970e09e 100644
|
| --- a/ios/web/web_state/navigation_context_impl.mm
|
| +++ b/ios/web/web_state/navigation_context_impl.mm
|
| @@ -2,7 +2,7 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "ios/web/web_state/navigation_context_impl.h"
|
| +#import "ios/web/web_state/navigation_context_impl.h"
|
|
|
| #import <Foundation/Foundation.h>
|
|
|
| @@ -15,20 +15,18 @@ namespace web {
|
| std::unique_ptr<NavigationContextImpl>
|
| NavigationContextImpl::CreateNavigationContext(WebState* web_state,
|
| const GURL& url) {
|
| - std::unique_ptr<NavigationContextImpl> result(new NavigationContextImpl(
|
| - web_state, url, false /* is_same_document */, false /* is_error_page */,
|
| - nullptr /* response_headers */));
|
| + std::unique_ptr<NavigationContextImpl> result(
|
| + new NavigationContextImpl(web_state, url));
|
| return result;
|
| }
|
|
|
| #ifndef NDEBUG
|
| NSString* NavigationContextImpl::GetDescription() const {
|
| - return [NSString stringWithFormat:@"web::WebState: %ld, url: %s, "
|
| - "is_same_document: %@, is_error_page_: %@",
|
| - reinterpret_cast<long>(web_state_),
|
| - url_.spec().c_str(),
|
| - is_same_document_ ? @"true" : @"false",
|
| - is_error_page_ ? @"true" : @"false"];
|
| + return [NSString
|
| + stringWithFormat:@"web::WebState: %ld, url: %s, "
|
| + "is_same_document: %@, error: %@",
|
| + reinterpret_cast<long>(web_state_), url_.spec().c_str(),
|
| + is_same_document_ ? @"true" : @"false", error_.get()];
|
| }
|
| #endif // NDEBUG
|
|
|
| @@ -44,8 +42,8 @@ bool NavigationContextImpl::IsSameDocument() const {
|
| return is_same_document_;
|
| }
|
|
|
| -bool NavigationContextImpl::IsErrorPage() const {
|
| - return is_error_page_;
|
| +NSError* NavigationContextImpl::GetError() const {
|
| + return error_;
|
| }
|
|
|
| net::HttpResponseHeaders* NavigationContextImpl::GetResponseHeaders() const {
|
| @@ -56,8 +54,8 @@ void NavigationContextImpl::SetIsSameDocument(bool is_same_document) {
|
| is_same_document_ = is_same_document;
|
| }
|
|
|
| -void NavigationContextImpl::SetIsErrorPage(bool is_error_page) {
|
| - is_error_page_ = is_error_page;
|
| +void NavigationContextImpl::SetError(NSError* error) {
|
| + error_.reset(error);
|
| }
|
|
|
| void NavigationContextImpl::SetResponseHeaders(
|
| @@ -73,17 +71,13 @@ void NavigationContextImpl::SetNavigationItemUniqueID(int unique_id) {
|
| navigation_item_unique_id_ = unique_id;
|
| }
|
|
|
| -NavigationContextImpl::NavigationContextImpl(
|
| - WebState* web_state,
|
| - const GURL& url,
|
| - bool is_same_document,
|
| - bool is_error_page,
|
| - const scoped_refptr<net::HttpResponseHeaders>& response_headers)
|
| +NavigationContextImpl::NavigationContextImpl(WebState* web_state,
|
| + const GURL& url)
|
| : web_state_(web_state),
|
| url_(url),
|
| - is_same_document_(is_same_document),
|
| - is_error_page_(is_error_page),
|
| - response_headers_(response_headers) {}
|
| + is_same_document_(false),
|
| + error_(nil),
|
| + response_headers_(nullptr) {}
|
|
|
| NavigationContextImpl::~NavigationContextImpl() = default;
|
|
|
|
|