| 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 "core/workers/WorkerGlobalScope.h" | 38 #include "core/workers/WorkerGlobalScope.h" |
| 39 #include "public/platform/Platform.h" | 39 #include "public/platform/Platform.h" |
| 40 | 40 |
| 41 namespace WebCore { | 41 namespace WebCore { |
| 42 | 42 |
| 43 static int totalPagesMeasuredCSSSampleId() { return 1; } | 43 static int totalPagesMeasuredCSSSampleId() { return 1; } |
| 44 | 44 |
| (...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 622 if (!context) | 622 if (!context) |
| 623 return; | 623 return; |
| 624 if (context->isDocument()) { | 624 if (context->isDocument()) { |
| 625 UseCounter::countDeprecation(*toDocument(context), feature); | 625 UseCounter::countDeprecation(*toDocument(context), feature); |
| 626 return; | 626 return; |
| 627 } | 627 } |
| 628 if (context->isWorkerGlobalScope()) | 628 if (context->isWorkerGlobalScope()) |
| 629 toWorkerGlobalScope(context)->countDeprecation(feature); | 629 toWorkerGlobalScope(context)->countDeprecation(feature); |
| 630 } | 630 } |
| 631 | 631 |
| 632 void UseCounter::countDeprecation(const DOMWindow* window, Feature feature) | 632 void UseCounter::countDeprecation(const LocalDOMWindow* window, Feature feature) |
| 633 { | 633 { |
| 634 if (!window || !window->document()) | 634 if (!window || !window->document()) |
| 635 return; | 635 return; |
| 636 UseCounter::countDeprecation(*window->document(), feature); | 636 UseCounter::countDeprecation(*window->document(), feature); |
| 637 } | 637 } |
| 638 | 638 |
| 639 void UseCounter::countDeprecation(const Document& document, Feature feature) | 639 void UseCounter::countDeprecation(const Document& document, Feature feature) |
| 640 { | 640 { |
| 641 FrameHost* host = document.frameHost(); | 641 FrameHost* host = document.frameHost(); |
| 642 LocalFrame* frame = document.frame(); | 642 LocalFrame* frame = document.frame(); |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 786 UseCounter* UseCounter::getFrom(const StyleSheetContents* sheetContents) | 786 UseCounter* UseCounter::getFrom(const StyleSheetContents* sheetContents) |
| 787 { | 787 { |
| 788 // FIXME: We may want to handle stylesheets that have multiple owners | 788 // FIXME: We may want to handle stylesheets that have multiple owners |
| 789 // http://crbug.com/242125 | 789 // http://crbug.com/242125 |
| 790 if (sheetContents && sheetContents->hasSingleOwnerNode()) | 790 if (sheetContents && sheetContents->hasSingleOwnerNode()) |
| 791 return getFrom(sheetContents->singleOwnerDocument()); | 791 return getFrom(sheetContents->singleOwnerDocument()); |
| 792 return 0; | 792 return 0; |
| 793 } | 793 } |
| 794 | 794 |
| 795 } // namespace WebCore | 795 } // namespace WebCore |
| OLD | NEW |