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/html/imports/HTMLImportsController.h" | 11 #include "core/html/imports/HTMLImportsController.h" |
11 #include "core/rendering/RenderObject.h" | 12 #include "core/rendering/RenderObject.h" |
12 | 13 |
13 namespace WebCore { | 14 namespace WebCore { |
14 | 15 |
15 PassRefPtr<MediaValues> MediaValuesCached::create() | 16 PassRefPtr<MediaValues> MediaValuesCached::create() |
16 { | 17 { |
17 return adoptRef(new MediaValuesCached()); | 18 return adoptRef(new MediaValuesCached()); |
18 } | 19 } |
19 | 20 |
20 PassRefPtr<MediaValues> MediaValuesCached::create(MediaValuesCachedData& data) | 21 PassRefPtr<MediaValues> MediaValuesCached::create(MediaValuesCachedData& data) |
21 { | 22 { |
22 return adoptRef(new MediaValuesCached(data)); | 23 return adoptRef(new MediaValuesCached(data)); |
23 } | 24 } |
24 | 25 |
25 PassRefPtr<MediaValues> MediaValuesCached::create(Document& document) | 26 PassRefPtr<MediaValues> MediaValuesCached::create(Document& document) |
26 { | 27 { |
27 Document* executingDocument = document.importsController() ? document.import
sController()->master() : &document; | 28 Document* executingDocument = document.importsController() ? document.import
sController()->master() : &document; |
28 ASSERT(executingDocument); | 29 ASSERT(executingDocument); |
29 return MediaValuesCached::create(executingDocument->frame()); | 30 return MediaValuesCached::create(executingDocument->frame()); |
30 } | 31 } |
31 | 32 |
32 PassRefPtr<MediaValues> MediaValuesCached::create(LocalFrame* frame) | 33 PassRefPtr<MediaValues> MediaValuesCached::create(LocalFrame* frame) |
33 { | 34 { |
34 if (!frame) | 35 // FIXME - Added an assert here so we can better understand when a frame is
present without its view(). |
| 36 ASSERT(!frame || frame->view()); |
| 37 if (!frame || !frame->view()) |
35 return adoptRef(new MediaValuesCached()); | 38 return adoptRef(new MediaValuesCached()); |
36 return adoptRef(new MediaValuesCached(frame)); | 39 return adoptRef(new MediaValuesCached(frame)); |
37 } | 40 } |
38 | 41 |
39 MediaValuesCached::MediaValuesCached() | 42 MediaValuesCached::MediaValuesCached() |
40 { | 43 { |
41 } | 44 } |
42 | 45 |
43 MediaValuesCached::MediaValuesCached(LocalFrame* frame) | 46 MediaValuesCached::MediaValuesCached(LocalFrame* frame) |
44 { | 47 { |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 { | 159 { |
157 return 0; | 160 return 0; |
158 } | 161 } |
159 | 162 |
160 bool MediaValuesCached::hasValues() const | 163 bool MediaValuesCached::hasValues() const |
161 { | 164 { |
162 return true; | 165 return true; |
163 } | 166 } |
164 | 167 |
165 } // namespace | 168 } // namespace |
OLD | NEW |