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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 924843002: Fix for possible crashes due to pointer value being null (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing review comments Created 5 years, 10 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 | « content/browser/accessibility/accessibility_ui.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 5dc54433f82ffb69665feb16dc69d19390c9e20e..32a2b28d1aca07bd30509391023e663d26005e01 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -227,11 +227,12 @@ static base::LazyInstance<RoutingIDFrameMap> g_routing_id_frame_map =
typedef std::map<blink::WebFrame*, RenderFrameImpl*> FrameMap;
base::LazyInstance<FrameMap> g_frame_map = LAZY_INSTANCE_INITIALIZER;
-int64 ExtractPostId(const WebHistoryItem& item) {
- if (item.isNull())
+int64 ExtractPostId(HistoryEntry* entry) {
+ if (!entry)
return -1;
- if (item.httpBody().isNull())
+ const WebHistoryItem& item = entry->root();
+ if (item.isNull() || item.httpBody().isNull())
return -1;
return item.httpBody().identifier();
@@ -3774,7 +3775,7 @@ void RenderFrameImpl::SendDidCommitProvisionalLoad(
base::string16 method = request.httpMethod();
if (EqualsASCII(method, "POST")) {
params.is_post = true;
- params.post_id = ExtractPostId(entry->root());
+ params.post_id = ExtractPostId(entry);
}
// Send the user agent override back.
« no previous file with comments | « content/browser/accessibility/accessibility_ui.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698