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

Side by Side Diff: third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp

Issue 1603783002: Add null check of the return value of Document::frame() in DTL::reportResponseReceived(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use TODO Created 4 years, 11 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2013, Intel Corporation 3 * Copyright (C) 2013, Intel Corporation
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after
563 // |this| may be dead here in async mode. 563 // |this| may be dead here in async mode.
564 return; 564 return;
565 } 565 }
566 566
567 CrossOriginPreflightResultCache::shared().appendEntry(securityOrigin()->toSt ring(), m_actualRequest.url(), preflightResult.release()); 567 CrossOriginPreflightResultCache::shared().appendEntry(securityOrigin()->toSt ring(), m_actualRequest.url(), preflightResult.release());
568 } 568 }
569 569
570 void DocumentThreadableLoader::reportResponseReceived(unsigned long identifier, const ResourceResponse& response) 570 void DocumentThreadableLoader::reportResponseReceived(unsigned long identifier, const ResourceResponse& response)
571 { 571 {
572 LocalFrame* frame = document().frame(); 572 LocalFrame* frame = document().frame();
573 // We are seeing crashes caused by nullptr (crbug.com/578849). But the frame
574 // must be set here. TODO(horo): Find the root cause of the unset frame.
575 ASSERT(frame);
576 if (!frame)
577 return;
573 DocumentLoader* loader = frame->loader().documentLoader(); 578 DocumentLoader* loader = frame->loader().documentLoader();
574 TRACE_EVENT_INSTANT1("devtools.timeline", "ResourceReceiveResponse", TRACE_E VENT_SCOPE_THREAD, "data", InspectorReceiveResponseEvent::data(identifier, frame , response)); 579 TRACE_EVENT_INSTANT1("devtools.timeline", "ResourceReceiveResponse", TRACE_E VENT_SCOPE_THREAD, "data", InspectorReceiveResponseEvent::data(identifier, frame , response));
575 InspectorInstrumentation::didReceiveResourceResponse(frame, identifier, load er, response, resource() ? resource()->loader() : 0); 580 InspectorInstrumentation::didReceiveResourceResponse(frame, identifier, load er, response, resource() ? resource()->loader() : 0);
576 frame->console().reportResourceResponseReceived(loader, identifier, response ); 581 frame->console().reportResourceResponseReceived(loader, identifier, response );
577 } 582 }
578 583
579 void DocumentThreadableLoader::handleResponse(unsigned long identifier, const Re sourceResponse& response, PassOwnPtr<WebDataConsumerHandle> handle) 584 void DocumentThreadableLoader::handleResponse(unsigned long identifier, const Re sourceResponse& response, PassOwnPtr<WebDataConsumerHandle> handle)
580 { 585 {
581 ASSERT(m_client); 586 ASSERT(m_client);
582 587
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
889 return m_securityOrigin ? m_securityOrigin.get() : document().securityOrigin (); 894 return m_securityOrigin ? m_securityOrigin.get() : document().securityOrigin ();
890 } 895 }
891 896
892 Document& DocumentThreadableLoader::document() const 897 Document& DocumentThreadableLoader::document() const
893 { 898 {
894 ASSERT(m_document); 899 ASSERT(m_document);
895 return *m_document; 900 return *m_document;
896 } 901 }
897 902
898 } // namespace blink 903 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698