| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright (C) 2012 Google, Inc. All rights reserved. | 3 * Copyright (C) 2012 Google, Inc. All rights reserved. |
| 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 | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 25 */ | 25 */ |
| 26 | 26 |
| 27 #include "config.h" | 27 #include "config.h" |
| 28 #include "core/frame/UseCounter.h" | 28 #include "core/frame/UseCounter.h" |
| 29 | 29 |
| 30 #include "core/css/CSSStyleSheet.h" | 30 #include "core/css/CSSStyleSheet.h" |
| 31 #include "core/css/StyleSheetContents.h" | 31 #include "core/css/StyleSheetContents.h" |
| 32 #include "core/dom/Document.h" | 32 #include "core/dom/Document.h" |
| 33 #include "core/dom/ExecutionContext.h" | 33 #include "core/dom/ExecutionContext.h" |
| 34 #include "core/frame/DOMWindow.h" | 34 #include "core/frame/LocalDOMWindow.h" |
| 35 #include "core/frame/FrameConsole.h" | 35 #include "core/frame/FrameConsole.h" |
| 36 #include "core/frame/FrameHost.h" | 36 #include "core/frame/FrameHost.h" |
| 37 #include "core/frame/LocalFrame.h" | 37 #include "core/frame/LocalFrame.h" |
| 38 #include "public/platform/Platform.h" | 38 #include "public/platform/Platform.h" |
| 39 | 39 |
| 40 namespace WebCore { | 40 namespace WebCore { |
| 41 | 41 |
| 42 static int totalPagesMeasuredCSSSampleId() { return 1; } | 42 static int totalPagesMeasuredCSSSampleId() { return 1; } |
| 43 | 43 |
| 44 int UseCounter::m_muteCount = 0; | 44 int UseCounter::m_muteCount = 0; |
| (...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 610 count(*toDocument(context), feature); | 610 count(*toDocument(context), feature); |
| 611 } | 611 } |
| 612 | 612 |
| 613 void UseCounter::countDeprecation(ExecutionContext* context, Feature feature) | 613 void UseCounter::countDeprecation(ExecutionContext* context, Feature feature) |
| 614 { | 614 { |
| 615 if (!context || !context->isDocument()) | 615 if (!context || !context->isDocument()) |
| 616 return; | 616 return; |
| 617 UseCounter::countDeprecation(*toDocument(context), feature); | 617 UseCounter::countDeprecation(*toDocument(context), feature); |
| 618 } | 618 } |
| 619 | 619 |
| 620 void UseCounter::countDeprecation(const DOMWindow* window, Feature feature) | 620 void UseCounter::countDeprecation(const LocalDOMWindow* window, Feature feature) |
| 621 { | 621 { |
| 622 if (!window || !window->document()) | 622 if (!window || !window->document()) |
| 623 return; | 623 return; |
| 624 UseCounter::countDeprecation(*window->document(), feature); | 624 UseCounter::countDeprecation(*window->document(), feature); |
| 625 } | 625 } |
| 626 | 626 |
| 627 void UseCounter::countDeprecation(const Document& document, Feature feature) | 627 void UseCounter::countDeprecation(const Document& document, Feature feature) |
| 628 { | 628 { |
| 629 FrameHost* host = document.frameHost(); | 629 FrameHost* host = document.frameHost(); |
| 630 LocalFrame* frame = document.frame(); | 630 LocalFrame* frame = document.frame(); |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 774 UseCounter* UseCounter::getFrom(const StyleSheetContents* sheetContents) | 774 UseCounter* UseCounter::getFrom(const StyleSheetContents* sheetContents) |
| 775 { | 775 { |
| 776 // FIXME: We may want to handle stylesheets that have multiple owners | 776 // FIXME: We may want to handle stylesheets that have multiple owners |
| 777 // http://crbug.com/242125 | 777 // http://crbug.com/242125 |
| 778 if (sheetContents && sheetContents->hasSingleOwnerNode()) | 778 if (sheetContents && sheetContents->hasSingleOwnerNode()) |
| 779 return getFrom(sheetContents->singleOwnerDocument()); | 779 return getFrom(sheetContents->singleOwnerDocument()); |
| 780 return 0; | 780 return 0; |
| 781 } | 781 } |
| 782 | 782 |
| 783 } // namespace WebCore | 783 } // namespace WebCore |
| OLD | NEW |