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

Side by Side Diff: Source/core/frame/UseCounter.cpp

Issue 376213002: DevTools: Make FrameConsole methods accept ConsoleMessage objects. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@scriptFailedToParse
Patch Set: Created 6 years, 5 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
OLDNEW
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 17 matching lines...) Expand all
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/LocalDOMWindow.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/inspector/ConsoleMessage.h"
38 #include "core/workers/WorkerGlobalScope.h" 39 #include "core/workers/WorkerGlobalScope.h"
39 #include "public/platform/Platform.h" 40 #include "public/platform/Platform.h"
40 41
41 namespace blink { 42 namespace blink {
42 43
43 static int totalPagesMeasuredCSSSampleId() { return 1; } 44 static int totalPagesMeasuredCSSSampleId() { return 1; }
44 45
45 int UseCounter::m_muteCount = 0; 46 int UseCounter::m_muteCount = 0;
46 47
47 // FIXME : This mapping should be autogenerated. This function should 48 // FIXME : This mapping should be autogenerated. This function should
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 628
628 void UseCounter::countDeprecation(const Document& document, Feature feature) 629 void UseCounter::countDeprecation(const Document& document, Feature feature)
629 { 630 {
630 FrameHost* host = document.frameHost(); 631 FrameHost* host = document.frameHost();
631 LocalFrame* frame = document.frame(); 632 LocalFrame* frame = document.frame();
632 if (!host || !frame) 633 if (!host || !frame)
633 return; 634 return;
634 635
635 if (host->useCounter().recordMeasurement(feature)) { 636 if (host->useCounter().recordMeasurement(feature)) {
636 ASSERT(!host->useCounter().deprecationMessage(feature).isEmpty()); 637 ASSERT(!host->useCounter().deprecationMessage(feature).isEmpty());
637 frame->console().addMessage(DeprecationMessageSource, WarningMessageLeve l, host->useCounter().deprecationMessage(feature)); 638 frame->console().addMessage(ConsoleMessage::create(DeprecationMessageSou rce, WarningMessageLevel, host->useCounter().deprecationMessage(feature)));
638 } 639 }
639 } 640 }
640 641
641 String UseCounter::deprecationMessage(Feature feature) 642 String UseCounter::deprecationMessage(Feature feature)
642 { 643 {
643 switch (feature) { 644 switch (feature) {
644 // Quota 645 // Quota
645 case PrefixedStorageInfo: 646 case PrefixedStorageInfo:
646 return "'window.webkitStorageInfo' is deprecated. Please use 'navigator. webkitTemporaryStorage' or 'navigator.webkitPersistentStorage' instead."; 647 return "'window.webkitStorageInfo' is deprecated. Please use 'navigator. webkitTemporaryStorage' or 'navigator.webkitPersistentStorage' instead.";
647 648
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
778 UseCounter* UseCounter::getFrom(const StyleSheetContents* sheetContents) 779 UseCounter* UseCounter::getFrom(const StyleSheetContents* sheetContents)
779 { 780 {
780 // FIXME: We may want to handle stylesheets that have multiple owners 781 // FIXME: We may want to handle stylesheets that have multiple owners
781 // http://crbug.com/242125 782 // http://crbug.com/242125
782 if (sheetContents && sheetContents->hasSingleOwnerNode()) 783 if (sheetContents && sheetContents->hasSingleOwnerNode())
783 return getFrom(sheetContents->singleOwnerDocument()); 784 return getFrom(sheetContents->singleOwnerDocument());
784 return 0; 785 return 0;
785 } 786 }
786 787
787 } // namespace blink 788 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698