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

Side by Side Diff: Source/core/css/MediaValuesCached.cpp

Issue 271613004: A speculative fix for a MediaValues related crash (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "core/css/MediaValuesCached.h" 6 #include "core/css/MediaValuesCached.h"
7 7
8 #include "core/css/CSSPrimitiveValue.h" 8 #include "core/css/CSSPrimitiveValue.h"
9 #include "core/dom/Document.h" 9 #include "core/dom/Document.h"
10 #include "core/frame/LocalFrame.h" 10 #include "core/frame/LocalFrame.h"
(...skipping 16 matching lines...) Expand all
27 { 27 {
28 Document* executingDocument = document.importsController() ? document.import sController()->master() : &document; 28 Document* executingDocument = document.importsController() ? document.import sController()->master() : &document;
29 ASSERT(executingDocument); 29 ASSERT(executingDocument);
30 return MediaValuesCached::create(executingDocument->frame()); 30 return MediaValuesCached::create(executingDocument->frame());
31 } 31 }
32 32
33 PassRefPtr<MediaValues> MediaValuesCached::create(LocalFrame* frame) 33 PassRefPtr<MediaValues> MediaValuesCached::create(LocalFrame* frame)
34 { 34 {
35 // FIXME - Added an assert here so we can better understand when a frame is present without its view(). 35 // FIXME - Added an assert here so we can better understand when a frame is present without its view().
36 ASSERT(!frame || frame->view()); 36 ASSERT(!frame || frame->view());
37 if (!frame || !frame->view()) 37 // FIXME - Because of crbug.com/371084, document()->renderView() may be null here.
38 if (!frame || !frame->view() || !frame->document() || !frame->document()->re nderView())
38 return adoptRef(new MediaValuesCached()); 39 return adoptRef(new MediaValuesCached());
39 return adoptRef(new MediaValuesCached(frame)); 40 return adoptRef(new MediaValuesCached(frame));
40 } 41 }
41 42
42 MediaValuesCached::MediaValuesCached() 43 MediaValuesCached::MediaValuesCached()
43 { 44 {
44 } 45 }
45 46
46 MediaValuesCached::MediaValuesCached(LocalFrame* frame) 47 MediaValuesCached::MediaValuesCached(LocalFrame* frame)
47 { 48 {
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 { 160 {
160 return 0; 161 return 0;
161 } 162 }
162 163
163 bool MediaValuesCached::hasValues() const 164 bool MediaValuesCached::hasValues() const
164 { 165 {
165 return true; 166 return true;
166 } 167 }
167 168
168 } // namespace 169 } // namespace
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