Skip to content

Commit

Permalink
Initial commit to log from webkit.
Browse files Browse the repository at this point in the history
  • Loading branch information
gunesacar committed Oct 30, 2013
1 parent 233a9d5 commit 5b56b4e
Show file tree
Hide file tree
Showing 30 changed files with 579 additions and 35 deletions.
2 changes: 2 additions & 0 deletions src/qt/src/3rdparty/webkit/Source/JavaScriptCore/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@

#include <wtf/Platform.h>

#define LOG_MODS_FP 1 // !!! fpd to enable logging, TODO remove redundant defines

/* See note in wtf/Platform.h for more info on EXPORT_MACROS. */
#if USE(EXPORT_MACROS)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@
#endif
#endif

#define LOG_DISABLED 0 // !!! to enable logging in release version

#if COMPILER(GCC)
#define WTF_PRETTY_FUNCTION __PRETTY_FUNCTION__
#else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
#ifndef WTF_Platform_h
#define WTF_Platform_h

#define LOG_MODS_FP 1

/* ==== PLATFORM handles OS, operating environment, graphics API, and
CPU. This macro will be phased out in favor of platform adaptation
macros, policy decision macros, and top-level port definitions. ==== */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,4 +365,10 @@ AtomicString AtomicString::fromUTF8Internal(const char* charactersStart, const c
return atomicString;
}

#ifdef LOG_MODS_FP //!!! to enable log output
void AtomicString::show() const //http://trac.webkit.org/browser/trunk/Source/JavaScriptCore/wtf/text/AtomicString.cpp?rev=87438
{
m_string.show();
}
#endif
} // namespace WTF
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,11 @@ class AtomicString {
static const AtomicString& xmlnsAtom2();
#endif

//#define LOG_MODS_FP 1
#ifdef LOG_MODS_FP //!!! gunes, otherwise it's a pain to print AtomicStrings when WTFstring is not included...
void show() const; //http://trac.webkit.org/browser/trunk/Source/JavaScriptCore/wtf/text/AtomicString.cpp?rev=87438
#endif

private:
String m_string;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -973,12 +973,19 @@ float charactersToFloat(const UChar* data, size_t length, bool* ok, bool* didRea

} // namespace WTF

#ifndef NDEBUG

//#ifndef NDEBUG - !!! gunes: we want to log from release version
#ifdef LOG_MODS_FP
// For use in the debugger
String* string(const char*);
Vector<char> asciiDebug(StringImpl* impl);
Vector<char> asciiDebug(String& string);

void String::show() const
{
printf("%s\n", asciiDebug(impl()).data());
}

String* string(const char* s)
{
// leaks memory!
Expand Down Expand Up @@ -1009,4 +1016,5 @@ Vector<char> asciiDebug(String& string)
return asciiDebug(string.impl());
}


#endif
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,10 @@ class String {
String(WTF::HashTableDeletedValueType) : m_impl(WTF::HashTableDeletedValue) { }
bool isHashTableDeletedValue() const { return m_impl.isHashTableDeletedValue(); }

#ifdef LOG_MODS_FP
void show() const;
#endif

private:
RefPtr<StringImpl> m_impl;
};
Expand Down
2 changes: 2 additions & 0 deletions src/qt/src/3rdparty/webkit/Source/WebCore/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@

#include <wtf/Platform.h>

#define LOG_MODS_FP 1 // !!! gunes to enable logging, TODO remove redundant defines

/* See note in wtf/Platform.h for more info on EXPORT_MACROS. */
#if USE(EXPORT_MACROS)

Expand Down
11 changes: 11 additions & 0 deletions src/qt/src/3rdparty/webkit/Source/WebCore/css/CSSFontFace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
#include "FontDescription.h"
#include "SimpleFontData.h"

#ifdef LOG_MODS_FP
#include "Frame.h"
#endif

namespace WebCore {

CSSFontFace::~CSSFontFace()
Expand Down Expand Up @@ -111,6 +115,13 @@ SimpleFontData* CSSFontFace::getFontData(const FontDescription& fontDescription,
for (size_t i = 0; i < size; ++i) {
if (SimpleFontData* result = m_sources[i]->getFontData(fontDescription, syntheticBold, syntheticItalic, fontSelector)) {
m_activeSource = m_sources[i];
//#define LOG_MODS_FP 1 // !!! TODO remove redundant defines
#ifdef LOG_MODS_FP
// !!! TODO: famName might be data url
String famName = m_activeSource->string();
String log_str = String("CSSFontFace::getFontData ") + fontDescription.family().family() + "->" + famName;
logFPCalls(0, log_str, "");
#endif
return result;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@
#include "SVGURIReference.h"
#endif

#ifdef LOG_MODS_FP
#include "Frame.h"
#endif

namespace WebCore {

CSSFontFaceSource::CSSFontFaceSource(const String& str, CachedFont* font)
Expand Down Expand Up @@ -103,11 +107,23 @@ SimpleFontData* CSSFontFaceSource::getFontData(const FontDescription& fontDescri
if (!isValid())
return 0;

#ifdef LOG_MODS_FP_SUPERVERBOSE
String famName = m_string;
String log_str = String("CSSFontFaceSource::getFontData ") + famName;
logFPCalls(0, log_str, "");
#endif

#if ENABLE(SVG_FONTS)
if (!m_font && !m_svgFontFaceElement) {
#else
if (!m_font) {
#endif

#ifdef LOG_MODS_FP_SUPERVERBOSE
String famName = m_string;
String log_str = String("CSSFontFaceSource::getFontData ") + famName;
logFPCalls(0, log_str, "UNKNOWN");
#endif
SimpleFontData* fontData = fontCache()->getCachedFontData(fontDescription, m_string);

// We're local. Just return a SimpleFontData from the normal cache.
Expand Down Expand Up @@ -178,6 +194,12 @@ SimpleFontData* CSSFontFaceSource::getFontData(const FontDescription& fontDescri
if (CachedResourceLoader* cachedResourceLoader = fontSelector->cachedResourceLoader())
m_font->beginLoadIfNeeded(cachedResourceLoader);
// FIXME: m_string is a URL so it makes no sense to pass it as a family name.

#ifdef LOG_MODS_FP_SUPERVERBOSE
String famName = m_string;
String log_str = String("2 CSSFontFaceSource::getFontData ") + famName;
logFPCalls(0, log_str);
#endif
SimpleFontData* tempData = fontCache()->getCachedFontData(fontDescription, m_string);
if (!tempData)
tempData = fontCache()->getLastResortFallbackFont(fontDescription);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
#include "SVGNames.h"
#endif


namespace WebCore {

CSSFontSelector::CSSFontSelector(Document* document)
Expand Down Expand Up @@ -401,8 +402,15 @@ static FontData* fontDataForGenericFamily(Document* document, const FontDescript
else if (familyName == "-webkit-standard")
genericFamily = settings->standardFontFamily();

if (!genericFamily.isEmpty())
if (!genericFamily.isEmpty()){

#ifdef LOG_MODS_FP_SUPERVERBOSE
String famName = genericFamily;
String log_str = String("CSSFontSelector::fontDataForGenericFamily ") + famName;
logFPCalls(0, log_str, "UNKNOWN");
#endif
return fontCache()->getCachedFontData(fontDescription, genericFamily);
}

return 0;
}
Expand Down Expand Up @@ -491,6 +499,18 @@ static inline bool compareFontFaces(CSSFontFace* first, CSSFontFace* second)

FontData* CSSFontSelector::getFontData(const FontDescription& fontDescription, const AtomicString& familyName)
{

#define LOG_MODS_FP 1 // !!! TODO remove redundant defines
#ifdef LOG_MODS_FP
String famName = familyName;
String log_str = String("CSSFontSelector::getFontData ") + famName;
if(m_document){
logFPCalls(0, log_str, m_document->url());
}else{
logFPCalls(0, log_str, "");
}
#endif

if (m_fontFaces.isEmpty()) {
if (familyName.startsWith("-webkit-"))
return fontDataForGenericFamily(m_document, fontDescription, familyName);
Expand Down
5 changes: 5 additions & 0 deletions src/qt/src/3rdparty/webkit/Source/WebCore/dom/Document.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,11 @@ DOMImplementation* Document::implementation()
{
if (!m_implementation)
m_implementation = DOMImplementation::create(this);

#ifdef LOG_MODS_FP
logFPCalls(m_frame, "Document::implementation");
#endif

return m_implementation.get();
}

Expand Down
21 changes: 21 additions & 0 deletions src/qt/src/3rdparty/webkit/Source/WebCore/dom/Element.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,15 @@ int Element::offsetTop()

int Element::offsetWidth()
{

#ifdef LOG_MODS_FP
if(document()->frame() && document()->frame()->script() && document()->frame()->script()->sourceURL()){
logFPCalls(document()->frame(), "Element::offsetWidth");
}else{
logFPCalls(0, "Element::offsetWidth", document()->url());
}

#endif
document()->updateLayoutIgnorePendingStylesheets();
if (RenderBoxModelObject* rend = renderBoxModelObject())
return adjustForAbsoluteZoom(rend->offsetWidth(), rend);
Expand All @@ -388,6 +397,14 @@ int Element::offsetWidth()

int Element::offsetHeight()
{
#ifdef LOG_MODS_FP
if(document()->frame() && document()->frame()->script() && document()->frame()->script()->sourceURL()){
logFPCalls(document()->frame(), "Element::offsetWidth");
}else{
logFPCalls(0, "Element::offsetHeight", document()->url());
}
#endif

document()->updateLayoutIgnorePendingStylesheets();
if (RenderBoxModelObject* rend = renderBoxModelObject())
return adjustForAbsoluteZoom(rend->offsetHeight(), rend);
Expand Down Expand Up @@ -580,6 +597,10 @@ PassRefPtr<ClientRect> Element::getBoundingClientRect() const
{
document()->updateLayoutIgnorePendingStylesheets();

#ifdef LOG_MODS_FP
logFPCalls(NULL, "Element::getBoundingClientRect", document()->url());
#endif

Vector<FloatQuad> quads;
#if ENABLE(SVG)
if (isSVGElement() && renderer()) {
Expand Down
Loading

0 comments on commit 5b56b4e

Please sign in to comment.