OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |