summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKristian Monsen <kristianm@google.com>2011-11-09 21:51:01 +0000
committerKristian Monsen <kristianm@google.com>2011-11-17 13:48:02 +0000
commitb359438e11520b3e3b6801ad1280e1bdef2b986c (patch)
tree66c6170430bb1986c1d4e427bc3734e2712de3b7
parent22e6e8f6e1a5a5e677269d6f7895ff49b1a8f41b (diff)
downloadexternal_webkit-b359438e11520b3e3b6801ad1280e1bdef2b986c.zip
external_webkit-b359438e11520b3e3b6801ad1280e1bdef2b986c.tar.gz
external_webkit-b359438e11520b3e3b6801ad1280e1bdef2b986c.tar.bz2
Removing ANDROID_INSTRUMENTATION code
This has not been used for years, and due to WebKit merges the results are not accurate anymore. The resulting code is cleaner, less likely to create merge conflicts, and does not give the impression that this can be turned on and it will still work. Needs CL: https://android-git.corp.google.com/g/#/c/148912/ Change-Id: I617ad00c103ab72038371a3203452d2ccec0e50c
-rw-r--r--Android.mk8
-rw-r--r--Source/Android.mk8
-rw-r--r--Source/JavaScriptCore/parser/Parser.cpp10
-rw-r--r--Source/JavaScriptCore/runtime/TimeoutChecker.h12
-rw-r--r--Source/WebCore/bindings/v8/V8DOMWindowShell.cpp12
-rw-r--r--Source/WebCore/bindings/v8/V8Proxy.cpp30
-rw-r--r--Source/WebCore/bindings/v8/V8Proxy.h8
-rw-r--r--Source/WebCore/css/CSSImportRule.cpp22
-rw-r--r--Source/WebCore/css/CSSImportRule.h8
-rw-r--r--Source/WebCore/css/CSSParser.cpp54
-rw-r--r--Source/WebCore/css/StyleBase.cpp33
-rw-r--r--Source/WebCore/css/StyleBase.h12
-rw-r--r--Source/WebCore/dom/Document.cpp12
-rw-r--r--Source/WebCore/dom/Node.cpp33
-rw-r--r--Source/WebCore/dom/Node.h12
-rw-r--r--Source/WebCore/dom/ProcessingInstruction.cpp22
-rw-r--r--Source/WebCore/dom/ProcessingInstruction.h8
-rw-r--r--Source/WebCore/html/HTMLCanvasElement.h16
-rw-r--r--Source/WebCore/html/HTMLDocument.cpp22
-rw-r--r--Source/WebCore/html/HTMLDocument.h8
-rw-r--r--Source/WebCore/html/HTMLLinkElement.cpp22
-rw-r--r--Source/WebCore/html/HTMLLinkElement.h8
-rw-r--r--Source/WebCore/html/parser/HTMLDocumentParser.cpp14
-rw-r--r--Source/WebCore/loader/FrameLoader.cpp15
-rw-r--r--Source/WebCore/loader/cache/MemoryCache.h6
-rw-r--r--Source/WebCore/page/FrameView.cpp14
-rw-r--r--Source/WebCore/platform/Arena.cpp12
-rw-r--r--Source/WebCore/platform/Arena.h4
-rw-r--r--Source/WebCore/rendering/RenderArena.cpp7
-rw-r--r--Source/WebCore/rendering/RenderArena.h4
-rw-r--r--Source/WebCore/svg/SVGFontFaceUriElement.h16
-rw-r--r--Source/WebCore/xml/XSLImportRule.h16
-rw-r--r--Source/WebKit/Android.mk2
-rw-r--r--Source/WebKit/android/TimeCounter.cpp198
-rw-r--r--Source/WebKit/android/TimeCounter.h120
-rw-r--r--Source/WebKit/android/WebCoreSupport/V8Counters.cpp116
-rw-r--r--Source/WebKit/android/WebCoreSupport/V8Counters.h77
-rw-r--r--Source/WebKit/android/jni/JavaBridge.cpp9
-rw-r--r--Source/WebKit/android/jni/PictureSet.cpp17
-rw-r--r--Source/WebKit/android/jni/WebCoreFrameBridge.cpp166
-rw-r--r--Source/WebKit/android/jni/WebCoreResourceLoader.cpp25
-rw-r--r--Source/WebKit/android/jni/WebViewCore.cpp119
-rw-r--r--Source/WebKit/android/nav/WebView.cpp12
43 files changed, 16 insertions, 1333 deletions
diff --git a/Android.mk b/Android.mk
index 623a35f..f5ff741 100644
--- a/Android.mk
+++ b/Android.mk
@@ -352,10 +352,6 @@ ifeq ($(ENABLE_WTF_USE_ACCELERATED_COMPOSITING),true)
LOCAL_CFLAGS += -DWTF_USE_ACCELERATED_COMPOSITING=1
endif
-ifeq ($(WEBCORE_INSTRUMENTATION),true)
-LOCAL_CFLAGS += -DANDROID_INSTRUMENT
-endif
-
# LOCAL_LDLIBS is used in simulator builds only and simulator builds are only
# valid on Linux
LOCAL_LDLIBS += -lpthread -ldl
@@ -381,10 +377,6 @@ ifeq ($(PLATFORM_VERSION),3.1.4.1.5.9.2.6.5)
LOCAL_SHARED_LIBRARIES += libsurfaceflinger_client
endif
-ifeq ($(WEBCORE_INSTRUMENTATION),true)
-LOCAL_SHARED_LIBRARIES += libhardware_legacy
-endif
-
# We have to use the android version of libdl
LOCAL_SHARED_LIBRARIES += libdl libstlport
# We have to fake out some headers when using stlport.
diff --git a/Source/Android.mk b/Source/Android.mk
index fd1f622..6612cae 100644
--- a/Source/Android.mk
+++ b/Source/Android.mk
@@ -224,10 +224,6 @@ ifeq ($(ENABLE_SVG_ANIMATION),true)
LOCAL_CFLAGS += -DENABLE_SVG_ANIMATION=1
endif
-ifeq ($(WEBCORE_INSTRUMENTATION),true)
-LOCAL_CFLAGS += -DANDROID_INSTRUMENT
-endif
-
# LOCAL_LDLIBS is used in simulator builds only and simulator builds are only
# valid on Linux
LOCAL_LDLIBS += -lpthread -ldl
@@ -246,10 +242,6 @@ LOCAL_SHARED_LIBRARIES := \
libicui18n \
libmedia
-ifeq ($(WEBCORE_INSTRUMENTATION),true)
-LOCAL_SHARED_LIBRARIES += libhardware_legacy
-endif
-
# We have to use the android version of libdl.
LOCAL_SHARED_LIBRARIES += libdl
diff --git a/Source/JavaScriptCore/parser/Parser.cpp b/Source/JavaScriptCore/parser/Parser.cpp
index dc15e4f..fc1e986 100644
--- a/Source/JavaScriptCore/parser/Parser.cpp
+++ b/Source/JavaScriptCore/parser/Parser.cpp
@@ -27,17 +27,10 @@
#include "JSParser.h"
#include "Lexer.h"
-#ifdef ANDROID_INSTRUMENT
-#include "TimeCounter.h"
-#endif
-
namespace JSC {
void Parser::parse(JSGlobalData* globalData, FunctionParameters* parameters, JSParserStrictness strictness, JSParserMode mode, int* errLine, UString* errMsg)
{
-#ifdef ANDROID_INSTRUMENT
- android::TimeCounter::start(android::TimeCounter::JavaScriptParseTimeCounter);
-#endif
ASSERT(globalData);
m_sourceElements = 0;
@@ -65,9 +58,6 @@ void Parser::parse(JSGlobalData* globalData, FunctionParameters* parameters, JSP
*errMsg = parseError ? parseError : "Parse error";
m_sourceElements = 0;
}
-#ifdef ANDROID_INSTRUMENT
- android::TimeCounter::record(android::TimeCounter::JavaScriptParseTimeCounter, __FUNCTION__);
-#endif
}
void Parser::didFinishParsing(SourceElements* sourceElements, ParserArenaData<DeclarationStacks::VarStack>* varStack,
diff --git a/Source/JavaScriptCore/runtime/TimeoutChecker.h b/Source/JavaScriptCore/runtime/TimeoutChecker.h
index 71ce169..5925641 100644
--- a/Source/JavaScriptCore/runtime/TimeoutChecker.h
+++ b/Source/JavaScriptCore/runtime/TimeoutChecker.h
@@ -31,10 +31,6 @@
#include <wtf/Assertions.h>
-#ifdef ANDROID_INSTRUMENT
-#include "TimeCounter.h"
-#endif
-
namespace JSC {
class ExecState;
@@ -52,10 +48,6 @@ namespace JSC {
{
if (!m_startCount)
reset();
-#ifdef ANDROID_INSTRUMENT
- if (!m_startCount)
- android::TimeCounter::start(android::TimeCounter::JavaScriptTimeCounter);
-#endif
++m_startCount;
}
@@ -63,10 +55,6 @@ namespace JSC {
{
ASSERT(m_startCount);
--m_startCount;
-#ifdef ANDROID_INSTRUMENT
- if (!m_startCount)
- android::TimeCounter::record(android::TimeCounter::JavaScriptTimeCounter, __FUNCTION__);
-#endif
}
void reset();
diff --git a/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp b/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp
index e025008..c3a0cbb 100644
--- a/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp
+++ b/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp
@@ -76,10 +76,6 @@
#include <wtf/UnusedParam.h>
#include <wtf/text/CString.h>
-#ifdef ANDROID_INSTRUMENT
-#include "TimeCounter.h"
-#endif
-
namespace WebCore {
static void handleFatalErrorInV8()
@@ -283,10 +279,6 @@ bool V8DOMWindowShell::initContextIfNeeded()
if (!m_context.IsEmpty())
return false;
-#ifdef ANDROID_INSTRUMENT
- android::TimeCounter::start(android::TimeCounter::JavaScriptInitTimeCounter);
-#endif
-
// Create a handle scope for all local handles.
v8::HandleScope handleScope;
@@ -352,10 +344,6 @@ bool V8DOMWindowShell::initContextIfNeeded()
// we do isolated worlds the WebCore way.
m_frame->loader()->dispatchDidClearWindowObjectInWorld(0);
-#ifdef ANDROID_INSTRUMENT
- android::TimeCounter::record(android::TimeCounter::JavaScriptInitTimeCounter, __FUNCTION__);
-#endif
-
return true;
}
diff --git a/Source/WebCore/bindings/v8/V8Proxy.cpp b/Source/WebCore/bindings/v8/V8Proxy.cpp
index ca57fa8..80c4789 100644
--- a/Source/WebCore/bindings/v8/V8Proxy.cpp
+++ b/Source/WebCore/bindings/v8/V8Proxy.cpp
@@ -83,10 +83,6 @@
#include <wtf/UnusedParam.h>
#include <wtf/text/StringConcatenate.h>
-#ifdef ANDROID_INSTRUMENT
-#include "TimeCounter.h"
-#endif
-
#if PLATFORM(ANDROID)
#include <wtf/text/CString.h>
#endif
@@ -209,16 +205,6 @@ V8Proxy::~V8Proxy()
}
v8::Handle<v8::Script> V8Proxy::compileScript(v8::Handle<v8::String> code, const String& fileName, const TextPosition0& scriptStartPosition, v8::ScriptData* scriptData)
-#ifdef ANDROID_INSTRUMENT
-{
- android::TimeCounter::start(android::TimeCounter::JavaScriptParseTimeCounter);
- v8::Handle<v8::Script> script = compileScriptInternal(code, fileName, scriptStartPosition, scriptData);
- android::TimeCounter::record(android::TimeCounter::JavaScriptParseTimeCounter, __FUNCTION__);
- return script;
-}
-
-v8::Handle<v8::Script> V8Proxy::compileScriptInternal(v8::Handle<v8::String> code, const String& fileName, const TextPosition0& scriptStartPosition, v8::ScriptData* scriptData)
-#endif
{
const uint16_t* fileNameString = fromWebCoreString(fileName);
v8::Handle<v8::String> name = v8::String::New(fileNameString, fileName.length());
@@ -398,16 +384,6 @@ v8::Local<v8::Value> V8Proxy::evaluate(const ScriptSourceCode& source, Node* nod
}
v8::Local<v8::Value> V8Proxy::runScript(v8::Handle<v8::Script> script, bool isInlineCode)
-#ifdef ANDROID_INSTRUMENT
-{
- android::TimeCounter::start(android::TimeCounter::JavaScriptExecuteTimeCounter);
- v8::Local<v8::Value> result = runScriptInternal(script, isInlineCode);
- android::TimeCounter::record(android::TimeCounter::JavaScriptExecuteTimeCounter, __FUNCTION__);
- return result;
-}
-
-v8::Local<v8::Value> V8Proxy::runScriptInternal(v8::Handle<v8::Script> script, bool isInlineCode)
-#endif
{
if (script.IsEmpty())
return notHandledByInterceptor();
@@ -472,9 +448,6 @@ v8::Local<v8::Value> V8Proxy::runScriptInternal(v8::Handle<v8::Script> script, b
v8::Local<v8::Value> V8Proxy::callFunction(v8::Handle<v8::Function> function, v8::Handle<v8::Object> receiver, int argc, v8::Handle<v8::Value> args[])
{
-#ifdef ANDROID_INSTRUMENT
- android::TimeCounter::start(android::TimeCounter::JavaScriptExecuteTimeCounter);
-#endif
V8GCController::checkMemoryUsage();
v8::Local<v8::Value> result;
{
@@ -521,9 +494,6 @@ v8::Local<v8::Value> V8Proxy::callFunction(v8::Handle<v8::Function> function, v8
if (v8::V8::IsDead())
handleFatalErrorInV8();
-#ifdef ANDROID_INSTRUMENT
- android::TimeCounter::record(android::TimeCounter::JavaScriptExecuteTimeCounter, __FUNCTION__);
-#endif
return result;
}
diff --git a/Source/WebCore/bindings/v8/V8Proxy.h b/Source/WebCore/bindings/v8/V8Proxy.h
index fc52b19..777815b 100644
--- a/Source/WebCore/bindings/v8/V8Proxy.h
+++ b/Source/WebCore/bindings/v8/V8Proxy.h
@@ -171,10 +171,6 @@ namespace WebCore {
// Run an already compiled script.
v8::Local<v8::Value> runScript(v8::Handle<v8::Script>, bool isInlineCode);
-#ifdef ANDROID_INSTRUMENT
- v8::Local<v8::Value> runScriptInternal(v8::Handle<v8::Script> script, bool inline_code);
-#endif
-
// Call the function with the given receiver and arguments.
v8::Local<v8::Value> callFunction(v8::Handle<v8::Function>, v8::Handle<v8::Object>, int argc, v8::Handle<v8::Value> argv[]);
@@ -244,10 +240,6 @@ namespace WebCore {
static v8::Handle<v8::Script> compileScript(v8::Handle<v8::String> code, const String& fileName, const TextPosition0& scriptStartPosition, v8::ScriptData* = 0);
-#ifdef ANDROID_INSTRUMENT
- static v8::Handle<v8::Script> compileScriptInternal(v8::Handle<v8::String> code, const String& fileName, int baseLine, v8::ScriptData* scriptData);
-#endif
-
// If the exception code is different from zero, a DOM exception is
// schedule to be thrown.
static void setDOMException(int exceptionCode);
diff --git a/Source/WebCore/css/CSSImportRule.cpp b/Source/WebCore/css/CSSImportRule.cpp
index 09e313e..81ade39 100644
--- a/Source/WebCore/css/CSSImportRule.cpp
+++ b/Source/WebCore/css/CSSImportRule.cpp
@@ -170,26 +170,4 @@ void CSSImportRule::addSubresourceStyleURLs(ListHashSet<KURL>& urls)
addSubresourceURL(urls, m_styleSheet->baseURL());
}
-#ifdef ANDROID_INSTRUMENT
-void* CSSImportRule::operator new(size_t size)
-{
- return StyleBase::operator new(size);
-}
-
-void* CSSImportRule::operator new[](size_t size)
-{
- return StyleBase::operator new[](size);
-}
-
-void CSSImportRule::operator delete(void* p, size_t size)
-{
- StyleBase::operator delete(p, size);
-}
-
-void CSSImportRule::operator delete[](void* p, size_t size)
-{
- StyleBase::operator delete[](p, size);
-}
-#endif
-
} // namespace WebCore
diff --git a/Source/WebCore/css/CSSImportRule.h b/Source/WebCore/css/CSSImportRule.h
index 3f44f5b..ad4e97d 100644
--- a/Source/WebCore/css/CSSImportRule.h
+++ b/Source/WebCore/css/CSSImportRule.h
@@ -66,14 +66,6 @@ private:
// from CachedResourceClient
virtual void setCSSStyleSheet(const String& href, const KURL& baseURL, const String& charset, const CachedCSSStyleSheet*);
-#ifdef ANDROID_INSTRUMENT
- // Overridden to resolve the ambiguous
- void* operator new(size_t size);
- void* operator new[](size_t size);
- void operator delete(void* p, size_t size);
- void operator delete[](void* p, size_t size);
-#endif
-
String m_strHref;
RefPtr<MediaList> m_lstMedia;
RefPtr<CSSStyleSheet> m_styleSheet;
diff --git a/Source/WebCore/css/CSSParser.cpp b/Source/WebCore/css/CSSParser.cpp
index 831e438..df9d252 100644
--- a/Source/WebCore/css/CSSParser.cpp
+++ b/Source/WebCore/css/CSSParser.cpp
@@ -92,10 +92,6 @@ extern int cssyyparse(void* parser);
using namespace std;
using namespace WTF;
-#ifdef ANDROID_INSTRUMENT
-#include "TimeCounter.h"
-#endif
-
namespace WebCore {
static const unsigned INVALID_NUM_PARSED_PROPERTIES = UINT_MAX;
@@ -230,9 +226,6 @@ void CSSParser::setupParser(const char* prefix, const String& string, const char
void CSSParser::parseSheet(CSSStyleSheet* sheet, const String& string, int startLineNumber, StyleRuleRangeMap* ruleRangeMap)
{
-#ifdef ANDROID_INSTRUMENT
- android::TimeCounter::start(android::TimeCounter::CSSParseTimeCounter);
-#endif
setStyleSheet(sheet);
m_defaultNamespace = starAtom; // Reset the default namespace.
m_ruleRangeMap = ruleRangeMap;
@@ -247,37 +240,22 @@ void CSSParser::parseSheet(CSSStyleSheet* sheet, const String& string, int start
m_ruleRangeMap = 0;
m_currentRuleData = 0;
m_rule = 0;
-#ifdef ANDROID_INSTRUMENT
- android::TimeCounter::record(android::TimeCounter::CSSParseTimeCounter, __FUNCTION__);
-#endif
}
PassRefPtr<CSSRule> CSSParser::parseRule(CSSStyleSheet* sheet, const String& string)
{
-#ifdef ANDROID_INSTRUMENT
- android::TimeCounter::start(android::TimeCounter::CSSParseTimeCounter);
-#endif
setStyleSheet(sheet);
m_allowNamespaceDeclarations = false;
setupParser("@-webkit-rule{", string, "} ");
cssyyparse(this);
-#ifdef ANDROID_INSTRUMENT
- android::TimeCounter::record(android::TimeCounter::CSSParseTimeCounter, __FUNCTION__);
-#endif
return m_rule.release();
}
PassRefPtr<CSSRule> CSSParser::parseKeyframeRule(CSSStyleSheet *sheet, const String &string)
{
-#ifdef ANDROID_INSTRUMENT
- android::TimeCounter::start(android::TimeCounter::CSSParseTimeCounter);
-#endif
setStyleSheet(sheet);
setupParser("@-webkit-keyframe-rule{ ", string, "} ");
cssyyparse(this);
-#ifdef ANDROID_INSTRUMENT
- android::TimeCounter::record(android::TimeCounter::CSSParseTimeCounter, __FUNCTION__);
-#endif
return m_keyframe.release();
}
@@ -440,9 +418,6 @@ bool CSSParser::parseValue(CSSMutableStyleDeclaration* declaration, int property
bool CSSParser::parseValue(CSSMutableStyleDeclaration* declaration, int propertyId, const String& string, bool important)
{
-#ifdef ANDROID_INSTRUMENT
- android::TimeCounter::start(android::TimeCounter::CSSParseTimeCounter);
-#endif
ASSERT(!declaration->stylesheet() || declaration->stylesheet()->isCSSStyleSheet());
setStyleSheet(static_cast<CSSStyleSheet*>(declaration->stylesheet()));
@@ -464,9 +439,6 @@ bool CSSParser::parseValue(CSSMutableStyleDeclaration* declaration, int property
clearProperties();
}
-#ifdef ANDROID_INSTRUMENT
- android::TimeCounter::record(android::TimeCounter::CSSParseTimeCounter, __FUNCTION__);
-#endif
return ok;
}
@@ -499,9 +471,6 @@ bool CSSParser::parseColor(RGBA32& color, const String& string, bool strict)
bool CSSParser::parseColor(CSSMutableStyleDeclaration* declaration, const String& string)
{
-#ifdef ANDROID_INSTRUMENT
- android::TimeCounter::start(android::TimeCounter::CSSParseTimeCounter);
-#endif
ASSERT(!declaration->stylesheet() || declaration->stylesheet()->isCSSStyleSheet());
setStyleSheet(static_cast<CSSStyleSheet*>(declaration->stylesheet()));
@@ -509,9 +478,6 @@ bool CSSParser::parseColor(CSSMutableStyleDeclaration* declaration, const String
cssyyparse(this);
m_rule = 0;
-#ifdef ANDROID_INSTRUMENT
- android::TimeCounter::record(android::TimeCounter::CSSParseTimeCounter, __FUNCTION__);
-#endif
return (m_numParsedProperties && m_parsedProperties[0]->m_id == CSSPropertyColor);
}
@@ -533,9 +499,6 @@ bool CSSParser::parseSystemColor(RGBA32& color, const String& string, Document*
void CSSParser::parseSelector(const String& string, Document* doc, CSSSelectorList& selectorList)
{
-#ifdef ANDROID_INSTRUMENT
- android::TimeCounter::start(android::TimeCounter::CSSParseTimeCounter);
-#endif
RefPtr<CSSStyleSheet> dummyStyleSheet = CSSStyleSheet::create(doc);
setStyleSheet(dummyStyleSheet.get());
@@ -549,18 +512,10 @@ void CSSParser::parseSelector(const String& string, Document* doc, CSSSelectorLi
// The style sheet will be deleted right away, so it won't outlive the document.
ASSERT(dummyStyleSheet->hasOneRef());
-
-#ifdef ANDROID_INSTRUMENT
- android::TimeCounter::record(android::TimeCounter::CSSParseTimeCounter, __FUNCTION__);
-#endif
}
bool CSSParser::parseDeclaration(CSSMutableStyleDeclaration* declaration, const String& string, RefPtr<CSSStyleSourceData>* styleSourceData)
{
-#ifdef ANDROID_INSTRUMENT
- android::TimeCounter::start(android::TimeCounter::CSSParseTimeCounter);
-#endif
-
// Length of the "@-webkit-decls{" prefix.
static const unsigned prefixLength = 15;
@@ -599,9 +554,6 @@ bool CSSParser::parseDeclaration(CSSMutableStyleDeclaration* declaration, const
m_currentRuleData = 0;
m_inStyleRuleOrDeclaration = false;
}
-#ifdef ANDROID_INSTRUMENT
- android::TimeCounter::record(android::TimeCounter::CSSParseTimeCounter, __FUNCTION__);
-#endif
return ok;
}
@@ -610,9 +562,6 @@ bool CSSParser::parseMediaQuery(MediaList* queries, const String& string)
if (string.isEmpty())
return true;
-#ifdef ANDROID_INSTRUMENT
- android::TimeCounter::start(android::TimeCounter::CSSParseTimeCounter);
-#endif
ASSERT(!m_mediaQuery);
// can't use { because tokenizer state switches from mediaquery to initial state when it sees { token.
@@ -626,9 +575,6 @@ bool CSSParser::parseMediaQuery(MediaList* queries, const String& string)
queries->appendMediaQuery(m_mediaQuery.release());
}
-#ifdef ANDROID_INSTRUMENT
- android::TimeCounter::record(android::TimeCounter::CSSParseTimeCounter, __FUNCTION__);
-#endif
return ok;
}
diff --git a/Source/WebCore/css/StyleBase.cpp b/Source/WebCore/css/StyleBase.cpp
index 5d9d79d..93dbda0 100644
--- a/Source/WebCore/css/StyleBase.cpp
+++ b/Source/WebCore/css/StyleBase.cpp
@@ -65,37 +65,4 @@ KURL StyleBase::baseURL() const
return sheet->ownerNode()->document()->baseURL();
}
-#ifdef ANDROID_INSTRUMENT
-static size_t styleSize = 0;
-
-void* StyleBase::operator new(size_t size)
-{
- styleSize += size;
- return ::operator new(size);
-}
-
-void* StyleBase::operator new[](size_t size)
-{
- styleSize += size;
- return ::operator new[](size);
-}
-
-void StyleBase::operator delete(void* p, size_t size)
-{
- styleSize -= size;
- ::operator delete(p);
-}
-
-void StyleBase::operator delete[](void* p, size_t size)
-{
- styleSize -= size;
- ::operator delete[](p);
-}
-
-size_t StyleBase::reportStyleSize()
-{
- return styleSize;
-}
-#endif
-
}
diff --git a/Source/WebCore/css/StyleBase.h b/Source/WebCore/css/StyleBase.h
index 94efa01..63c671e 100644
--- a/Source/WebCore/css/StyleBase.h
+++ b/Source/WebCore/css/StyleBase.h
@@ -72,18 +72,6 @@ namespace WebCore {
StyleSheet* stylesheet();
-#ifdef ANDROID_INSTRUMENT
- // Overridden to prevent the normal new from being called.
- void* operator new(size_t size);
- void* operator new[](size_t size);
-
- // Overridden to prevent the normal delete from being called.
- void operator delete(void* p, size_t size);
- void operator delete[](void* p, size_t size);
-
- static size_t reportStyleSize();
-#endif
-
protected:
StyleBase(StyleBase* parent)
: m_parent(parent)
diff --git a/Source/WebCore/dom/Document.cpp b/Source/WebCore/dom/Document.cpp
index 6e21dc3..5bdf9dd 100644
--- a/Source/WebCore/dom/Document.cpp
+++ b/Source/WebCore/dom/Document.cpp
@@ -194,10 +194,6 @@
#include "HTMLTextAreaElement.h"
#endif
-#ifdef ANDROID_INSTRUMENT
-#include "TimeCounter.h"
-#endif
-
#if ENABLE(TOUCH_EVENTS)
#if USE(V8)
#include "RuntimeEnabledFeatures.h"
@@ -1475,10 +1471,6 @@ void Document::recalcStyle(StyleChange change)
frameView->beginDeferredRepaints();
}
-#ifdef ANDROID_INSTRUMENT
- android::TimeCounter::start(android::TimeCounter::CalculateStyleTimeCounter);
-#endif
-
ASSERT(!renderer() || renderArena());
if (!renderer() || !renderArena())
goto bail_out;
@@ -1500,10 +1492,6 @@ void Document::recalcStyle(StyleChange change)
if (change >= Inherit || n->childNeedsStyleRecalc() || n->needsStyleRecalc())
n->recalcStyle(change);
-#ifdef ANDROID_INSTRUMENT
- android::TimeCounter::record(android::TimeCounter::CalculateStyleTimeCounter, __FUNCTION__);
-#endif
-
#if USE(ACCELERATED_COMPOSITING)
if (view()) {
bool layoutPending = view()->layoutPending() || renderer()->needsLayout();
diff --git a/Source/WebCore/dom/Node.cpp b/Source/WebCore/dom/Node.cpp
index 1fd4b92..0967ef5 100644
--- a/Source/WebCore/dom/Node.cpp
+++ b/Source/WebCore/dom/Node.cpp
@@ -2498,39 +2498,6 @@ Node* Node::enclosingLinkEventParentOrSelf()
return 0;
}
-#ifdef ANDROID_INSTRUMENT
-static size_t nodeSize = 0;
-
-void* Node::operator new(size_t size)
-{
- nodeSize += size;
- return ::operator new(size);
-}
-
-void* Node::operator new[](size_t size)
-{
- nodeSize += size;
- return ::operator new[](size);
-}
-
-void Node::operator delete(void* p, size_t size)
-{
- nodeSize -= size;
- ::operator delete(p);
-}
-
-void Node::operator delete[](void* p, size_t size)
-{
- nodeSize -= size;
- ::operator delete[](p);
-}
-
-size_t Node::reportDOMNodesSize()
-{
- return nodeSize;
-}
-#endif
-
// --------
ScriptExecutionContext* Node::scriptExecutionContext() const
diff --git a/Source/WebCore/dom/Node.h b/Source/WebCore/dom/Node.h
index 1fe30ad..08b1921 100644
--- a/Source/WebCore/dom/Node.h
+++ b/Source/WebCore/dom/Node.h
@@ -528,18 +528,6 @@ public:
unsigned short compareDocumentPosition(Node*);
-#ifdef ANDROID_INSTRUMENT
- // Overridden to prevent the normal new from being called.
- void* operator new(size_t size);
- void* operator new[](size_t size);
-
- // Overridden to prevent the normal delete from being called.
- void operator delete(void* p, size_t size);
- void operator delete[](void* p, size_t size);
-
- static size_t reportDOMNodesSize();
-#endif
-
virtual Node* toNode() { return this; }
virtual InputElement* toInputElement();
diff --git a/Source/WebCore/dom/ProcessingInstruction.cpp b/Source/WebCore/dom/ProcessingInstruction.cpp
index 7135644..30111d8 100644
--- a/Source/WebCore/dom/ProcessingInstruction.cpp
+++ b/Source/WebCore/dom/ProcessingInstruction.cpp
@@ -297,26 +297,4 @@ void ProcessingInstruction::finishParsingChildren()
ContainerNode::finishParsingChildren();
}
-#ifdef ANDROID_INSTRUMENT
-void* ProcessingInstruction::operator new(size_t size)
-{
- return Node::operator new(size);
-}
-
-void* ProcessingInstruction::operator new[](size_t size)
-{
- return Node::operator new[](size);
-}
-
-void ProcessingInstruction::operator delete(void* p, size_t size)
-{
- Node::operator delete(p, size);
-}
-
-void ProcessingInstruction::operator delete[](void* p, size_t size)
-{
- Node::operator delete[](p, size);
-}
-#endif
-
} // namespace
diff --git a/Source/WebCore/dom/ProcessingInstruction.h b/Source/WebCore/dom/ProcessingInstruction.h
index fd98566..1be8710 100644
--- a/Source/WebCore/dom/ProcessingInstruction.h
+++ b/Source/WebCore/dom/ProcessingInstruction.h
@@ -56,14 +56,6 @@ public:
private:
ProcessingInstruction(Document*, const String& target, const String& data);
-#ifdef ANDROID_INSTRUMENT
- // Overridden to resolve the ambiguous
- void* operator new(size_t size);
- void* operator new[](size_t size);
- void operator delete(void* p, size_t size);
- void operator delete[](void* p, size_t size);
-#endif
-
virtual String nodeName() const;
virtual NodeType nodeType() const;
virtual String nodeValue() const;
diff --git a/Source/WebCore/html/HTMLCanvasElement.h b/Source/WebCore/html/HTMLCanvasElement.h
index 9eab209..207c384 100644
--- a/Source/WebCore/html/HTMLCanvasElement.h
+++ b/Source/WebCore/html/HTMLCanvasElement.h
@@ -128,22 +128,6 @@ public:
void makeRenderingResultsAvailable();
-#ifdef ANDROID_INSTRUMENT
- void* operator new(size_t size) {
- return HTMLElement::operator new(size);
- }
- void* operator new[](size_t size) {
- return HTMLElement::operator new[](size);
- }
-
- void operator delete(void* p, size_t size) {
- HTMLElement::operator delete(p, size);
- }
- void operator delete[](void* p, size_t size) {
- HTMLElement::operator delete[](p, size);
- }
-#endif
-
private:
HTMLCanvasElement(const QualifiedName&, Document*);
diff --git a/Source/WebCore/html/HTMLDocument.cpp b/Source/WebCore/html/HTMLDocument.cpp
index dd41514..a1be93d 100644
--- a/Source/WebCore/html/HTMLDocument.cpp
+++ b/Source/WebCore/html/HTMLDocument.cpp
@@ -438,26 +438,4 @@ bool HTMLDocument::isFrameSet() const
return bodyElement && bodyElement->hasTagName(framesetTag);
}
-#ifdef ANDROID_INSTRUMENT
-void* HTMLDocument::operator new(size_t size)
-{
- return Node::operator new(size);
-}
-
-void* HTMLDocument::operator new[](size_t size)
-{
- return Node::operator new[](size);
-}
-
-void HTMLDocument::operator delete(void* p, size_t size)
-{
- Node::operator delete(p, size);
-}
-
-void HTMLDocument::operator delete[](void* p, size_t size)
-{
- Node::operator delete[](p, size);
-}
-#endif
-
}
diff --git a/Source/WebCore/html/HTMLDocument.h b/Source/WebCore/html/HTMLDocument.h
index 3310b71..d39f392 100644
--- a/Source/WebCore/html/HTMLDocument.h
+++ b/Source/WebCore/html/HTMLDocument.h
@@ -82,14 +82,6 @@ public:
protected:
HTMLDocument(Frame*, const KURL&);
-#ifdef ANDROID_INSTRUMENT
- // Overridden to resolve the ambiguous
- void* operator new(size_t size);
- void* operator new[](size_t size);
- void operator delete(void* p, size_t size);
- void operator delete[](void* p, size_t size);
-#endif
-
private:
virtual PassRefPtr<Element> createElement(const AtomicString& tagName, ExceptionCode&);
diff --git a/Source/WebCore/html/HTMLLinkElement.cpp b/Source/WebCore/html/HTMLLinkElement.cpp
index 7cbf38b..4673109 100644
--- a/Source/WebCore/html/HTMLLinkElement.cpp
+++ b/Source/WebCore/html/HTMLLinkElement.cpp
@@ -504,28 +504,6 @@ void HTMLLinkElement::addSubresourceAttributeURLs(ListHashSet<KURL>& urls) const
styleSheet->addSubresourceStyleURLs(urls);
}
-#ifdef ANDROID_INSTRUMENT
-void* HTMLLinkElement::operator new(size_t size)
-{
- return Node::operator new(size);
-}
-
-void* HTMLLinkElement::operator new[](size_t size)
-{
- return Node::operator new[](size);
-}
-
-void HTMLLinkElement::operator delete(void* p, size_t size)
-{
- Node::operator delete(p, size);
-}
-
-void HTMLLinkElement::operator delete[](void* p, size_t size)
-{
- Node::operator delete[](p, size);
-}
-#endif
-
void HTMLLinkElement::addPendingSheet(PendingSheetType type)
{
if (type <= m_pendingSheetType)
diff --git a/Source/WebCore/html/HTMLLinkElement.h b/Source/WebCore/html/HTMLLinkElement.h
index f602d38..1a6eba9 100644
--- a/Source/WebCore/html/HTMLLinkElement.h
+++ b/Source/WebCore/html/HTMLLinkElement.h
@@ -120,14 +120,6 @@ private:
void addPendingSheet(PendingSheetType);
void removePendingSheet();
-#ifdef ANDROID_INSTRUMENT
- // Overridden to resolve the ambiguous
- void* operator new(size_t size);
- void* operator new[](size_t size);
- void operator delete(void* p, size_t size);
- void operator delete[](void* p, size_t size);
-#endif
-
private:
HTMLLinkElement(const QualifiedName&, Document*, bool createdByParser);
diff --git a/Source/WebCore/html/parser/HTMLDocumentParser.cpp b/Source/WebCore/html/parser/HTMLDocumentParser.cpp
index 8f95cc5..46dddf0 100644
--- a/Source/WebCore/html/parser/HTMLDocumentParser.cpp
+++ b/Source/WebCore/html/parser/HTMLDocumentParser.cpp
@@ -41,10 +41,6 @@
#include "NestingLevelIncrementer.h"
#include "Settings.h"
-#ifdef ANDROID_INSTRUMENT
-#include "TimeCounter.h"
-#endif
-
namespace WebCore {
using namespace HTMLNames;
@@ -318,10 +314,6 @@ void HTMLDocumentParser::insert(const SegmentedString& source)
if (isStopped())
return;
-#ifdef ANDROID_INSTRUMENT
- android::TimeCounter::start(android::TimeCounter::ParsingTimeCounter);
-#endif
-
// pumpTokenizer can cause this parser to be detached from the Document,
// but we need to ensure it isn't deleted yet.
RefPtr<HTMLDocumentParser> protect(this);
@@ -369,18 +361,12 @@ void HTMLDocumentParser::append(const SegmentedString& source)
// We've gotten data off the network in a nested write.
// We don't want to consume any more of the input stream now. Do
// not worry. We'll consume this data in a less-nested write().
-#ifdef ANDROID_INSTRUMENT
- android::TimeCounter::record(android::TimeCounter::ParsingTimeCounter, __FUNCTION__);
-#endif
return;
}
pumpTokenizerIfPossible(AllowYield);
endIfDelayed();
-#ifdef ANDROID_INSTRUMENT
- android::TimeCounter::record(android::TimeCounter::ParsingTimeCounter, __FUNCTION__);
-#endif
}
void HTMLDocumentParser::end()
diff --git a/Source/WebCore/loader/FrameLoader.cpp b/Source/WebCore/loader/FrameLoader.cpp
index 85b1541..ee0397b 100644
--- a/Source/WebCore/loader/FrameLoader.cpp
+++ b/Source/WebCore/loader/FrameLoader.cpp
@@ -119,11 +119,6 @@
#include "ArchiveFactory.h"
#endif
-#ifdef ANDROID_INSTRUMENT
-#include "TimeCounter.h"
-#include "RenderArena.h"
-#endif
-
namespace WebCore {
using namespace HTMLNames;
@@ -1115,10 +1110,6 @@ void FrameLoader::handleFallbackContent()
void FrameLoader::provisionalLoadStarted()
{
-#ifdef ANDROID_INSTRUMENT
- if (!m_frame->tree()->parent())
- android::TimeCounter::reset();
-#endif
if (m_stateMachine.firstLayoutDone())
m_stateMachine.advanceTo(FrameLoaderStateMachine::CommittedFirstRealLoad);
m_frame->navigationScheduler()->cancel(true);
@@ -2499,12 +2490,6 @@ void FrameLoader::checkLoadCompleteForThisFrame()
if (Page* page = m_frame->page())
page->progress()->progressCompleted(m_frame);
-
-#ifdef ANDROID_INSTRUMENT
- if (!m_frame->tree()->parent() && m_frame->document()->renderArena())
- android::TimeCounter::report(m_URL, cache()->getLiveSize(), cache()->getDeadSize(),
- m_frame->document()->renderArena()->reportPoolSize());
-#endif
return;
}
diff --git a/Source/WebCore/loader/cache/MemoryCache.h b/Source/WebCore/loader/cache/MemoryCache.h
index a092eac..c9b91f9 100644
--- a/Source/WebCore/loader/cache/MemoryCache.h
+++ b/Source/WebCore/loader/cache/MemoryCache.h
@@ -171,12 +171,6 @@ public:
void removeResourcesWithOrigin(SecurityOrigin*);
void getOriginsWithCache(SecurityOriginSet& origins);
-#ifdef ANDROID_INSTRUMENT
- unsigned getLiveSize() { return m_liveSize; }
- unsigned getDeadSize() { return m_deadSize; }
-#endif
-
-
private:
MemoryCache();
~MemoryCache(); // Not implemented to make sure nobody accidentally calls delete -- WebCore does not delete singletons.
diff --git a/Source/WebCore/page/FrameView.cpp b/Source/WebCore/page/FrameView.cpp
index 49a7d0c..a79910b 100644
--- a/Source/WebCore/page/FrameView.cpp
+++ b/Source/WebCore/page/FrameView.cpp
@@ -62,11 +62,6 @@
#include "TextResourceDecoder.h"
#include <wtf/CurrentTime.h>
-#ifdef ANDROID_INSTRUMENT
-#include "FrameTree.h"
-#include "TimeCounter.h"
-#endif
-
#if USE(ACCELERATED_COMPOSITING)
#include "RenderLayerCompositor.h"
#endif
@@ -872,11 +867,6 @@ void FrameView::layout(bool allowSubtree)
return;
}
-#ifdef ANDROID_INSTRUMENT
- if (!m_frame->tree() || !m_frame->tree()->parent())
- android::TimeCounter::start(android::TimeCounter::LayoutTimeCounter);
-#endif
-
m_nestedLayoutCount++;
if (!m_layoutRoot) {
@@ -1014,10 +1004,6 @@ void FrameView::layout(bool allowSubtree)
updateDashboardRegions();
#endif
-#ifdef ANDROID_INSTRUMENT
- if (!m_frame->tree()->parent())
- android::TimeCounter::record(android::TimeCounter::LayoutTimeCounter, __FUNCTION__);
-#endif
ASSERT(!root->needsLayout());
updateCanBlitOnScrollRecursively();
diff --git a/Source/WebCore/platform/Arena.cpp b/Source/WebCore/platform/Arena.cpp
index 231e1b6..33980ed 100644
--- a/Source/WebCore/platform/Arena.cpp
+++ b/Source/WebCore/platform/Arena.cpp
@@ -255,16 +255,4 @@ void FinishArenaPool(ArenaPool *pool)
FreeArenaList(pool, &pool->first, true);
}
-#ifdef ANDROID_INSTRUMENT
-size_t ReportPoolSize(const ArenaPool* pool)
-{
- size_t total = 0;
- for (const Arena *a = &pool->first; a; a = a->next)
- total += (a->limit - a->base);
- for (const Arena *fa = arena_freelist; fa; fa = fa->next )
- total += (fa->limit - fa->base);
- return total;
-}
-#endif
-
}
diff --git a/Source/WebCore/platform/Arena.h b/Source/WebCore/platform/Arena.h
index e937955..06e09f2 100644
--- a/Source/WebCore/platform/Arena.h
+++ b/Source/WebCore/platform/Arena.h
@@ -134,10 +134,6 @@ void* ArenaAllocate(ArenaPool *pool, unsigned int nb);
fastFree(a); \
(a) = 0;
-#ifdef ANDROID_INSTRUMENT
-size_t ReportPoolSize(const ArenaPool* pool);
-#endif
-
}
#endif
diff --git a/Source/WebCore/rendering/RenderArena.cpp b/Source/WebCore/rendering/RenderArena.cpp
index 57ed978..e15101f 100644
--- a/Source/WebCore/rendering/RenderArena.cpp
+++ b/Source/WebCore/rendering/RenderArena.cpp
@@ -136,11 +136,4 @@ void RenderArena::free(size_t size, void* ptr)
#endif
}
-#ifdef ANDROID_INSTRUMENT
-size_t RenderArena::reportPoolSize() const
-{
- return ReportPoolSize(&m_pool);
-}
-#endif
-
} // namespace WebCore
diff --git a/Source/WebCore/rendering/RenderArena.h b/Source/WebCore/rendering/RenderArena.h
index 5d2559a..e1ff535 100644
--- a/Source/WebCore/rendering/RenderArena.h
+++ b/Source/WebCore/rendering/RenderArena.h
@@ -53,10 +53,6 @@ public:
void* allocate(size_t);
void free(size_t, void*);
-#ifdef ANDROID_INSTRUMENT
- size_t reportPoolSize() const;
-#endif
-
private:
// Underlying arena pool
ArenaPool m_pool;
diff --git a/Source/WebCore/svg/SVGFontFaceUriElement.h b/Source/WebCore/svg/SVGFontFaceUriElement.h
index ad9ba97..3806315 100644
--- a/Source/WebCore/svg/SVGFontFaceUriElement.h
+++ b/Source/WebCore/svg/SVGFontFaceUriElement.h
@@ -45,22 +45,6 @@ private:
virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
virtual void insertedIntoDocument();
-#ifdef ANDROID_INSTRUMENT
- void* operator new(size_t size) {
- return SVGElement::operator new(size);
- }
- void* operator new[](size_t size) {
- return SVGElement::operator new[](size);
- }
-
- void operator delete(void* p, size_t size) {
- SVGElement::operator delete(p, size);
- }
- void operator delete[](void* p, size_t size) {
- SVGElement::operator delete[](p, size);
- }
-#endif
-
void loadFont();
CachedResourceHandle<CachedFont> m_cachedFont;
diff --git a/Source/WebCore/xml/XSLImportRule.h b/Source/WebCore/xml/XSLImportRule.h
index 3c5939d..5c0ca8a 100644
--- a/Source/WebCore/xml/XSLImportRule.h
+++ b/Source/WebCore/xml/XSLImportRule.h
@@ -52,22 +52,6 @@ public:
bool isLoading();
void loadSheet();
-#ifdef ANDROID_INSTRUMENT
- void* operator new(size_t size) {
- return StyleBase::operator new(size);
- }
- void* operator new[](size_t size) {
- return StyleBase::operator new[](size);
- }
-
- void operator delete(void* p, size_t size) {
- StyleBase::operator delete(p, size);
- }
- void operator delete[](void* p, size_t size) {
- StyleBase::operator delete[](p, size);
- }
-#endif
-
private:
XSLImportRule(XSLStyleSheet* parentSheet, const String& href);
diff --git a/Source/WebKit/Android.mk b/Source/WebKit/Android.mk
index bbe212c..fb6ee31 100644
--- a/Source/WebKit/Android.mk
+++ b/Source/WebKit/Android.mk
@@ -31,7 +31,6 @@ LOCAL_SRC_FILES := \
android/WebCoreSupport/PlatformBridge.cpp \
android/WebCoreSupport/ResourceLoaderAndroid.cpp \
android/WebCoreSupport/UrlInterceptResponse.cpp \
- android/WebCoreSupport/V8Counters.cpp
ifeq ($(HTTP_STACK),chrome)
LOCAL_SRC_FILES += \
@@ -55,7 +54,6 @@ LOCAL_SRC_FILES += \
android/RenderSkinMediaButton.cpp \
android/RenderSkinNinePatch.cpp \
android/RenderSkinRadio.cpp \
- android/TimeCounter.cpp \
\
android/benchmark/Intercept.cpp \
android/benchmark/MyJavaVM.cpp \
diff --git a/Source/WebKit/android/TimeCounter.cpp b/Source/WebKit/android/TimeCounter.cpp
deleted file mode 100644
index 2393f8a..0000000
--- a/Source/WebKit/android/TimeCounter.cpp
+++ /dev/null
@@ -1,198 +0,0 @@
-/*
- * Copyright 2009, The Android Open Source Project
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#define LOG_TAG "WebCore"
-
-#include "config.h"
-#include "TimeCounter.h"
-
-#include "MemoryCache.h"
-#include "KURL.h"
-#include "Node.h"
-#include "SystemTime.h"
-#include "StyleBase.h"
-#include <sys/time.h>
-#include <time.h>
-#include <utils/Log.h>
-#include <wtf/CurrentTime.h>
-#include <wtf/text/CString.h>
-
-#if USE(JSC)
-#include "JSDOMWindow.h"
-#include <runtime/JSGlobalObject.h>
-#include <runtime/JSLock.h>
-#endif
-
-using namespace WebCore;
-using namespace WTF;
-using namespace JSC;
-
-namespace android {
-
-uint32_t getThreadMsec()
-{
-#if defined(HAVE_POSIX_CLOCKS)
- struct timespec tm;
-
- clock_gettime(CLOCK_THREAD_CPUTIME_ID, &tm);
- return tm.tv_sec * 1000LL + tm.tv_nsec / 1000000;
-#else
- struct timeval now;
- struct timezone zone;
-
- gettimeofday(&now, &zone);
- return now.tv_sec * 1000LL + now.tv_usec / 1000;
-#endif
-}
-
-#ifdef ANDROID_INSTRUMENT
-
-static double sStartTotalTime;
-static uint32_t sStartThreadTime;
-static double sLastTotalTime;
-static uint32_t sLastThreadTime;
-
-uint32_t TimeCounter::sStartWebCoreThreadTime;
-uint32_t TimeCounter::sEndWebCoreThreadTime;
-bool TimeCounter::sRecordWebCoreTime;
-uint32_t TimeCounter::sTotalTimeUsed[TimeCounter::TotalTimeCounterCount];
-uint32_t TimeCounter::sLastTimeUsed[TimeCounter::TotalTimeCounterCount];
-uint32_t TimeCounter::sCounter[TimeCounter::TotalTimeCounterCount];
-uint32_t TimeCounter::sLastCounter[TimeCounter::TotalTimeCounterCount];
-uint32_t TimeCounter::sStartTime[TimeCounter::TotalTimeCounterCount];
-
-int QemuTracerAuto::reentry_count = 0;
-
-static const char* timeCounterNames[] = {
- "css parsing",
- "javascript",
- "javascript init",
- "javascript parsing",
- "javascript execution",
- "calculate style",
- "Java callback (frame bridge)",
- "parsing (may include calcStyle, Java callback or inline script execution)",
- "layout",
- "native 1 (frame bridge)",
- "native 2 (resource load)",
- "native 3 (shared timer)",
- "build nav (webview core)",
- "record content (webview core)",
- "native 4 (webview core)",
- "draw content (webview ui)",
-};
-
-void TimeCounter::record(enum Type type, const char* functionName)
-{
- recordNoCounter(type, functionName);
- sCounter[type]++;
-}
-
-void TimeCounter::recordNoCounter(enum Type type, const char* functionName)
-{
- uint32_t time = sEndWebCoreThreadTime = getThreadMsec();
- uint32_t elapsed = time - sStartTime[type];
- sTotalTimeUsed[type] += elapsed;
- if (elapsed > 1000)
- LOGW("***** %s() used %d ms\n", functionName, elapsed);
-}
-
-void TimeCounter::report(const KURL& url, int live, int dead, size_t arenaSize)
-{
- String urlString = url;
- int totalTime = static_cast<int>((currentTime() - sStartTotalTime) * 1000);
- int threadTime = getThreadMsec() - sStartThreadTime;
- LOGD("*-* Total load time: %d ms, thread time: %d ms for %s\n",
- totalTime, threadTime, urlString.utf8().data());
- for (Type type = (Type) 0; type < TotalTimeCounterCount; type
- = (Type) (type + 1)) {
- char scratch[256];
- int index = sprintf(scratch, "*-* Total %s time: %d ms",
- timeCounterNames[type], sTotalTimeUsed[type]);
- if (sCounter[type] > 0)
- sprintf(&scratch[index], " called %d times", sCounter[type]);
- LOGD("%s", scratch);
- }
- LOGD("Current cache has %d bytes live and %d bytes dead", live, dead);
- LOGD("Current render arena takes %d bytes", arenaSize);
-#if USE(JSC)
- JSLock lock(false);
- Heap::Statistics jsHeapStatistics = JSDOMWindow::commonJSGlobalData()->heap.statistics();
- LOGD("Current JavaScript heap size is %d and has %d bytes free",
- jsHeapStatistics.size, jsHeapStatistics.free);
-#endif
- LOGD("Current CSS styles use %d bytes", StyleBase::reportStyleSize());
- LOGD("Current DOM nodes use %d bytes", WebCore::Node::reportDOMNodesSize());
-}
-
-void TimeCounter::reportNow()
-{
- double current = currentTime();
- uint32_t currentThread = getThreadMsec();
- int elapsedTime = static_cast<int>((current - sLastTotalTime) * 1000);
- int elapsedThreadTime = currentThread - sLastThreadTime;
- LOGD("*-* Elapsed time: %d ms, ui thread time: %d ms, webcore thread time:"
- " %d ms\n", elapsedTime, elapsedThreadTime, sEndWebCoreThreadTime -
- sStartWebCoreThreadTime);
- for (Type type = (Type) 0; type < TotalTimeCounterCount; type
- = (Type) (type + 1)) {
- if (sTotalTimeUsed[type] == sLastTimeUsed[type])
- continue;
- char scratch[256];
- int index = sprintf(scratch, "*-* Diff %s time: %d ms",
- timeCounterNames[type], sTotalTimeUsed[type] - sLastTimeUsed[type]);
- if (sCounter[type] > sLastCounter[type])
- sprintf(&scratch[index], " called %d times", sCounter[type]
- - sLastCounter[type]);
- LOGD("%s", scratch);
- }
- memcpy(sLastTimeUsed, sTotalTimeUsed, sizeof(sTotalTimeUsed));
- memcpy(sLastCounter, sCounter, sizeof(sCounter));
- sLastTotalTime = current;
- sLastThreadTime = currentThread;
- sRecordWebCoreTime = true;
-}
-
-void TimeCounter::reset() {
- bzero(sTotalTimeUsed, sizeof(sTotalTimeUsed));
- bzero(sCounter, sizeof(sCounter));
- LOGD("*-* Start browser instrument\n");
- sStartTotalTime = currentTime();
- sStartThreadTime = getThreadMsec();
-}
-
-void TimeCounter::start(enum Type type)
-{
- uint32_t time = getThreadMsec();
- if (sRecordWebCoreTime) {
- sStartWebCoreThreadTime = time;
- sRecordWebCoreTime = false;
- }
- sStartTime[type] = time;
-}
-
-#endif // ANDROID_INSTRUMENT
-
-}
diff --git a/Source/WebKit/android/TimeCounter.h b/Source/WebKit/android/TimeCounter.h
deleted file mode 100644
index ecede27..0000000
--- a/Source/WebKit/android/TimeCounter.h
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * Copyright 2009, The Android Open Source Project
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef TimeCounter_h
-#define TimeCounter_h
-
-#include "hardware_legacy/qemu_tracing.h"
-
-namespace WebCore {
-
-class KURL;
-
-}
-
-namespace android {
-
-uint32_t getThreadMsec();
-
-#ifdef ANDROID_INSTRUMENT
-
-class TimeCounter {
-public:
- enum Type {
- // function base counters
- CSSParseTimeCounter,
- JavaScriptTimeCounter,
- JavaScriptInitTimeCounter,
- JavaScriptParseTimeCounter,
- JavaScriptExecuteTimeCounter,
- CalculateStyleTimeCounter,
- JavaCallbackTimeCounter,
- ParsingTimeCounter,
- LayoutTimeCounter,
- // file base counters
- NativeCallbackTimeCounter, // WebCoreFrameBridge.cpp
- ResourceTimeCounter, // WebCoreResourceLoader.cpp
- SharedTimerTimeCounter, // JavaBridge.cpp
- WebViewCoreBuildNavTimeCounter,
- WebViewCoreRecordTimeCounter,
- WebViewCoreTimeCounter, // WebViewCore.cpp
- WebViewUIDrawTimeCounter,
- TotalTimeCounterCount
- };
-
- static void record(enum Type type, const char* functionName);
- static void recordNoCounter(enum Type type, const char* functionName);
- static void report(const WebCore::KURL& , int live, int dead, size_t arenaSize);
- static void reportNow();
- static void reset();
- static void start(enum Type type);
-private:
- static uint32_t sStartWebCoreThreadTime;
- static uint32_t sEndWebCoreThreadTime;
- static bool sRecordWebCoreTime;
- static uint32_t sTotalTimeUsed[TotalTimeCounterCount];
- static uint32_t sLastTimeUsed[TotalTimeCounterCount];
- static uint32_t sCounter[TotalTimeCounterCount];
- static uint32_t sLastCounter[TotalTimeCounterCount];
- static uint32_t sStartTime[TotalTimeCounterCount];
- friend class TimeCounterAuto;
-};
-
-class TimeCounterAuto {
-public:
- TimeCounterAuto(TimeCounter::Type type) :
- m_type(type), m_startTime(getThreadMsec()) {}
- ~TimeCounterAuto() {
- uint32_t time = getThreadMsec();
- TimeCounter::sEndWebCoreThreadTime = time;
- TimeCounter::sTotalTimeUsed[m_type] += time - m_startTime;
- TimeCounter::sCounter[m_type]++;
- }
-private:
- TimeCounter::Type m_type;
- uint32_t m_startTime;
-};
-
-class QemuTracerAuto {
-public:
- QemuTracerAuto() {
- if (!reentry_count)
- qemu_start_tracing();
- reentry_count++;
- }
-
- ~QemuTracerAuto() {
- reentry_count--;
- if (!reentry_count)
- qemu_stop_tracing();
- }
-private:
- static int reentry_count;
-};
-#endif // ANDROID_INSTRUMENT
-
-}
-
-#endif
diff --git a/Source/WebKit/android/WebCoreSupport/V8Counters.cpp b/Source/WebKit/android/WebCoreSupport/V8Counters.cpp
deleted file mode 100644
index d164f9a..0000000
--- a/Source/WebKit/android/WebCoreSupport/V8Counters.cpp
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Copyright 2010, The Android Open Source Project
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-
-#ifdef ANDROID_INSTRUMENT
-
-#define LOG_TAG "WebCore"
-
-#include "config.h"
-#include "V8Counters.h"
-
-#include "NotImplemented.h"
-#include <utils/Log.h>
-#include <wtf/text/CString.h>
-#include <wtf/text/StringHash.h>
-
-#if USE(V8)
-
-namespace WebCore {
-
-V8Counters::Counter::Counter(bool isHistogram)
- : m_count(0), m_sampleTotal(0), m_isHistogram(isHistogram) { }
-
-void V8Counters::Counter::addSample(int sample)
-{
- m_count++;
- m_sampleTotal += sample;
-}
-
-HashMap<String, V8Counters::Counter*> V8Counters::m_counters;
-
-// static
-int* V8Counters::counterForName(const char* name)
-{
- Counter* counter = m_counters.get(name);
- if (!counter) {
- counter = new Counter(false);
- m_counters.add(name, counter);
- }
- return *counter;
-}
-
-// static
-void* V8Counters::createHistogram(const char* name, int min, int max,
- size_t buckets)
-{
- Counter* counter = new Counter(true);
- m_counters.add(name, counter);
- return counter;
-}
-
-// static
-void V8Counters::addHistogramSample(void* histogram, int sample)
-{
- Counter* counter = reinterpret_cast<Counter*>(histogram);
- counter->addSample(sample);
-}
-
-// static
-void V8Counters::initCounters()
-{
- static bool isInitialized = false;
- if (!isInitialized) {
- v8::V8::SetCounterFunction(counterForName);
- v8::V8::SetCreateHistogramFunction(createHistogram);
- v8::V8::SetAddHistogramSampleFunction(addHistogramSample);
- isInitialized = true;
- }
-}
-
-// static
-void V8Counters::dumpCounters()
-{
- LOGD("+----------------------------------------+-------------+\n");
- LOGD("| Name | Value |\n");
- LOGD("+----------------------------------------+-------------+\n");
- typedef HashMap<String, V8Counters::Counter*>::iterator CounterIterator;
- for (CounterIterator iter = m_counters.begin(); iter != m_counters.end(); ++iter) {
- Counter* counter = iter->second;
- if (counter->isHistogram()) {
- LOGD("| c:%-36s | %11i |\n", iter->first.latin1().data(), counter->count());
- LOGD("| t:%-36s | %11i |\n", iter->first.latin1().data(), counter->sampleTotal());
- } else {
- LOGD("| %-38s | %11i |\n", iter->first.latin1().data(), counter->count());
- }
- }
- LOGD("+----------------------------------------+-------------+\n");
-}
-
-}
-
-#endif // ANDROID_INSTRUMENT
-
-#endif // USE(V8)
diff --git a/Source/WebKit/android/WebCoreSupport/V8Counters.h b/Source/WebKit/android/WebCoreSupport/V8Counters.h
deleted file mode 100644
index 499b856..0000000
--- a/Source/WebKit/android/WebCoreSupport/V8Counters.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright 2010, The Android Open Source Project
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef V8Counters_h
-#define V8Counters_h
-
-#if USE(V8)
-
-#ifdef ANDROID_INSTRUMENT
-
-#include <PlatformString.h>
-#include <v8.h>
-#include <wtf/HashMap.h>
-
-namespace WebCore {
-
-class V8Counters {
-public:
- // Counter callbacks, see v8.h
- static int* counterForName(const char* name);
-
- static void* createHistogram(const char* name,
- int min,
- int max,
- size_t buckets);
-
- static void addHistogramSample(void* histogram, int sample);
-
- static void initCounters();
- static void dumpCounters();
-private:
- class Counter {
- public:
- Counter(bool isHistogram);
-
- int count() { return m_count; }
- int sampleTotal() { return m_sampleTotal; }
- bool isHistogram() { return m_isHistogram; }
- void addSample(int32_t sample);
-
- operator int*() { return &m_count; }
- private:
- int m_count;
- int m_sampleTotal;
- bool m_isHistogram;
- };
-
- static HashMap<String, Counter*> m_counters;
-};
-
-}
-
-#endif // ANDROID_INSTRUMENT
-#endif // USE(V8)
-#endif // V8Counters_h
diff --git a/Source/WebKit/android/jni/JavaBridge.cpp b/Source/WebKit/android/jni/JavaBridge.cpp
index 91f1e07..60f4523 100644
--- a/Source/WebKit/android/jni/JavaBridge.cpp
+++ b/Source/WebKit/android/jni/JavaBridge.cpp
@@ -41,9 +41,6 @@
#include "PluginDatabase.h"
#include "Timer.h"
#include "TimerClient.h"
-#ifdef ANDROID_INSTRUMENT
-#include "TimeCounter.h"
-#endif
#include "WebCache.h"
#include "WebCoreJni.h"
@@ -374,14 +371,8 @@ void JavaBridge::SharedTimerFired(JNIEnv* env, jobject)
{
if (sSharedTimerFiredCallback)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounter::start(TimeCounter::SharedTimerTimeCounter);
-#endif
SkAutoMemoryUsageProbe mup("JavaBridge::sharedTimerFired");
sSharedTimerFiredCallback();
-#ifdef ANDROID_INSTRUMENT
- TimeCounter::record(TimeCounter::SharedTimerTimeCounter, __FUNCTION__);
-#endif
}
}
diff --git a/Source/WebKit/android/jni/PictureSet.cpp b/Source/WebKit/android/jni/PictureSet.cpp
index 4d9d16c..1bd72bd 100644
--- a/Source/WebKit/android/jni/PictureSet.cpp
+++ b/Source/WebKit/android/jni/PictureSet.cpp
@@ -36,7 +36,6 @@
#include "SkRect.h"
#include "SkRegion.h"
#include "SkStream.h"
-#include "TimeCounter.h"
#define MAX_DRAW_TIME 100
#define MIN_SPLITTABLE 400
@@ -693,6 +692,22 @@ void PictureSet::clear()
mWidth = mHeight = 0;
}
+uint32_t getThreadMsec()
+{
+#if defined(HAVE_POSIX_CLOCKS)
+ struct timespec tm;
+
+ clock_gettime(CLOCK_THREAD_CPUTIME_ID, &tm);
+ return tm.tv_sec * 1000LL + tm.tv_nsec / 1000000;
+#else
+ struct timeval now;
+ struct timezone zone;
+
+ gettimeofday(&now, &zone);
+ return now.tv_sec * 1000LL + now.tv_usec / 1000;
+#endif
+}
+
bool PictureSet::draw(SkCanvas* canvas)
{
#ifdef FAST_PICTURESET
diff --git a/Source/WebKit/android/jni/WebCoreFrameBridge.cpp b/Source/WebKit/android/jni/WebCoreFrameBridge.cpp
index ed2a326..609ac79 100644
--- a/Source/WebKit/android/jni/WebCoreFrameBridge.cpp
+++ b/Source/WebKit/android/jni/WebCoreFrameBridge.cpp
@@ -116,13 +116,8 @@
#elif USE(V8)
#include "JavaNPObjectV8.h"
#include "JavaInstanceJobjectV8.h"
-#include "V8Counters.h"
#endif // USE(JSC)
-#ifdef ANDROID_INSTRUMENT
-#include "TimeCounter.h"
-#endif
-
#if ENABLE(WEB_AUTOFILL)
#include "autofill/WebAutofill.h"
#endif
@@ -422,9 +417,6 @@ WebFrame::startLoadingResource(WebCore::ResourceHandle* loader,
bool mainResource,
bool synchronous)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter);
-#endif
ALOGV("::WebCore:: startLoadingResource(%p, %s)",
loader, request.url().string().latin1().data());
@@ -510,9 +502,6 @@ WebFrame::startLoadingResource(WebCore::ResourceHandle* loader,
UrlInterceptResponse*
WebFrame::shouldInterceptRequest(const WTF::String& url)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter);
-#endif
ALOGV("::WebCore:: shouldInterceptRequest(%s)", url.latin1().data());
JNIEnv* env = getJNIEnv();
@@ -534,9 +523,6 @@ void
WebFrame::reportError(int errorCode, const WTF::String& description,
const WTF::String& failingUrl)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter);
-#endif
ALOGV("::WebCore:: reportError(%d, %s)", errorCode, description.ascii().data());
JNIEnv* env = getJNIEnv();
AutoJObject javaFrame = mJavaFrame->frame(env);
@@ -573,9 +559,6 @@ WebFrame::convertIDNToUnicode(const WebCore::KURL& url) {
void
WebFrame::loadStarted(WebCore::Frame* frame)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter);
-#endif
JNIEnv* env = getJNIEnv();
AutoJObject javaFrame = mJavaFrame->frame(env);
if (!javaFrame.get())
@@ -633,9 +616,6 @@ WebFrame::loadStarted(WebCore::Frame* frame)
void
WebFrame::transitionToCommitted(WebCore::Frame* frame)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter);
-#endif
JNIEnv* env = getJNIEnv();
AutoJObject javaFrame = mJavaFrame->frame(env);
if (!javaFrame.get())
@@ -650,9 +630,6 @@ WebFrame::transitionToCommitted(WebCore::Frame* frame)
void
WebFrame::didFinishLoad(WebCore::Frame* frame)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter);
-#endif
JNIEnv* env = getJNIEnv();
AutoJObject javaFrame = mJavaFrame->frame(env);
if (!javaFrame.get())
@@ -681,9 +658,6 @@ WebFrame::didFinishLoad(WebCore::Frame* frame)
void
WebFrame::addHistoryItem(WebCore::HistoryItem* item)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter);
-#endif
ALOGV("::WebCore:: addHistoryItem");
JNIEnv* env = getJNIEnv();
WebHistory::AddItem(mJavaFrame->history(env), item);
@@ -692,9 +666,6 @@ WebFrame::addHistoryItem(WebCore::HistoryItem* item)
void
WebFrame::removeHistoryItem(int index)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter);
-#endif
ALOGV("::WebCore:: removeHistoryItem at %d", index);
JNIEnv* env = getJNIEnv();
WebHistory::RemoveItem(mJavaFrame->history(env), index);
@@ -703,9 +674,6 @@ WebFrame::removeHistoryItem(int index)
void
WebFrame::updateHistoryIndex(int newIndex)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter);
-#endif
ALOGV("::WebCore:: updateHistoryIndex to %d", newIndex);
JNIEnv* env = getJNIEnv();
WebHistory::UpdateHistoryIndex(mJavaFrame->history(env), newIndex);
@@ -714,9 +682,6 @@ WebFrame::updateHistoryIndex(int newIndex)
void
WebFrame::setTitle(const WTF::String& title)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter);
-#endif
#ifndef NDEBUG
ALOGV("setTitle(%s)", title.ascii().data());
#endif
@@ -735,9 +700,6 @@ WebFrame::setTitle(const WTF::String& title)
void
WebFrame::windowObjectCleared(WebCore::Frame* frame)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter);
-#endif
ALOGV("::WebCore:: windowObjectCleared");
JNIEnv* env = getJNIEnv();
AutoJObject javaFrame = mJavaFrame->frame(env);
@@ -751,9 +713,6 @@ WebFrame::windowObjectCleared(WebCore::Frame* frame)
void
WebFrame::setProgress(float newProgress)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter);
-#endif
JNIEnv* env = getJNIEnv();
AutoJObject javaFrame = mJavaFrame->frame(env);
if (!javaFrame.get())
@@ -773,9 +732,6 @@ WebFrame::userAgentForURL(const WebCore::KURL* url)
void
WebFrame::didReceiveIcon(WebCore::Image* icon)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter);
-#endif
LOG_ASSERT(icon, "DidReceiveIcon called without an image!");
JNIEnv* env = getJNIEnv();
AutoJObject javaFrame = mJavaFrame->frame(env);
@@ -794,9 +750,6 @@ WebFrame::didReceiveIcon(WebCore::Image* icon)
void
WebFrame::didReceiveTouchIconURL(const WTF::String& url, bool precomposed)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter);
-#endif
JNIEnv* env = getJNIEnv();
AutoJObject javaFrame = mJavaFrame->frame(env);
if (!javaFrame.get())
@@ -812,9 +765,6 @@ WebFrame::didReceiveTouchIconURL(const WTF::String& url, bool precomposed)
void
WebFrame::updateVisitedHistory(const WebCore::KURL& url, bool reload)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter);
-#endif
JNIEnv* env = getJNIEnv();
AutoJObject javaFrame = mJavaFrame->frame(env);
if (!javaFrame.get())
@@ -831,9 +781,6 @@ WebFrame::updateVisitedHistory(const WebCore::KURL& url, bool reload)
bool
WebFrame::canHandleRequest(const WebCore::ResourceRequest& request)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter);
-#endif
JNIEnv* env = getJNIEnv();
AutoJObject javaFrame = mJavaFrame->frame(env);
if (!javaFrame.get())
@@ -874,9 +821,6 @@ WebFrame::shouldSaveFormData()
WebCore::Frame*
WebFrame::createWindow(bool dialog, bool userGesture)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter);
-#endif
JNIEnv* env = getJNIEnv();
AutoJObject javaFrame = mJavaFrame->frame(env);
if (!javaFrame.get())
@@ -890,9 +834,6 @@ WebFrame::createWindow(bool dialog, bool userGesture)
void
WebFrame::requestFocus() const
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter);
-#endif
JNIEnv* env = getJNIEnv();
AutoJObject javaFrame = mJavaFrame->frame(env);
if (!javaFrame.get())
@@ -904,9 +845,6 @@ WebFrame::requestFocus() const
void
WebFrame::closeWindow(WebViewCore* webViewCore)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter);
-#endif
assert(webViewCore);
JNIEnv* env = getJNIEnv();
AutoJObject javaFrame = mJavaFrame->frame(env);
@@ -925,9 +863,6 @@ struct PolicyFunctionWrapper {
void
WebFrame::decidePolicyForFormResubmission(WebCore::FramePolicyFunction func)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter);
-#endif
JNIEnv* env = getJNIEnv();
AutoJObject javaFrame = mJavaFrame->frame(env);
if (!javaFrame.get())
@@ -965,9 +900,6 @@ WebFrame::density() const
void
WebFrame::didReceiveAuthenticationChallenge(WebUrlLoaderClient* client, const std::string& host, const std::string& realm, bool useCachedCredentials, bool suppressDialog)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter);
-#endif
JNIEnv* env = getJNIEnv();
AutoJObject javaFrame = mJavaFrame->frame(env);
if (!javaFrame.get())
@@ -985,9 +917,6 @@ WebFrame::didReceiveAuthenticationChallenge(WebUrlLoaderClient* client, const st
void
WebFrame::reportSslCertError(WebUrlLoaderClient* client, int error, const std::string& cert, const std::string& url)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter);
-#endif
JNIEnv* env = getJNIEnv();
AutoJObject javaFrame = mJavaFrame->frame(env);
if (!javaFrame.get())
@@ -1008,9 +937,6 @@ WebFrame::reportSslCertError(WebUrlLoaderClient* client, int error, const std::s
void
WebFrame::requestClientCert(WebUrlLoaderClient* client, const std::string& hostAndPort)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter);
-#endif
JNIEnv* env = getJNIEnv();
int jHandle = reinterpret_cast<int>(client);
@@ -1024,9 +950,6 @@ WebFrame::requestClientCert(WebUrlLoaderClient* client, const std::string& hostA
void
WebFrame::downloadStart(const std::string& url, const std::string& userAgent, const std::string& contentDisposition, const std::string& mimetype, long long contentLength)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter);
-#endif
JNIEnv* env = getJNIEnv();
AutoJObject javaFrame = mJavaFrame->frame(env);
if (!javaFrame.get())
@@ -1047,9 +970,6 @@ WebFrame::downloadStart(const std::string& url, const std::string& userAgent, co
void
WebFrame::didReceiveData(const char* data, int size) {
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter);
-#endif
JNIEnv* env = getJNIEnv();
AutoJObject javaFrame = mJavaFrame->frame(env);
if (!javaFrame.get())
@@ -1064,9 +984,6 @@ WebFrame::didReceiveData(const char* data, int size) {
void
WebFrame::didFinishLoading() {
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter);
-#endif
JNIEnv* env = getJNIEnv();
AutoJObject javaFrame = mJavaFrame->frame(env);
if (!javaFrame.get())
@@ -1078,9 +995,6 @@ WebFrame::didFinishLoading() {
void WebFrame::setCertificate(const std::string& cert)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter);
-#endif
JNIEnv* env = getJNIEnv();
AutoJObject javaFrame = mJavaFrame->frame(env);
if (!javaFrame.get())
@@ -1098,9 +1012,6 @@ void WebFrame::setCertificate(const std::string& cert)
void WebFrame::autoLogin(const std::string& loginHeader)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimerCoutner::JavaCallbackTimeCounter);
-#endif
JNIEnv* env = getJNIEnv();
AutoJObject javaFrame = mJavaFrame->frame(env);
if (!javaFrame.get())
@@ -1271,9 +1182,6 @@ jbyteArray WebFrame::getPostData(const WebCore::ResourceRequest& request)
static void CallPolicyFunction(JNIEnv* env, jobject obj, jint func, jint decision)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::NativeCallbackTimeCounter);
-#endif
WebCore::Frame* pFrame = GET_NATIVE_FRAME(env, obj);
LOG_ASSERT(pFrame, "nativeCallPolicyFunction must take a valid frame pointer!");
PolicyFunctionWrapper* pFunc = (PolicyFunctionWrapper*)func;
@@ -1295,12 +1203,6 @@ static void CreateFrame(JNIEnv* env, jobject obj, jobject javaview, jobject jAss
initChromium();
#endif
-#ifdef ANDROID_INSTRUMENT
-#if USE(V8)
- V8Counters::initCounters();
-#endif
- TimeCounterAuto counter(TimeCounter::NativeCallbackTimeCounter);
-#endif
// Create a new page
ChromeClientAndroid* chromeC = new ChromeClientAndroid;
EditorClientAndroid* editorC = new EditorClientAndroid;
@@ -1384,9 +1286,6 @@ static void CreateFrame(JNIEnv* env, jobject obj, jobject javaview, jobject jAss
static void DestroyFrame(JNIEnv* env, jobject obj)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::NativeCallbackTimeCounter);
-#endif
WebCore::Frame* pFrame = GET_NATIVE_FRAME(env, obj);
LOG_ASSERT(pFrame, "nativeDestroyFrame must take a valid frame pointer!");
@@ -1415,9 +1314,6 @@ static void DestroyFrame(JNIEnv* env, jobject obj)
static void LoadUrl(JNIEnv *env, jobject obj, jstring url, jobject headers)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::NativeCallbackTimeCounter);
-#endif
WebCore::Frame* pFrame = GET_NATIVE_FRAME(env, obj);
LOG_ASSERT(pFrame, "nativeLoadUrl must take a valid frame pointer!");
@@ -1469,9 +1365,6 @@ static void LoadUrl(JNIEnv *env, jobject obj, jstring url, jobject headers)
static void PostUrl(JNIEnv *env, jobject obj, jstring url, jbyteArray postData)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::NativeCallbackTimeCounter);
-#endif
WebCore::Frame* pFrame = GET_NATIVE_FRAME(env, obj);
LOG_ASSERT(pFrame, "nativePostUrl must take a valid frame pointer!");
@@ -1499,9 +1392,6 @@ static void PostUrl(JNIEnv *env, jobject obj, jstring url, jbyteArray postData)
static void LoadData(JNIEnv *env, jobject obj, jstring baseUrl, jstring data,
jstring mimeType, jstring encoding, jstring failUrl)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::NativeCallbackTimeCounter);
-#endif
WebCore::Frame* pFrame = GET_NATIVE_FRAME(env, obj);
LOG_ASSERT(pFrame, "nativeLoadData must take a valid frame pointer!");
@@ -1526,9 +1416,6 @@ static void LoadData(JNIEnv *env, jobject obj, jstring baseUrl, jstring data,
static void StopLoading(JNIEnv *env, jobject obj)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::NativeCallbackTimeCounter);
-#endif
WebCore::Frame* pFrame = GET_NATIVE_FRAME(env, obj);
LOG_ASSERT(pFrame, "nativeStopLoading must take a valid frame pointer!");
ALOGV("::WebCore:: stopLoading %p", pFrame);
@@ -1626,9 +1513,6 @@ static jstring SaveWebArchive(JNIEnv *env, jobject obj, jstring basename, jboole
static jstring ExternalRepresentation(JNIEnv *env, jobject obj)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::NativeCallbackTimeCounter);
-#endif
WebCore::Frame* pFrame = GET_NATIVE_FRAME(env, obj);
LOG_ASSERT(pFrame, "android_webcore_nativeExternalRepresentation must take a valid frame pointer!");
@@ -1661,9 +1545,6 @@ static StringBuilder FrameAsText(WebCore::Frame *pFrame, jboolean dumpChildFrame
static jstring DocumentAsText(JNIEnv *env, jobject obj)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::NativeCallbackTimeCounter);
-#endif
WebCore::Frame* pFrame = GET_NATIVE_FRAME(env, obj);
LOG_ASSERT(pFrame, "android_webcore_nativeDocumentAsText must take a valid frame pointer!");
@@ -1673,9 +1554,6 @@ static jstring DocumentAsText(JNIEnv *env, jobject obj)
static jstring ChildFramesAsText(JNIEnv *env, jobject obj)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::NativeCallbackTimeCounter);
-#endif
WebCore::Frame* pFrame = GET_NATIVE_FRAME(env, obj);
LOG_ASSERT(pFrame, "android_webcore_nativeDocumentAsText must take a valid frame pointer!");
@@ -1689,9 +1567,6 @@ static jstring ChildFramesAsText(JNIEnv *env, jobject obj)
static void Reload(JNIEnv *env, jobject obj, jboolean allowStale)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::NativeCallbackTimeCounter);
-#endif
WebCore::Frame* pFrame = GET_NATIVE_FRAME(env, obj);
LOG_ASSERT(pFrame, "nativeReload must take a valid frame pointer!");
@@ -1709,9 +1584,6 @@ static void Reload(JNIEnv *env, jobject obj, jboolean allowStale)
static void GoBackOrForward(JNIEnv *env, jobject obj, jint pos)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::NativeCallbackTimeCounter);
-#endif
WebCore::Frame* pFrame = GET_NATIVE_FRAME(env, obj);
LOG_ASSERT(pFrame, "nativeGoBackOrForward must take a valid frame pointer!");
@@ -1725,9 +1597,6 @@ static void GoBackOrForward(JNIEnv *env, jobject obj, jint pos)
static jobject StringByEvaluatingJavaScriptFromString(JNIEnv *env, jobject obj, jstring script)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::NativeCallbackTimeCounter);
-#endif
WebCore::Frame* pFrame = GET_NATIVE_FRAME(env, obj);
LOG_ASSERT(pFrame, "stringByEvaluatingJavaScriptFromString must take a valid frame pointer!");
@@ -1831,9 +1700,6 @@ private:
static void AddJavascriptInterface(JNIEnv *env, jobject obj, jint nativeFramePointer,
jobject javascriptObj, jstring interfaceName)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::NativeCallbackTimeCounter);
-#endif
WebCore::Frame* pFrame = 0;
if (nativeFramePointer == 0)
pFrame = GET_NATIVE_FRAME(env, obj);
@@ -1893,17 +1759,11 @@ static void AddJavascriptInterface(JNIEnv *env, jobject obj, jint nativeFramePoi
static void SetCacheDisabled(JNIEnv *env, jobject obj, jboolean disabled)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::NativeCallbackTimeCounter);
-#endif
WebCore::memoryCache()->setDisabled(disabled);
}
static jboolean CacheDisabled(JNIEnv *env, jobject obj)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::NativeCallbackTimeCounter);
-#endif
return WebCore::memoryCache()->disabled();
}
@@ -1936,17 +1796,6 @@ static void ClearWebViewCache()
static void ClearCache(JNIEnv *env, jobject obj)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::NativeCallbackTimeCounter);
-#if USE(JSC)
- JSC::JSLock lock(false);
- JSC::Heap::Statistics jsHeapStatistics = WebCore::JSDOMWindow::commonJSGlobalData()->heap.statistics();
- LOGD("About to gc and JavaScript heap size is %d and has %d bytes free",
- jsHeapStatistics.size, jsHeapStatistics.free);
-#endif // USE(JSC)
- LOGD("About to clear cache and current cache has %d bytes live and %d bytes dead",
- memoryCache()->getLiveSize(), memoryCache()->getDeadSize());
-#endif // ANDROID_INSTRUMENT
ClearWebCoreCache();
ClearWebViewCache();
#if USE(JSC)
@@ -1960,9 +1809,6 @@ static void ClearCache(JNIEnv *env, jobject obj)
static jboolean DocumentHasImages(JNIEnv *env, jobject obj)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::NativeCallbackTimeCounter);
-#endif
WebCore::Frame* pFrame = GET_NATIVE_FRAME(env, obj);
LOG_ASSERT(pFrame, "DocumentHasImages must take a valid frame pointer!");
@@ -1971,9 +1817,6 @@ static jboolean DocumentHasImages(JNIEnv *env, jobject obj)
static jboolean HasPasswordField(JNIEnv *env, jobject obj)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::NativeCallbackTimeCounter);
-#endif
WebCore::Frame* pFrame = GET_NATIVE_FRAME(env, obj);
LOG_ASSERT(pFrame, "HasPasswordField must take a valid frame pointer!");
@@ -2001,9 +1844,6 @@ static jboolean HasPasswordField(JNIEnv *env, jobject obj)
static jobjectArray GetUsernamePassword(JNIEnv *env, jobject obj)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::NativeCallbackTimeCounter);
-#endif
WebCore::Frame* pFrame = GET_NATIVE_FRAME(env, obj);
LOG_ASSERT(pFrame, "GetUsernamePassword must take a valid frame pointer!");
jobjectArray strArray = NULL;
@@ -2022,9 +1862,6 @@ static jobjectArray GetUsernamePassword(JNIEnv *env, jobject obj)
static void SetUsernamePassword(JNIEnv *env, jobject obj,
jstring username, jstring password)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::NativeCallbackTimeCounter);
-#endif
WebCore::Frame* pFrame = GET_NATIVE_FRAME(env, obj);
LOG_ASSERT(pFrame, "SetUsernamePassword must take a valid frame pointer!");
@@ -2109,9 +1946,6 @@ WebFrame::saveFormData(HTMLFormElement* form)
static void OrientationChanged(JNIEnv *env, jobject obj, int orientation)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::NativeCallbackTimeCounter);
-#endif
WebCore::Frame* pFrame = GET_NATIVE_FRAME(env, obj);
ALOGV("Sending orientation: %d", orientation);
pFrame->sendOrientationChangeEvent(orientation);
diff --git a/Source/WebKit/android/jni/WebCoreResourceLoader.cpp b/Source/WebKit/android/jni/WebCoreResourceLoader.cpp
index 7845533..3aa4422 100644
--- a/Source/WebKit/android/jni/WebCoreResourceLoader.cpp
+++ b/Source/WebKit/android/jni/WebCoreResourceLoader.cpp
@@ -34,9 +34,6 @@
#include "ResourceHandleInternal.h"
#include "ResourceResponse.h"
#include "SkUtils.h"
-#ifdef ANDROID_INSTRUMENT
-#include "TimeCounter.h"
-#endif
#include "WebCoreJni.h"
#include <JNIHelp.h>
@@ -133,10 +130,6 @@ bool WebCoreResourceLoader::willLoadFromCache(const WebCore::KURL& url, int64_t
// ----------------------------------------------------------------------------
void WebCoreResourceLoader::SetResponseHeader(JNIEnv* env, jobject obj, jint nativeResponse, jstring key, jstring val)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::ResourceTimeCounter);
-#endif
-
WebCore::ResourceResponse* response = (WebCore::ResourceResponse*)nativeResponse;
LOG_ASSERT(response, "nativeSetResponseHeader must take a valid response pointer!");
@@ -149,9 +142,6 @@ jint WebCoreResourceLoader::CreateResponse(JNIEnv* env, jobject obj, jstring url
jstring statusText, jstring mimeType, jlong expectedLength,
jstring encoding)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::ResourceTimeCounter);
-#endif
LOG_ASSERT(url, "Must have a url in the response!");
WebCore::KURL kurl(WebCore::ParsedURLString, jstringToWtfString(env, url));
WTF::String encodingStr;
@@ -178,9 +168,6 @@ jint WebCoreResourceLoader::CreateResponse(JNIEnv* env, jobject obj, jstring url
void WebCoreResourceLoader::ReceivedResponse(JNIEnv* env, jobject obj, jint nativeResponse)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::ResourceTimeCounter);
-#endif
WebCore::ResourceHandle* handle = GET_NATIVE_HANDLE(env, obj);
LOG_ASSERT(handle, "nativeReceivedResponse must take a valid handle!");
// ResourceLoader::didFail() can set handle to be NULL, we need to check
@@ -196,9 +183,6 @@ void WebCoreResourceLoader::ReceivedResponse(JNIEnv* env, jobject obj, jint nati
void WebCoreResourceLoader::AddData(JNIEnv* env, jobject obj, jbyteArray dataArray, jint length)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::ResourceTimeCounter);
-#endif
ALOGV("webcore_resourceloader data(%d)", length);
WebCore::ResourceHandle* handle = GET_NATIVE_HANDLE(env, obj);
@@ -219,9 +203,6 @@ void WebCoreResourceLoader::AddData(JNIEnv* env, jobject obj, jbyteArray dataArr
void WebCoreResourceLoader::Finished(JNIEnv* env, jobject obj)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::ResourceTimeCounter);
-#endif
ALOGV("webcore_resourceloader finished");
WebCore::ResourceHandle* handle = GET_NATIVE_HANDLE(env, obj);
LOG_ASSERT(handle, "nativeFinished must take a valid handle!");
@@ -236,9 +217,6 @@ void WebCoreResourceLoader::Finished(JNIEnv* env, jobject obj)
jstring WebCoreResourceLoader::RedirectedToUrl(JNIEnv* env, jobject obj,
jstring baseUrl, jstring redirectTo, jint nativeResponse)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::ResourceTimeCounter);
-#endif
ALOGV("webcore_resourceloader redirectedToUrl");
WebCore::ResourceHandle* handle = GET_NATIVE_HANDLE(env, obj);
LOG_ASSERT(handle, "nativeRedirectedToUrl must take a valid handle!");
@@ -275,9 +253,6 @@ jstring WebCoreResourceLoader::RedirectedToUrl(JNIEnv* env, jobject obj,
void WebCoreResourceLoader::Error(JNIEnv* env, jobject obj, jint id, jstring description,
jstring failingUrl)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::ResourceTimeCounter);
-#endif
ALOGV("webcore_resourceloader error");
WebCore::ResourceHandle* handle = GET_NATIVE_HANDLE(env, obj);
LOG_ASSERT(handle, "nativeError must take a valid handle!");
diff --git a/Source/WebKit/android/jni/WebViewCore.cpp b/Source/WebKit/android/jni/WebViewCore.cpp
index eb2e3cc..3e377cb 100644
--- a/Source/WebKit/android/jni/WebViewCore.cpp
+++ b/Source/WebKit/android/jni/WebViewCore.cpp
@@ -131,7 +131,6 @@
#if USE(V8)
#include "ScriptController.h"
-#include "V8Counters.h"
#include <wtf/text/CString.h>
#endif
@@ -152,10 +151,6 @@ FILE* gDomTreeFile = 0;
FILE* gRenderTreeFile = 0;
#endif
-#ifdef ANDROID_INSTRUMENT
-#include "TimeCounter.h"
-#endif
-
#if USE(ACCELERATED_COMPOSITING)
#include "GraphicsLayerAndroid.h"
#include "RenderLayerCompositor.h"
@@ -588,11 +583,6 @@ void WebViewCore::recordPictureSet(PictureSet* content)
if (!success)
return;
- { // collect WebViewCoreRecordTimeCounter after layoutIfNeededRecursive
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::WebViewCoreRecordTimeCounter);
-#endif
-
// if the webkit page dimensions changed, discard the pictureset and redraw.
WebCore::FrameView* view = m_mainFrame->view();
int width = view->contentsWidth();
@@ -710,8 +700,6 @@ void WebViewCore::recordPictureSet(PictureSet* content)
}
#endif
- } // WebViewCoreRecordTimeCounter
-
WebCore::Node* oldFocusNode = currentFocus();
m_frameCacheOutOfDate = true;
WebCore::IntRect oldBounds;
@@ -1599,9 +1587,6 @@ void WebViewCore::updateFrameCache()
LOGW("updateFrameCache: pending style recalc, ignoring.");
return;
}
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::WebViewCoreBuildNavTimeCounter);
-#endif
m_frameCacheOutOfDate = false;
m_temp = new CachedRoot();
m_temp->init(m_mainFrame, &m_history);
@@ -3937,9 +3922,6 @@ static jstring RequestLabel(JNIEnv *env, jobject obj, int framePointer,
static void ClearContent(JNIEnv *env, jobject obj)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
-#endif
WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj);
viewImpl->clearContent();
}
@@ -3953,9 +3935,6 @@ static void SetSize(JNIEnv *env, jobject obj, jint width, jint height,
jint textWrapWidth, jfloat scale, jint screenWidth, jint screenHeight,
jint anchorX, jint anchorY, jboolean ignoreHeight)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
-#endif
WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj);
ALOGV("webviewcore::nativeSetSize(%u %u)\n viewImpl: %p", (unsigned)width, (unsigned)height, viewImpl);
LOG_ASSERT(viewImpl, "viewImpl not set in nativeSetSize");
@@ -3965,9 +3944,6 @@ static void SetSize(JNIEnv *env, jobject obj, jint width, jint height,
static void SetScrollOffset(JNIEnv *env, jobject obj, jint gen, jboolean sendScrollEvent, jint x, jint y)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
-#endif
WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj);
LOG_ASSERT(viewImpl, "need viewImpl");
@@ -3977,9 +3953,6 @@ static void SetScrollOffset(JNIEnv *env, jobject obj, jint gen, jboolean sendScr
static void SetGlobalBounds(JNIEnv *env, jobject obj, jint x, jint y, jint h,
jint v)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
-#endif
WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj);
LOG_ASSERT(viewImpl, "need viewImpl");
@@ -3990,18 +3963,12 @@ static jboolean Key(JNIEnv *env, jobject obj, jint keyCode, jint unichar,
jint repeatCount, jboolean isShift, jboolean isAlt, jboolean isSym,
jboolean isDown)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
-#endif
return GET_NATIVE_VIEW(env, obj)->key(PlatformKeyboardEvent(keyCode,
unichar, repeatCount, isDown, isShift, isAlt, isSym));
}
static void Click(JNIEnv *env, jobject obj, int framePtr, int nodePtr, jboolean fake)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
-#endif
WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj);
LOG_ASSERT(viewImpl, "viewImpl not set in Click");
@@ -4017,27 +3984,18 @@ static void ContentInvalidateAll(JNIEnv *env, jobject obj)
static void DeleteSelection(JNIEnv *env, jobject obj, jint start, jint end,
jint textGeneration)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
-#endif
WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj);
viewImpl->deleteSelection(start, end, textGeneration);
}
static void SetSelection(JNIEnv *env, jobject obj, jint start, jint end)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
-#endif
WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj);
viewImpl->setSelection(start, end);
}
static jstring ModifySelection(JNIEnv *env, jobject obj, jint direction, jint granularity)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
-#endif
WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj);
String selectionString = viewImpl->modifySelection(direction, granularity);
return wtfStringToJstring(env, selectionString);
@@ -4047,9 +4005,6 @@ static void ReplaceTextfieldText(JNIEnv *env, jobject obj,
jint oldStart, jint oldEnd, jstring replace, jint start, jint end,
jint textGeneration)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
-#endif
WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj);
WTF::String webcoreString = jstringToWtfString(env, replace);
viewImpl->replaceTextfieldText(oldStart,
@@ -4060,9 +4015,6 @@ static void PassToJs(JNIEnv *env, jobject obj,
jint generation, jstring currentText, jint keyCode,
jint keyValue, jboolean down, jboolean cap, jboolean fn, jboolean sym)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
-#endif
WTF::String current = jstringToWtfString(env, currentText);
GET_NATIVE_VIEW(env, obj)->passToJs(generation, current,
PlatformKeyboardEvent(keyCode, keyValue, 0, down, cap, fn, sym));
@@ -4071,18 +4023,12 @@ static void PassToJs(JNIEnv *env, jobject obj,
static void ScrollFocusedTextInput(JNIEnv *env, jobject obj, jfloat xPercent,
jint y)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
-#endif
WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj);
viewImpl->scrollFocusedTextInput(xPercent, y);
}
static void SetFocusControllerActive(JNIEnv *env, jobject obj, jboolean active)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
-#endif
ALOGV("webviewcore::nativeSetFocusControllerActive()\n");
WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj);
LOG_ASSERT(viewImpl, "viewImpl not set in nativeSetFocusControllerActive");
@@ -4091,9 +4037,6 @@ static void SetFocusControllerActive(JNIEnv *env, jobject obj, jboolean active)
static void SaveDocumentState(JNIEnv *env, jobject obj, jint frame)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
-#endif
ALOGV("webviewcore::nativeSaveDocumentState()\n");
WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj);
LOG_ASSERT(viewImpl, "viewImpl not set in nativeSaveDocumentState");
@@ -4120,9 +4063,6 @@ static bool UpdateLayers(JNIEnv *env, jobject obj, jint jbaseLayer)
static jint RecordContent(JNIEnv *env, jobject obj, jobject region, jobject pt)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
-#endif
WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj);
SkRegion* nativeRegion = GraphicsJNI::getNativeRegion(env, region);
SkIPoint nativePt;
@@ -4133,18 +4073,12 @@ static jint RecordContent(JNIEnv *env, jobject obj, jobject region, jobject pt)
static void SplitContent(JNIEnv *env, jobject obj, jint content)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
-#endif
WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj);
viewImpl->splitContent(reinterpret_cast<PictureSet*>(content));
}
static void SendListBoxChoice(JNIEnv* env, jobject obj, jint choice)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
-#endif
WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj);
LOG_ASSERT(viewImpl, "viewImpl not set in nativeSendListBoxChoice");
viewImpl->popupReply(choice);
@@ -4159,9 +4093,6 @@ static void SendListBoxChoice(JNIEnv* env, jobject obj, jint choice)
static void SendListBoxChoices(JNIEnv* env, jobject obj, jbooleanArray jArray,
jint size)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
-#endif
WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj);
LOG_ASSERT(viewImpl, "viewImpl not set in nativeSendListBoxChoices");
jboolean* ptrArray = env->GetBooleanArrayElements(jArray, 0);
@@ -4180,9 +4111,6 @@ static void SendListBoxChoices(JNIEnv* env, jobject obj, jbooleanArray jArray,
static jstring FindAddress(JNIEnv *env, jobject obj, jstring addr,
jboolean caseInsensitive)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
-#endif
if (!addr)
return 0;
int length = env->GetStringLength(addr);
@@ -4203,9 +4131,6 @@ static jboolean HandleTouchEvent(JNIEnv *env, jobject obj, jint action, jintArra
jintArray xArray, jintArray yArray,
jint count, jint actionIndex, jint metaState)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
-#endif
WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj);
LOG_ASSERT(viewImpl, "viewImpl not set in %s", __FUNCTION__);
jint* ptrIdArray = env->GetIntArrayElements(idArray, 0);
@@ -4228,9 +4153,6 @@ static jboolean HandleTouchEvent(JNIEnv *env, jobject obj, jint action, jintArra
static void TouchUp(JNIEnv *env, jobject obj, jint touchGeneration,
jint frame, jint node, jint x, jint y)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
-#endif
WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj);
LOG_ASSERT(viewImpl, "viewImpl not set in %s", __FUNCTION__);
viewImpl->touchUp(touchGeneration,
@@ -4239,9 +4161,6 @@ static void TouchUp(JNIEnv *env, jobject obj, jint touchGeneration,
static jstring RetrieveHref(JNIEnv *env, jobject obj, jint x, jint y)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
-#endif
WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj);
LOG_ASSERT(viewImpl, "viewImpl not set in %s", __FUNCTION__);
WTF::String result = viewImpl->retrieveHref(x, y);
@@ -4252,9 +4171,6 @@ static jstring RetrieveHref(JNIEnv *env, jobject obj, jint x, jint y)
static jstring RetrieveAnchorText(JNIEnv *env, jobject obj, jint x, jint y)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
-#endif
WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj);
LOG_ASSERT(viewImpl, "viewImpl not set in %s", __FUNCTION__);
WTF::String result = viewImpl->retrieveAnchorText(x, y);
@@ -4276,9 +4192,6 @@ static void StopPaintingCaret(JNIEnv *env, jobject obj)
static void MoveFocus(JNIEnv *env, jobject obj, jint framePtr, jint nodePtr)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
-#endif
WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj);
LOG_ASSERT(viewImpl, "viewImpl not set in %s", __FUNCTION__);
viewImpl->moveFocus((WebCore::Frame*) framePtr, (WebCore::Node*) nodePtr);
@@ -4287,9 +4200,6 @@ static void MoveFocus(JNIEnv *env, jobject obj, jint framePtr, jint nodePtr)
static void MoveMouse(JNIEnv *env, jobject obj, jint frame,
jint x, jint y)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
-#endif
WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj);
LOG_ASSERT(viewImpl, "viewImpl not set in %s", __FUNCTION__);
viewImpl->moveMouse((WebCore::Frame*) frame, x, y);
@@ -4298,9 +4208,6 @@ static void MoveMouse(JNIEnv *env, jobject obj, jint frame,
static void MoveMouseIfLatest(JNIEnv *env, jobject obj, jint moveGeneration,
jint frame, jint x, jint y)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
-#endif
WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj);
LOG_ASSERT(viewImpl, "viewImpl not set in %s", __FUNCTION__);
viewImpl->moveMouseIfLatest(moveGeneration,
@@ -4309,9 +4216,6 @@ static void MoveMouseIfLatest(JNIEnv *env, jobject obj, jint moveGeneration,
static void UpdateFrameCache(JNIEnv *env, jobject obj)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
-#endif
WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj);
LOG_ASSERT(viewImpl, "viewImpl not set in %s", __FUNCTION__);
viewImpl->updateFrameCache();
@@ -4319,9 +4223,6 @@ static void UpdateFrameCache(JNIEnv *env, jobject obj)
static jint GetContentMinPrefWidth(JNIEnv *env, jobject obj)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
-#endif
WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj);
LOG_ASSERT(viewImpl, "viewImpl not set in %s", __FUNCTION__);
@@ -4340,9 +4241,6 @@ static jint GetContentMinPrefWidth(JNIEnv *env, jobject obj)
static void SetViewportSettingsFromNative(JNIEnv *env, jobject obj)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
-#endif
WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj);
LOG_ASSERT(viewImpl, "viewImpl not set in %s", __FUNCTION__);
@@ -4363,9 +4261,6 @@ static void SetViewportSettingsFromNative(JNIEnv *env, jobject obj)
static void SetBackgroundColor(JNIEnv *env, jobject obj, jint color)
{
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
-#endif
WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj);
LOG_ASSERT(viewImpl, "viewImpl not set in %s", __FUNCTION__);
@@ -4396,15 +4291,6 @@ static void DumpNavTree(JNIEnv *env, jobject obj)
viewImpl->dumpNavTree();
}
-static void DumpV8Counters(JNIEnv*, jobject)
-{
-#if USE(V8)
-#ifdef ANDROID_INSTRUMENT
- V8Counters::dumpCounters();
-#endif
-#endif
-}
-
static void SetJsFlags(JNIEnv *env, jobject obj, jstring flags)
{
#if USE(V8)
@@ -4440,9 +4326,6 @@ static void GeolocationPermissionsProvide(JNIEnv* env, jobject obj, jstring orig
}
static void RegisterURLSchemeAsLocal(JNIEnv* env, jobject obj, jstring scheme) {
-#ifdef ANDROID_INSTRUMENT
- TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
-#endif
WebCore::SchemeRegistry::registerURLSchemeAsLocal(jstringToWtfString(env, scheme));
}
@@ -4715,8 +4598,6 @@ static JNINativeMethod gJavaWebViewCoreMethods[] = {
(void*) DumpRenderTree },
{ "nativeDumpNavTree", "()V",
(void*) DumpNavTree },
- { "nativeDumpV8Counters", "()V",
- (void*) DumpV8Counters },
{ "nativeSetNewStorageLimit", "(J)V",
(void*) SetNewStorageLimit },
{ "nativeGeolocationPermissionsProvide", "(Ljava/lang/String;ZZ)V",
diff --git a/Source/WebKit/android/nav/WebView.cpp b/Source/WebKit/android/nav/WebView.cpp
index aea28bd..b9172e2 100644
--- a/Source/WebKit/android/nav/WebView.cpp
+++ b/Source/WebKit/android/nav/WebView.cpp
@@ -53,9 +53,6 @@
#include "SkPicture.h"
#include "SkRect.h"
#include "SkTime.h"
-#ifdef ANDROID_INSTRUMENT
-#include "TimeCounter.h"
-#endif
#include "TilesManager.h"
#include "WebCoreJni.h"
#include "WebRequestContext.h"
@@ -2141,13 +2138,6 @@ static void nativeHideCursor(JNIEnv *env, jobject obj)
view->hideCursor();
}
-static void nativeInstrumentReport(JNIEnv *env, jobject obj)
-{
-#ifdef ANDROID_INSTRUMENT
- TimeCounter::reportNow();
-#endif
-}
-
static void nativeSelectBestAt(JNIEnv *env, jobject obj, jobject jrect)
{
WebView* view = GET_NATIVE_VIEW(env, obj);
@@ -2821,8 +2811,6 @@ static JNINativeMethod gJavaWebViewMethods[] = {
(void*) nativeHitSelection },
{ "nativeImageURI", "(II)Ljava/lang/String;",
(void*) nativeImageURI },
- { "nativeInstrumentReport", "()V",
- (void*) nativeInstrumentReport },
{ "nativeLayerBounds", "(I)Landroid/graphics/Rect;",
(void*) nativeLayerBounds },
{ "nativeMotionUp", "(III)Z",