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

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: Address 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..037c603fda90b7970458704e8fc16f30cb571b10 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -227,10 +227,11 @@ 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;
+ const WebHistoryItem& item = entry->root();
if (item.httpBody().isNull())
Charlie Reis 2015/02/19 00:51:37 Please change this to: if (item.isNull() || item.h
Sunil Ratnu 2015/02/19 04:19:35 Done.
return -1;
@@ -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