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

Unified Diff: ios/web/web_state/navigation_context_impl.mm

Issue 2835463002: Store NavigationIntext in CRWWKNavigationStates. (Closed)
Patch Set: Fixed compilation. Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/web/web_state/navigation_context_impl.h ('k') | ios/web/web_state/ui/crw_wk_navigation_states.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 3d36b72f2dc8b57257ab3229e8a3c82bc863e90f..4d6406f8dd94c796bc1cbe30794711c3d405b6fd 100644
--- a/ios/web/web_state/navigation_context_impl.mm
+++ b/ios/web/web_state/navigation_context_impl.mm
@@ -4,45 +4,58 @@
#include "ios/web/web_state/navigation_context_impl.h"
+#import <Foundation/Foundation.h>
+
#include "base/memory/ptr_util.h"
#include "net/http/http_response_headers.h"
namespace web {
// static
-std::unique_ptr<NavigationContext>
+std::unique_ptr<NavigationContextImpl>
NavigationContextImpl::CreateNavigationContext(
WebState* web_state,
const GURL& url,
const scoped_refptr<net::HttpResponseHeaders>& response_headers) {
- std::unique_ptr<NavigationContext> resut(
+ std::unique_ptr<NavigationContextImpl> resut(
new NavigationContextImpl(web_state, url, false /* is_same_document */,
false /* is_error_page */, response_headers));
return resut;
}
// static
-std::unique_ptr<NavigationContext>
+std::unique_ptr<NavigationContextImpl>
NavigationContextImpl::CreateSameDocumentNavigationContext(WebState* web_state,
const GURL& url) {
- std::unique_ptr<NavigationContext> result(new NavigationContextImpl(
+ std::unique_ptr<NavigationContextImpl> result(new NavigationContextImpl(
web_state, url, true /* is_same_document */, false /* is_error_page */,
nullptr /* response_headers */));
return result;
}
// static
-std::unique_ptr<NavigationContext>
+std::unique_ptr<NavigationContextImpl>
NavigationContextImpl::CreateErrorPageNavigationContext(
WebState* web_state,
const GURL& url,
const scoped_refptr<net::HttpResponseHeaders>& response_headers) {
- std::unique_ptr<NavigationContext> result(
+ std::unique_ptr<NavigationContextImpl> result(
new NavigationContextImpl(web_state, url, false /* is_same_document */,
true /* is_error_page */, response_headers));
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"];
+}
+#endif // NDEBUG
+
WebState* NavigationContextImpl::GetWebState() {
return web_state_;
}
« no previous file with comments | « ios/web/web_state/navigation_context_impl.h ('k') | ios/web/web_state/ui/crw_wk_navigation_states.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698