diff options
Diffstat (limited to 'Source')
34 files changed, 187 insertions, 151 deletions
diff --git a/Source/JavaScriptCore/wtf/Assertions.cpp b/Source/JavaScriptCore/wtf/Assertions.cpp index 930368c..0642414 100644 --- a/Source/JavaScriptCore/wtf/Assertions.cpp +++ b/Source/JavaScriptCore/wtf/Assertions.cpp @@ -66,6 +66,10 @@ #include <execinfo.h> #endif +#if OS(ANDROID) +#include <utils/Log.h> +#endif + extern "C" { #if PLATFORM(BREWMP) @@ -124,7 +128,9 @@ static void vprintf_stderr_common(const char* format, va_list args) vsnprintf(buffer.data(), size, format, args); printLog(buffer); } - +#elif OS(ANDROID) + LOG_PRI_VA(ANDROID_LOG_DEBUG, "WebKit", format, args); + return; #elif HAVE(ISDEBUGGERPRESENT) if (IsDebuggerPresent()) { size_t size = 1024; diff --git a/Source/JavaScriptCore/wtf/Platform.h b/Source/JavaScriptCore/wtf/Platform.h index e92af89..d7cd222 100644 --- a/Source/JavaScriptCore/wtf/Platform.h +++ b/Source/JavaScriptCore/wtf/Platform.h @@ -676,7 +676,10 @@ #if PLATFORM(ANDROID) #define WEBCORE_NAVIGATOR_VENDOR "Google Inc." -#define LOG_DISABLED 1 +// Force LOG_ERROR() to be enabled in all builds. All other logging and +// assertions are enabled in debug builds only. +#define ERROR_DISABLED 0 + // This must be defined before we include FastMalloc.h in config.h. #define USE_SYSTEM_MALLOC 1 diff --git a/Source/WebCore/Android.mk b/Source/WebCore/Android.mk index a516f48..c88e94b 100644 --- a/Source/WebCore/Android.mk +++ b/Source/WebCore/Android.mk @@ -811,6 +811,7 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \ plugins/DOMPluginArray.cpp \ plugins/PluginData.cpp \ plugins/PluginDatabase.cpp \ + plugins/PluginDebug.cpp \ plugins/PluginMainThreadScheduler.cpp \ plugins/PluginPackage.cpp \ plugins/PluginStream.cpp \ diff --git a/Source/WebCore/bridge/jni/v8/JavaValueV8.h b/Source/WebCore/bridge/jni/v8/JavaValueV8.h index 3e1c623..c6ff315 100644 --- a/Source/WebCore/bridge/jni/v8/JavaValueV8.h +++ b/Source/WebCore/bridge/jni/v8/JavaValueV8.h @@ -49,7 +49,18 @@ class JavaInstance; // currently used only with V8. // See https://bugs.webkit.org/show_bug.cgi?id=57023. struct JavaValue { - JavaValue() : m_type(JavaTypeInvalid) {} +// ANDROID + JavaValue() + : m_type(JavaTypeInvalid) + , m_booleanValue(false) + , m_byteValue(0) + , m_charValue(0) + , m_shortValue(0) + , m_intValue(0) + , m_longValue(0) + , m_floatValue(0.0) + , m_doubleValue(0.0) {} +// ANDROID JavaType m_type; // We don't use a union because we want to be able to ref-count some of the diff --git a/Source/WebCore/css/CSSStyleDeclaration.cpp b/Source/WebCore/css/CSSStyleDeclaration.cpp index 1c465e5..d4acc2a 100644 --- a/Source/WebCore/css/CSSStyleDeclaration.cpp +++ b/Source/WebCore/css/CSSStyleDeclaration.cpp @@ -27,6 +27,7 @@ #include "CSSPropertyNames.h" #include "CSSRule.h" #include <wtf/ASCIICType.h> +#include <wtf/text/CString.h> using namespace WTF; diff --git a/Source/WebCore/dom/Text.cpp b/Source/WebCore/dom/Text.cpp index 906e421..c4ea0a6 100644 --- a/Source/WebCore/dom/Text.cpp +++ b/Source/WebCore/dom/Text.cpp @@ -31,6 +31,8 @@ #include "SVGNames.h" #endif +#include <wtf/text/CString.h> + #if ENABLE(WML) #include "WMLDocument.h" #include "WMLVariables.h" diff --git a/Source/WebCore/loader/icon/IconDatabase.cpp b/Source/WebCore/loader/icon/IconDatabase.cpp index 3cefea7..2bb22ec 100644 --- a/Source/WebCore/loader/icon/IconDatabase.cpp +++ b/Source/WebCore/loader/icon/IconDatabase.cpp @@ -73,7 +73,7 @@ static const int updateTimerDelay = 5; static bool checkIntegrityOnOpen = false; -#ifndef NDEBUG +#if !LOG_DISABLED || !ERROR_DISABLED static String urlForLogging(const String& url) { static unsigned urlTruncationLength = 120; @@ -967,7 +967,7 @@ void* IconDatabase::iconDatabaseSyncThread() LOG(IconDatabase, "(THREAD) IconDatabase sync thread started"); -#ifndef NDEBUG +#if !LOG_DISABLED double startTime = currentTime(); #endif @@ -993,7 +993,7 @@ void* IconDatabase::iconDatabaseSyncThread() if (shouldStopThreadActivity()) return syncThreadMainLoop(); -#ifndef NDEBUG +#if !LOG_DISABLED double timeStamp = currentTime(); LOG(IconDatabase, "(THREAD) Open took %.4f seconds", timeStamp - startTime); #endif @@ -1002,7 +1002,7 @@ void* IconDatabase::iconDatabaseSyncThread() if (shouldStopThreadActivity()) return syncThreadMainLoop(); -#ifndef NDEBUG +#if !LOG_DISABLED double newStamp = currentTime(); LOG(IconDatabase, "(THREAD) performOpenInitialization() took %.4f seconds, now %.4f seconds from thread start", newStamp - timeStamp, newStamp - startTime); timeStamp = newStamp; @@ -1025,7 +1025,7 @@ void* IconDatabase::iconDatabaseSyncThread() if (shouldStopThreadActivity()) return syncThreadMainLoop(); -#ifndef NDEBUG +#if !LOG_DISABLED newStamp = currentTime(); LOG(IconDatabase, "(THREAD) performImport() took %.4f seconds, now %.4f seconds from thread start", newStamp - timeStamp, newStamp - startTime); timeStamp = newStamp; @@ -1042,7 +1042,7 @@ void* IconDatabase::iconDatabaseSyncThread() if (shouldStopThreadActivity()) return syncThreadMainLoop(); -#ifndef NDEBUG +#if !LOG_DISABLED newStamp = currentTime(); LOG(IconDatabase, "(THREAD) performURLImport() took %.4f seconds. Entering main loop %.4f seconds from thread start", newStamp - timeStamp, newStamp - startTime); #endif @@ -1358,7 +1358,7 @@ void* IconDatabase::syncThreadMainLoop() while (!m_threadTerminationRequested) { m_syncLock.unlock(); -#ifndef NDEBUG +#if !LOG_DISABLED double timeStamp = currentTime(); #endif LOG(IconDatabase, "(THREAD) Main work loop starting"); @@ -1391,7 +1391,7 @@ void* IconDatabase::syncThreadMainLoop() // has asked to delay pruning static bool prunedUnretainedIcons = false; if (didWrite && !m_privateBrowsingEnabled && !prunedUnretainedIcons && !databaseCleanupCounter) { -#ifndef NDEBUG +#if !LOG_DISABLED double time = currentTime(); #endif LOG(IconDatabase, "(THREAD) Starting pruneUnretainedIcons()"); @@ -1410,7 +1410,7 @@ void* IconDatabase::syncThreadMainLoop() break; } -#ifndef NDEBUG +#if !LOG_DISABLED double newstamp = currentTime(); LOG(IconDatabase, "(THREAD) Main work loop ran for %.4f seconds, %s requested to terminate", newstamp - timeStamp, shouldStopThreadActivity() ? "was" : "was not"); #endif @@ -1458,7 +1458,7 @@ bool IconDatabase::readFromDatabase() { ASSERT_ICON_SYNC_THREAD(); -#ifndef NDEBUG +#if !LOG_DISABLED double timeStamp = currentTime(); #endif @@ -1567,7 +1567,7 @@ bool IconDatabase::writeToDatabase() { ASSERT_ICON_SYNC_THREAD(); -#ifndef NDEBUG +#if !LOG_DISABLED double timeStamp = currentTime(); #endif @@ -1772,7 +1772,7 @@ void* IconDatabase::cleanupSyncThread() { ASSERT_ICON_SYNC_THREAD(); -#ifndef NDEBUG +#if !LOG_DISABLED double timeStamp = currentTime(); #endif @@ -1792,7 +1792,7 @@ void* IconDatabase::cleanupSyncThread() deleteAllPreparedStatements(); m_syncDB.close(); -#ifndef NDEBUG +#if !LOG_DISABLED LOG(IconDatabase, "(THREAD) Final closure took %.4f seconds", currentTime() - timeStamp); #endif diff --git a/Source/WebCore/page/Frame.cpp b/Source/WebCore/page/Frame.cpp index 8a1ad69..049f08b 100644 --- a/Source/WebCore/page/Frame.cpp +++ b/Source/WebCore/page/Frame.cpp @@ -113,10 +113,6 @@ #include "WMLNames.h" #endif -#if PLATFORM(ANDROID) -#include "WebViewCore.h" -#endif - using namespace std; namespace WebCore { diff --git a/Source/WebCore/platform/NotImplemented.h b/Source/WebCore/platform/NotImplemented.h index a71e99c..458604d 100644 --- a/Source/WebCore/platform/NotImplemented.h +++ b/Source/WebCore/platform/NotImplemented.h @@ -47,7 +47,7 @@ #define notImplemented() do { \ static bool havePrinted = false; \ if (!havePrinted && !supressNotImplementedWarning()) { \ - LOGV("%s: notImplemented", __PRETTY_FUNCTION__); \ + ALOGV("%s: notImplemented", __PRETTY_FUNCTION__); \ havePrinted = true; \ } \ } while (0) diff --git a/Source/WebCore/platform/android/SharedTimerAndroid.cpp b/Source/WebCore/platform/android/SharedTimerAndroid.cpp index e4f3b36..a3f3db5 100644 --- a/Source/WebCore/platform/android/SharedTimerAndroid.cpp +++ b/Source/WebCore/platform/android/SharedTimerAndroid.cpp @@ -51,7 +51,7 @@ void setSharedTimerFireTime(double fireTime) { long long timeInMs = static_cast<long long>((fireTime - WTF::currentTime()) * 1000); - LOGV("setSharedTimerFireTime: in %ld millisec", timeInMs); + ALOGV("setSharedTimerFireTime: in %ld millisec", timeInMs); if (JavaSharedClient::GetTimerClient()) JavaSharedClient::GetTimerClient()->setSharedTimer(timeInMs); } diff --git a/Source/WebCore/platform/graphics/android/BaseLayerAndroid.cpp b/Source/WebCore/platform/graphics/android/BaseLayerAndroid.cpp index 2a1b1de..a7fe030 100644 --- a/Source/WebCore/platform/graphics/android/BaseLayerAndroid.cpp +++ b/Source/WebCore/platform/graphics/android/BaseLayerAndroid.cpp @@ -131,7 +131,7 @@ void BaseLayerAndroid::prefetchBasePicture(SkRect& viewport, float currentScale, viewport.fTop, viewport.fRight, viewport.fBottom, - scale); + currentScale); bounds.fLeft = static_cast<int>(floorf(viewport.fLeft * invTileWidth)) - PREFETCH_X_DIST; bounds.fTop = static_cast<int>(floorf(viewport.fTop * invTileHeight)) - PREFETCH_Y_DIST; @@ -141,7 +141,7 @@ void BaseLayerAndroid::prefetchBasePicture(SkRect& viewport, float currentScale, XLOG("prefetch rect %d %d %d %d, scale %f, preparing page %p", bounds.fLeft, bounds.fTop, bounds.fRight, bounds.fBottom, - scale * PREFETCH_SCALE, + prefetchScale, prefetchTiledPage); prefetchTiledPage->setScale(prefetchScale); diff --git a/Source/WebCore/platform/graphics/android/DoubleBufferedTexture.cpp b/Source/WebCore/platform/graphics/android/DoubleBufferedTexture.cpp index 4c5af9e..3194cb9 100644 --- a/Source/WebCore/platform/graphics/android/DoubleBufferedTexture.cpp +++ b/Source/WebCore/platform/graphics/android/DoubleBufferedTexture.cpp @@ -86,7 +86,7 @@ EGLContext DoubleBufferedTexture::producerAcquireContext() return EGL_NO_CONTEXT; if (m_pContext != EGL_NO_CONTEXT) { - LOGV("AquireContext has previously generated a context.\n"); + ALOGV("AquireContext has previously generated a context.\n"); return m_pContext; } @@ -110,10 +110,10 @@ EGLContext DoubleBufferedTexture::producerAcquireContext() m_textureB->lock(); m_textureA->initSourceTexture(); - LOGV("Initialized Textures A (%d)", m_textureA->getSourceTextureId()); + ALOGV("Initialized Textures A (%d)", m_textureA->getSourceTextureId()); if (m_sharedTextureMode == EglImageMode) { m_textureB->initSourceTexture(); - LOGV("Initialized Textures B (%d)", m_textureB->getSourceTextureId()); + ALOGV("Initialized Textures B (%d)", m_textureB->getSourceTextureId()); } m_textureA->unlock(); @@ -131,10 +131,10 @@ void DoubleBufferedTexture::producerDeleteTextures() if (m_sharedTextureMode == EglImageMode) m_textureB->lock(); - LOGV("Deleting Producer Textures A (%d)", m_textureA->getSourceTextureId()); + ALOGV("Deleting Producer Textures A (%d)", m_textureA->getSourceTextureId()); m_textureA->deleteSourceTexture(); if (m_sharedTextureMode == EglImageMode){ - LOGV("Deleting Producer Textures B (%d)", m_textureB->getSourceTextureId()); + ALOGV("Deleting Producer Textures B (%d)", m_textureB->getSourceTextureId()); m_textureB->deleteSourceTexture(); } @@ -150,10 +150,10 @@ void DoubleBufferedTexture::consumerDeleteTextures() if (m_sharedTextureMode == EglImageMode) m_textureB->lock(); - LOGV("Deleting Consumer Textures A (%d)", m_textureA->getTargetTextureId()); + ALOGV("Deleting Consumer Textures A (%d)", m_textureA->getTargetTextureId()); m_textureA->deleteTargetTexture(); if (m_sharedTextureMode == EglImageMode) { - LOGV("Deleting Consumer Textures B (%d)", m_textureB->getTargetTextureId()); + ALOGV("Deleting Consumer Textures B (%d)", m_textureB->getTargetTextureId()); m_textureB->deleteTargetTexture(); } @@ -165,9 +165,9 @@ void DoubleBufferedTexture::consumerDeleteTextures() TextureInfo* DoubleBufferedTexture::producerLock() { SharedTexture* sharedTex = getWriteableTexture(); - LOGV("Acquiring P Lock (%d)", sharedTex->getSourceTextureId()); + ALOGV("Acquiring P Lock (%d)", sharedTex->getSourceTextureId()); TextureInfo* texInfo = sharedTex->lockSource(); - LOGV("Acquired P Lock"); + ALOGV("Acquired P Lock"); return texInfo; } @@ -176,9 +176,9 @@ void DoubleBufferedTexture::producerRelease() { // get the writable texture and unlock it SharedTexture* sharedTex = getWriteableTexture(); - LOGV("Releasing P Lock (%d)", sharedTex->getSourceTextureId()); + ALOGV("Releasing P Lock (%d)", sharedTex->getSourceTextureId()); sharedTex->releaseSource(); - LOGV("Released P Lock (%d)", sharedTex->getSourceTextureId()); + ALOGV("Released P Lock (%d)", sharedTex->getSourceTextureId()); } void DoubleBufferedTexture::producerReleaseAndSwap() @@ -193,14 +193,14 @@ void DoubleBufferedTexture::producerReleaseAndSwap() TextureInfo* DoubleBufferedTexture::consumerLock() { SharedTexture* sharedTex = getReadableTexture(); - LOGV("Acquiring C Lock (%d)", sharedTex->getSourceTextureId()); + ALOGV("Acquiring C Lock (%d)", sharedTex->getSourceTextureId()); m_lockedConsumerTexture = sharedTex; TextureInfo* texInfo = sharedTex->lockTarget(); - LOGV("Acquired C Lock"); + ALOGV("Acquired C Lock"); if (!texInfo) - LOGV("Released C Lock (Empty)"); + ALOGV("Released C Lock (Empty)"); return texInfo; } @@ -211,7 +211,7 @@ void DoubleBufferedTexture::consumerRelease() // producer may have swapped out the readable buffer SharedTexture* sharedTex = m_lockedConsumerTexture; sharedTex->releaseTarget(); - LOGV("Released C Lock (%d)", sharedTex->getSourceTextureId()); + ALOGV("Released C Lock (%d)", sharedTex->getSourceTextureId()); } } // namespace WebCore diff --git a/Source/WebCore/platform/graphics/android/FontAndroid.cpp b/Source/WebCore/platform/graphics/android/FontAndroid.cpp index 3528d47..287043d 100644 --- a/Source/WebCore/platform/graphics/android/FontAndroid.cpp +++ b/Source/WebCore/platform/graphics/android/FontAndroid.cpp @@ -372,7 +372,7 @@ static int truncateFixedPointToInteger(HB_Fixed value) // can call |reset| to start over again. class TextRunWalker { public: - TextRunWalker(const TextRun&, unsigned, const Font*); + TextRunWalker(const TextRun&, unsigned, unsigned, const Font*); ~TextRunWalker(); bool isWordBreak(unsigned, bool); @@ -418,10 +418,10 @@ public: // Return the length of the array returned by |glyphs| unsigned length() const { return m_item.num_glyphs; } - // Return the x offset for each of the glyphs. Note that this is translated + // Return the offset for each of the glyphs. Note that this is translated // by the current x offset and that the x offset is updated for each script // run. - const SkScalar* xPositions() const { return m_xPositions; } + const SkPoint* positions() const { return m_positions; } // Get the advances (widths) for each glyph. const HB_Fixed* advances() const { return m_item.advances; } @@ -464,7 +464,7 @@ private: void createGlyphArrays(int); void resetGlyphArrays(); void shapeGlyphs(); - void setGlyphXPositions(bool); + void setGlyphPositions(bool); static void normalizeSpacesAndMirrorChars(const UChar* source, bool rtl, UChar* destination, int length); @@ -477,9 +477,10 @@ private: const Font* const m_font; HB_ShaperItem m_item; uint16_t* m_glyphs16; // A vector of 16-bit glyph ids. - SkScalar* m_xPositions; // A vector of x positions for each glyph. + SkPoint* m_positions; // A vector of positions for each glyph. ssize_t m_indexOfNextScriptRun; // Indexes the script run in |m_run|. const unsigned m_startingX; // Offset in pixels of the first script run. + const unsigned m_startingY; // Offset in pixels of the first script run. unsigned m_offsetX; // Offset in pixels to the start of the next script run. unsigned m_pixelWidth; // Width (in px) of the current script run. unsigned m_numCodePoints; // Code points in current script run. @@ -512,9 +513,10 @@ const char* TextRunWalker::paths[] = { // Indexed using enum CustomScript const FontPlatformData* TextRunWalker::s_fallbackPlatformData[] = {}; -TextRunWalker::TextRunWalker(const TextRun& run, unsigned startingX, const Font* font) +TextRunWalker::TextRunWalker(const TextRun& run, unsigned startingX, unsigned startingY, const Font* font) : m_font(font) , m_startingX(startingX) + , m_startingY(startingY) , m_offsetX(m_startingX) , m_run(getNormalizedTextRun(run, m_normalizedRun, m_normalizedBuffer)) , m_iterateBackwards(m_run.rtl()) @@ -643,7 +645,7 @@ bool TextRunWalker::nextScriptRun() setupFontForScriptRun(); shapeGlyphs(); - setGlyphXPositions(rtl()); + setGlyphPositions(rtl()); return true; } @@ -744,7 +746,7 @@ void TextRunWalker::deleteGlyphArrays() delete[] m_item.advances; delete[] m_item.offsets; delete[] m_glyphs16; - delete[] m_xPositions; + delete[] m_positions; } void TextRunWalker::createGlyphArrays(int size) @@ -755,7 +757,7 @@ void TextRunWalker::createGlyphArrays(int size) m_item.offsets = new HB_FixedPoint[size]; m_glyphs16 = new uint16_t[size]; - m_xPositions = new SkScalar[size]; + m_positions = new SkPoint[size]; m_item.num_glyphs = size; m_glyphsArrayCapacity = size; // Save the GlyphArrays size. @@ -771,7 +773,7 @@ void TextRunWalker::resetGlyphArrays() memset(m_item.advances, 0, size * sizeof(m_item.advances[0])); memset(m_item.offsets, 0, size * sizeof(m_item.offsets[0])); memset(m_glyphs16, 0, size * sizeof(m_glyphs16[0])); - memset(m_xPositions, 0, size * sizeof(m_xPositions[0])); + memset(m_positions, 0, size * sizeof(m_positions[0])); } void TextRunWalker::shapeGlyphs() @@ -791,7 +793,7 @@ void TextRunWalker::shapeGlyphs() } } -void TextRunWalker::setGlyphXPositions(bool isRTL) +void TextRunWalker::setGlyphPositions(bool isRTL) { int position = 0; // logClustersIndex indexes logClusters for the first (or last when @@ -806,7 +808,7 @@ void TextRunWalker::setGlyphXPositions(bool isRTL) int i = isRTL ? m_item.num_glyphs - iter - 1 : iter; m_glyphs16[i] = m_item.glyphs[i]; - m_xPositions[i] = SkIntToScalar(m_offsetX + position); + m_positions[i].set(SkIntToScalar(m_offsetX + position), m_startingY + SkIntToScalar(m_item.offsets[i].y)); int advance = truncateFixedPointToInteger(m_item.advances[i]); // The first half of the conjunction works around the case where @@ -928,7 +930,7 @@ FloatRect Font::selectionRectForComplexText(const TextRun& run, { int fromX = -1, toX = -1, fromAdvance = -1, toAdvance = -1; - TextRunWalker walker(run, 0, this); + TextRunWalker walker(run, 0, 0, this); walker.setWordAndLetterSpacing(wordSpacing(), letterSpacing()); // Base will point to the x offset for the current script run. Note that, in @@ -955,14 +957,14 @@ FloatRect Font::selectionRectForComplexText(const TextRun& run, // find which glyph this code-point contributed to and find its x // position. int glyph = walker.logClusters()[from]; - fromX = base + walker.xPositions()[glyph]; + fromX = base + walker.positions()[glyph].x(); fromAdvance = walker.advances()[glyph]; } else from -= numCodePoints; if (toX == -1 && to < numCodePoints) { int glyph = walker.logClusters()[to]; - toX = base + walker.xPositions()[glyph]; + toX = base + walker.positions()[glyph].x(); toAdvance = walker.advances()[glyph]; } else to -= numCodePoints; @@ -1009,7 +1011,7 @@ void Font::drawComplexText(GraphicsContext* gc, TextRun const& run, SkCanvas* canvas = gc->platformContext()->mCanvas; bool haveMultipleLayers = isCanvasMultiLayered(canvas); - TextRunWalker walker(run, point.x(), this); + TextRunWalker walker(run, point.x(), point.y(), this); walker.setWordAndLetterSpacing(wordSpacing(), letterSpacing()); walker.setPadding(run.expansion()); @@ -1017,14 +1019,14 @@ void Font::drawComplexText(GraphicsContext* gc, TextRun const& run, if (fill) { walker.fontPlatformDataForScriptRun()->setupPaint(&fillPaint); adjustTextRenderMode(&fillPaint, haveMultipleLayers); - canvas->drawPosTextH(walker.glyphs(), walker.length() << 1, - walker.xPositions(), point.y(), fillPaint); + canvas->drawPosText(walker.glyphs(), walker.length() << 1, + walker.positions(), fillPaint); } if (stroke) { walker.fontPlatformDataForScriptRun()->setupPaint(&strokePaint); adjustTextRenderMode(&strokePaint, haveMultipleLayers); - canvas->drawPosTextH(walker.glyphs(), walker.length() << 1, - walker.xPositions(), point.y(), strokePaint); + canvas->drawPosText(walker.glyphs(), walker.length() << 1, + walker.positions(), strokePaint); } } } @@ -1032,7 +1034,7 @@ void Font::drawComplexText(GraphicsContext* gc, TextRun const& run, float Font::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFontData*>*, GlyphOverflow*) const { - TextRunWalker walker(run, 0, this); + TextRunWalker walker(run, 0, 0, this); walker.setWordAndLetterSpacing(wordSpacing(), letterSpacing()); return walker.widthOfFullRun(); } @@ -1064,7 +1066,7 @@ int Font::offsetForPositionForComplexText(const TextRun& run, float x, { // (Mac code ignores includePartialGlyphs, and they don't know what it's // supposed to do, so we just ignore it as well.) - TextRunWalker walker(run, 0, this); + TextRunWalker walker(run, 0, 0, this); walker.setWordAndLetterSpacing(wordSpacing(), letterSpacing()); // If this is RTL text, the first glyph from the left is actually the last diff --git a/Source/WebCore/platform/graphics/android/ImageBufferAndroid.cpp b/Source/WebCore/platform/graphics/android/ImageBufferAndroid.cpp index 691fbca..439733b 100644 --- a/Source/WebCore/platform/graphics/android/ImageBufferAndroid.cpp +++ b/Source/WebCore/platform/graphics/android/ImageBufferAndroid.cpp @@ -195,7 +195,7 @@ void ImageBuffer::putUnmultipliedImageData(ByteArray* source, const IntSize& sou ASSERT(destx >= 0); ASSERT(destx < m_size.width()); ASSERT(originx >= 0); - ASSERT(originx <= sourceRect.right()); + ASSERT(originx <= sourceRect.maxX()); int endx = destPoint.x() + sourceRect.maxX(); ASSERT(endx <= m_size.width()); @@ -207,7 +207,7 @@ void ImageBuffer::putUnmultipliedImageData(ByteArray* source, const IntSize& sou ASSERT(desty >= 0); ASSERT(desty < m_size.height()); ASSERT(originy >= 0); - ASSERT(originy <= sourceRect.bottom()); + ASSERT(originy <= sourceRect.maxY()); int endy = destPoint.y() + sourceRect.maxY(); ASSERT(endy <= m_size.height()); diff --git a/Source/WebCore/platform/graphics/android/MediaTexture.cpp b/Source/WebCore/platform/graphics/android/MediaTexture.cpp index 1676186..f3d1756 100644 --- a/Source/WebCore/platform/graphics/android/MediaTexture.cpp +++ b/Source/WebCore/platform/graphics/android/MediaTexture.cpp @@ -283,7 +283,6 @@ void MediaTexture::setDimensions(const ANativeWindow* window, void MediaTexture::setFramerateCallback(const ANativeWindow* window, FramerateCallbackProc callback) { - XLOG("Release ANW %p (%p):(%p)", this, m_surfaceTexture.get(), m_surfaceTextureClient.get()); android::Mutex::Autolock lock(m_mediaLock); for (unsigned int i = 0; i < m_videoTextures.size(); i++) { if (m_videoTextures[i]->nativeWindow.get() == window) { diff --git a/Source/WebCore/platform/graphics/android/SharedTexture.cpp b/Source/WebCore/platform/graphics/android/SharedTexture.cpp index 74cd2c6..429c589 100644 --- a/Source/WebCore/platform/graphics/android/SharedTexture.cpp +++ b/Source/WebCore/platform/graphics/android/SharedTexture.cpp @@ -178,7 +178,7 @@ void SharedTexture::releaseSource() if (m_eglImage == EGL_NO_IMAGE_KHR && m_sourceTexture->m_width && m_sourceTexture->m_height) { GLUtils::createEGLImageFromTexture(m_sourceTexture->m_textureId, &m_eglImage); - LOGV("Generating Image (%d) 0x%x", m_sourceTexture->m_textureId, m_eglImage); + ALOGV("Generating Image (%d) 0x%x", m_sourceTexture->m_textureId, m_eglImage); glFinish(); // ensures the texture is ready to be used by the consumer } @@ -219,7 +219,7 @@ TextureInfo* SharedTexture::lockTarget() glGenTextures(1, &m_targetTexture->m_textureId); GLUtils::createTextureFromEGLImage(m_targetTexture->m_textureId, m_eglImage); - LOGV("Generating Consumer Texture from 0x%x", m_eglImage); + ALOGV("Generating Consumer Texture from 0x%x", m_eglImage); m_isNewImage = false; } return m_targetTexture; diff --git a/Source/WebCore/platform/graphics/android/TiledTexture.cpp b/Source/WebCore/platform/graphics/android/TiledTexture.cpp index b252303..30aa022 100644 --- a/Source/WebCore/platform/graphics/android/TiledTexture.cpp +++ b/Source/WebCore/platform/graphics/android/TiledTexture.cpp @@ -140,7 +140,7 @@ void TiledTexture::prepare(GLWebViewState* state, float scale, bool repaint, if (tilesAllReady) { m_updateManager.swap(); m_dirtyRegion.op(m_updateManager.getPaintingInval(), SkRegion::kUnion_Op); - XLOG("TT %p swapping, now painting with picture %p" + XLOG("TT %p swapping, now painting with picture %p", this, m_updateManager.getPaintingPicture()); m_updateManager.clearPaintingInval(); } diff --git a/Source/WebCore/platform/graphics/android/TransferQueue.cpp b/Source/WebCore/platform/graphics/android/TransferQueue.cpp index 5c4f0f3..dd72f0d 100644 --- a/Source/WebCore/platform/graphics/android/TransferQueue.cpp +++ b/Source/WebCore/platform/graphics/android/TransferQueue.cpp @@ -518,7 +518,7 @@ void TransferQueue::saveGLState() glGetIntegerv(GL_VIEWPORT, m_GLStateBeforeBlit.viewport); glGetBooleanv(GL_SCISSOR_TEST, m_GLStateBeforeBlit.scissor); glGetBooleanv(GL_DEPTH_TEST, m_GLStateBeforeBlit.depth); -#if DEBUG +#ifdef DEBUG glGetFloatv(GL_COLOR_CLEAR_VALUE, m_GLStateBeforeBlit.clearColor); #endif } @@ -530,7 +530,7 @@ void TransferQueue::setGLStateForCopy(int width, int height) glDisable(GL_SCISSOR_TEST); glDisable(GL_DEPTH_TEST); // Clear the content is only for debug purpose. -#if DEBUG +#ifdef DEBUG glClearColor(0, 0, 0, 0); glClear(GL_COLOR_BUFFER_BIT); #endif @@ -548,7 +548,7 @@ void TransferQueue::restoreGLState() if (m_GLStateBeforeBlit.depth[0]) glEnable(GL_DEPTH_TEST); -#if DEBUG +#ifdef DEBUG glClearColor(m_GLStateBeforeBlit.clearColor[0], m_GLStateBeforeBlit.clearColor[1], m_GLStateBeforeBlit.clearColor[2], diff --git a/Source/WebCore/rendering/InlineTextBox.cpp b/Source/WebCore/rendering/InlineTextBox.cpp index 5815b8b..e8a9c7f 100644 --- a/Source/WebCore/rendering/InlineTextBox.cpp +++ b/Source/WebCore/rendering/InlineTextBox.cpp @@ -43,6 +43,7 @@ #include "Text.h" #include "break_lines.h" #include <wtf/AlwaysInline.h> +#include <wtf/text/CString.h> using namespace std; diff --git a/Source/WebCore/storage/AbstractDatabase.h b/Source/WebCore/storage/AbstractDatabase.h index 9279adc..e0a277f 100644 --- a/Source/WebCore/storage/AbstractDatabase.h +++ b/Source/WebCore/storage/AbstractDatabase.h @@ -36,7 +36,7 @@ #include "SQLiteDatabase.h" #include <wtf/Forward.h> #include <wtf/ThreadSafeRefCounted.h> -#ifndef NDEBUG +#if !LOG_DISABLED || !ERROR_DISABLED #include "SecurityOrigin.h" #endif @@ -109,7 +109,7 @@ protected: unsigned long m_estimatedSize; String m_filename; -#ifndef NDEBUG +#if !LOG_DISABLED || !ERROR_DISABLED String databaseDebugName() const { return m_contextThreadSecurityOrigin->toString() + "::" + m_name; } #endif diff --git a/Source/WebCore/storage/DatabaseTask.cpp b/Source/WebCore/storage/DatabaseTask.cpp index 343ae1e..ad744e5 100644 --- a/Source/WebCore/storage/DatabaseTask.cpp +++ b/Source/WebCore/storage/DatabaseTask.cpp @@ -62,7 +62,7 @@ void DatabaseTaskSynchronizer::taskCompleted() DatabaseTask::DatabaseTask(Database* database, DatabaseTaskSynchronizer* synchronizer) : m_database(database) , m_synchronizer(synchronizer) -#ifndef NDEBUG +#if !LOG_DISABLED , m_complete(false) #endif { @@ -70,13 +70,17 @@ DatabaseTask::DatabaseTask(Database* database, DatabaseTaskSynchronizer* synchro DatabaseTask::~DatabaseTask() { +#if !LOG_DISABLED ASSERT(m_complete || !m_synchronizer); +#endif } void DatabaseTask::performTask() { // Database tasks are meant to be used only once, so make sure this one hasn't been performed before. +#if !LOG_DISABLED ASSERT(!m_complete); +#endif LOG(StorageAPI, "Performing %s %p\n", debugTaskName(), this); @@ -86,7 +90,7 @@ void DatabaseTask::performTask() if (m_synchronizer) m_synchronizer->taskCompleted(); -#ifndef NDEBUG +#if !LOG_DISABLED m_complete = true; #endif } @@ -108,7 +112,7 @@ void Database::DatabaseOpenTask::doPerformTask() m_success = database()->performOpenAndVerify(m_setVersionInNewDatabase, m_code); } -#ifndef NDEBUG +#if !LOG_DISABLED const char* Database::DatabaseOpenTask::debugTaskName() const { return "DatabaseOpenTask"; @@ -128,7 +132,7 @@ void Database::DatabaseCloseTask::doPerformTask() database()->close(); } -#ifndef NDEBUG +#if !LOG_DISABLED const char* Database::DatabaseCloseTask::debugTaskName() const { return "DatabaseCloseTask"; @@ -150,7 +154,7 @@ void Database::DatabaseTransactionTask::doPerformTask() m_transaction->database()->inProgressTransactionCompleted(); } -#ifndef NDEBUG +#if !LOG_DISABLED const char* Database::DatabaseTransactionTask::debugTaskName() const { return "DatabaseTransactionTask"; @@ -172,7 +176,7 @@ void Database::DatabaseTableNamesTask::doPerformTask() m_tableNames = database()->performGetTableNames(); } -#ifndef NDEBUG +#if !LOG_DISABLED const char* Database::DatabaseTableNamesTask::debugTaskName() const { return "DatabaseTableNamesTask"; diff --git a/Source/WebCore/storage/DatabaseTask.h b/Source/WebCore/storage/DatabaseTask.h index e1df591..faadc69 100644 --- a/Source/WebCore/storage/DatabaseTask.h +++ b/Source/WebCore/storage/DatabaseTask.h @@ -90,7 +90,7 @@ private: Database* m_database; DatabaseTaskSynchronizer* m_synchronizer; -#ifndef NDEBUG +#if !LOG_DISABLED virtual const char* debugTaskName() const = 0; bool m_complete; #endif @@ -107,7 +107,7 @@ private: DatabaseOpenTask(Database*, bool setVersionInNewDatabase, DatabaseTaskSynchronizer*, ExceptionCode&, bool& success); virtual void doPerformTask(); -#ifndef NDEBUG +#if !LOG_DISABLED virtual const char* debugTaskName() const; #endif @@ -127,7 +127,7 @@ private: DatabaseCloseTask(Database*, DatabaseTaskSynchronizer*); virtual void doPerformTask(); -#ifndef NDEBUG +#if !LOG_DISABLED virtual const char* debugTaskName() const; #endif }; @@ -146,7 +146,7 @@ private: DatabaseTransactionTask(PassRefPtr<SQLTransaction>); virtual void doPerformTask(); -#ifndef NDEBUG +#if !LOG_DISABLED virtual const char* debugTaskName() const; #endif @@ -164,7 +164,7 @@ private: DatabaseTableNamesTask(Database*, DatabaseTaskSynchronizer*, Vector<String>& names); virtual void doPerformTask(); -#ifndef NDEBUG +#if !LOG_DISABLED virtual const char* debugTaskName() const; #endif diff --git a/Source/WebCore/storage/SQLTransaction.cpp b/Source/WebCore/storage/SQLTransaction.cpp index dfcd568..0b1ad25 100644 --- a/Source/WebCore/storage/SQLTransaction.cpp +++ b/Source/WebCore/storage/SQLTransaction.cpp @@ -117,7 +117,7 @@ void SQLTransaction::enqueueStatement(PassRefPtr<SQLStatement> statement) m_statementQueue.append(statement); } -#ifndef NDEBUG +#if !LOG_DISABLED const char* SQLTransaction::debugStepName(SQLTransaction::TransactionStepMethod step) { if (step == &SQLTransaction::acquireLock) diff --git a/Source/WebCore/storage/SQLTransaction.h b/Source/WebCore/storage/SQLTransaction.h index 4c84f91..a0a83ed 100644 --- a/Source/WebCore/storage/SQLTransaction.h +++ b/Source/WebCore/storage/SQLTransaction.h @@ -105,7 +105,7 @@ private: void deliverTransactionErrorCallback(); void cleanupAfterTransactionErrorCallback(); -#ifndef NDEBUG +#if !LOG_DISABLED static const char* debugStepName(TransactionStepMethod); #endif diff --git a/Source/WebKit/android/WebCoreSupport/ChromiumIncludes.h b/Source/WebKit/android/WebCoreSupport/ChromiumIncludes.h index 022511a..5dd1cac 100644 --- a/Source/WebKit/android/WebCoreSupport/ChromiumIncludes.h +++ b/Source/WebKit/android/WebCoreSupport/ChromiumIncludes.h @@ -45,6 +45,16 @@ #undef LOG_ASSERT #endif +// Chromium won't build without NDEBUG set, so we set it for all source files +// that use Chromium code. This means that if NDEBUG was previously unset, we +// have to redefine ASSERT() to a no-op, as this is enabled in debug builds. +// Unfortunately, ASSERT() is defined from config.h, so we can't get in first. +#ifndef NDEBUG +#define NDEBUG 1 +#undef ASSERT +#define ASSERT(assertion) (void(0)) +#endif + #include <android/net/android_network_library_impl.h> #include <android/jni/jni_utils.h> #include <base/callback.h> diff --git a/Source/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp b/Source/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp index 0be31eb..d26d523 100644 --- a/Source/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp +++ b/Source/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp @@ -267,11 +267,11 @@ void FrameLoaderClientAndroid::dispatchDidReceiveIcon() { // There is a bug in webkit where cancelling an icon load is treated as a // failure. When this is fixed, we can ASSERT again that we have an icon. if (icon) { - LOGV("Received icon (%p) for %s", icon, + ALOGV("Received icon (%p) for %s", icon, url.utf8().data()); m_webFrame->didReceiveIcon(icon); } else { - LOGV("Icon data for %s unavailable, registering for notification...", + ALOGV("Icon data for %s unavailable, registering for notification...", url.utf8().data()); registerForIconNotification(); } @@ -1016,7 +1016,7 @@ WTF::PassRefPtr<WebCore::Frame> FrameLoaderClientAndroid::createFrame(const KURL newFrame->setView(frameView); newFrame->init(); newFrame->selection()->setFocused(true); - LOGV("::WebCore:: createSubFrame returning %p", newFrame); + ALOGV("::WebCore:: createSubFrame returning %p", newFrame); // The creation of the frame may have run arbitrary JavaScript that removed it from the page already. if (!pFrame->page()) @@ -1331,8 +1331,8 @@ void FrameLoaderClientAndroid::dispatchDidClearWindowObjectInWorld(DOMWrapperWor return; ASSERT(m_frame); - LOGV("::WebCore:: windowObjectCleared called on frame %p for %s\n", - m_frame, m_frame->loader()->url().string().ascii().data()); + ALOGV("::WebCore:: windowObjectCleared called on frame %p for %s\n", + m_frame, m_frame->document()->url().string().ascii().data()); m_webFrame->windowObjectCleared(m_frame); } diff --git a/Source/WebKit/android/jni/JavaBridge.cpp b/Source/WebKit/android/jni/JavaBridge.cpp index 68eb367..91f1e07 100644 --- a/Source/WebKit/android/jni/JavaBridge.cpp +++ b/Source/WebKit/android/jni/JavaBridge.cpp @@ -364,7 +364,7 @@ void JavaBridge::Finalize(JNIEnv* env, jobject obj) JavaBridge* javaBridge = (JavaBridge*) (env->GetIntField(obj, gJavaBridge_ObjectID)); LOG_ASSERT(javaBridge, "Finalize should not be called twice for the same java bridge!"); - LOGV("webcore_javabridge::nativeFinalize(%p)\n", javaBridge); + ALOGV("webcore_javabridge::nativeFinalize(%p)\n", javaBridge); delete javaBridge; env->SetIntField(obj, gJavaBridge_ObjectID, 0); } diff --git a/Source/WebKit/android/jni/WebCoreFrameBridge.cpp b/Source/WebKit/android/jni/WebCoreFrameBridge.cpp index bb28d28..a01cca2 100644 --- a/Source/WebKit/android/jni/WebCoreFrameBridge.cpp +++ b/Source/WebKit/android/jni/WebCoreFrameBridge.cpp @@ -425,7 +425,7 @@ WebFrame::startLoadingResource(WebCore::ResourceHandle* loader, #ifdef ANDROID_INSTRUMENT TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter); #endif - LOGV("::WebCore:: startLoadingResource(%p, %s)", + ALOGV("::WebCore:: startLoadingResource(%p, %s)", loader, request.url().string().latin1().data()); JNIEnv* env = getJNIEnv(); @@ -449,7 +449,7 @@ WebFrame::startLoadingResource(WebCore::ResourceHandle* loader, + urlStr.substring(colon); } } - LOGV("%s lower=%s", __FUNCTION__, urlStr.latin1().data()); + ALOGV("%s lower=%s", __FUNCTION__, urlStr.latin1().data()); jstring jUrlStr = wtfStringToJstring(env, urlStr); jstring jMethodStr = NULL; if (!method.isEmpty()) @@ -475,7 +475,7 @@ WebFrame::startLoadingResource(WebCore::ResourceHandle* loader, break; } - LOGV("::WebCore:: startLoadingResource %s with cacheMode %d", urlStr.ascii().data(), cacheMode); + ALOGV("::WebCore:: startLoadingResource %s with cacheMode %d", urlStr.ascii().data(), cacheMode); ResourceHandleInternal* loaderInternal = loader->getInternal(); jstring jUsernameString = loaderInternal->m_user.isEmpty() ? @@ -513,7 +513,7 @@ WebFrame::shouldInterceptRequest(const WTF::String& url) #ifdef ANDROID_INSTRUMENT TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter); #endif - LOGV("::WebCore:: shouldInterceptRequest(%s)", url.latin1().data()); + ALOGV("::WebCore:: shouldInterceptRequest(%s)", url.latin1().data()); JNIEnv* env = getJNIEnv(); AutoJObject javaFrame = mJavaFrame->frame(env); @@ -537,7 +537,7 @@ WebFrame::reportError(int errorCode, const WTF::String& description, #ifdef ANDROID_INSTRUMENT TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter); #endif - LOGV("::WebCore:: reportError(%d, %s)", errorCode, description.ascii().data()); + ALOGV("::WebCore:: reportError(%d, %s)", errorCode, description.ascii().data()); JNIEnv* env = getJNIEnv(); AutoJObject javaFrame = mJavaFrame->frame(env); if (!javaFrame.get()) @@ -589,7 +589,7 @@ WebFrame::loadStarted(WebCore::Frame* frame) const WebCore::KURL& url = documentLoader->url(); if (url.isEmpty()) return; - LOGV("::WebCore:: loadStarted %s", url.string().ascii().data()); + ALOGV("::WebCore:: loadStarted %s", url.string().ascii().data()); bool isMainFrame = (!frame->tree() || !frame->tree()->parent()); WebCore::FrameLoadType loadType = frame->loader()->loadType(); @@ -609,7 +609,7 @@ WebFrame::loadStarted(WebCore::Frame* frame) WebCore::Image* icon = WebCore::iconDatabase().synchronousIconForPageURL(urlString, WebCore::IntSize(16, 16)); if (icon) favicon = webcoreImageToJavaBitmap(env, icon); - LOGV("favicons", "Starting load with icon %p for %s", icon, url.string().utf8().data()); + ALOGV("favicons", "Starting load with icon %p for %s", icon, url.string().utf8().data()); } jstring urlStr = wtfStringToJstring(env, urlString); @@ -667,7 +667,7 @@ WebFrame::didFinishLoad(WebCore::Frame* frame) const WebCore::KURL& url = documentLoader->url(); if (url.isEmpty()) return; - LOGV("::WebCore:: didFinishLoad %s", url.string().ascii().data()); + ALOGV("::WebCore:: didFinishLoad %s", url.string().ascii().data()); bool isMainFrame = (!frame->tree() || !frame->tree()->parent()); WebCore::FrameLoadType loadType = loader->loadType(); @@ -684,7 +684,7 @@ WebFrame::addHistoryItem(WebCore::HistoryItem* item) #ifdef ANDROID_INSTRUMENT TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter); #endif - LOGV("::WebCore:: addHistoryItem"); + ALOGV("::WebCore:: addHistoryItem"); JNIEnv* env = getJNIEnv(); WebHistory::AddItem(mJavaFrame->history(env), item); } @@ -695,7 +695,7 @@ WebFrame::removeHistoryItem(int index) #ifdef ANDROID_INSTRUMENT TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter); #endif - LOGV("::WebCore:: removeHistoryItem at %d", index); + ALOGV("::WebCore:: removeHistoryItem at %d", index); JNIEnv* env = getJNIEnv(); WebHistory::RemoveItem(mJavaFrame->history(env), index); } @@ -706,7 +706,7 @@ WebFrame::updateHistoryIndex(int newIndex) #ifdef ANDROID_INSTRUMENT TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter); #endif - LOGV("::WebCore:: updateHistoryIndex to %d", newIndex); + ALOGV("::WebCore:: updateHistoryIndex to %d", newIndex); JNIEnv* env = getJNIEnv(); WebHistory::UpdateHistoryIndex(mJavaFrame->history(env), newIndex); } @@ -718,7 +718,7 @@ WebFrame::setTitle(const WTF::String& title) TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter); #endif #ifndef NDEBUG - LOGV("setTitle(%s)", title.ascii().data()); + ALOGV("setTitle(%s)", title.ascii().data()); #endif JNIEnv* env = getJNIEnv(); AutoJObject javaFrame = mJavaFrame->frame(env); @@ -738,7 +738,7 @@ WebFrame::windowObjectCleared(WebCore::Frame* frame) #ifdef ANDROID_INSTRUMENT TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter); #endif - LOGV("::WebCore:: windowObjectCleared"); + ALOGV("::WebCore:: windowObjectCleared"); JNIEnv* env = getJNIEnv(); AutoJObject javaFrame = mJavaFrame->frame(env); if (!javaFrame.get()) @@ -1362,7 +1362,7 @@ static void CreateFrame(JNIEnv* env, jobject obj, jobject javaview, jobject jAss WebCore::SecurityOrigin::setLocalLoadPolicy( WebCore::SecurityOrigin::AllowLocalLoadsForLocalAndSubstituteData); - LOGV("::WebCore:: createFrame %p", frame); + ALOGV("::WebCore:: createFrame %p", frame); // Set the mNativeFrame field in Frame SET_NATIVE_FRAME(env, obj, (int)frame); @@ -1390,7 +1390,7 @@ static void DestroyFrame(JNIEnv* env, jobject obj) WebCore::Frame* pFrame = GET_NATIVE_FRAME(env, obj); LOG_ASSERT(pFrame, "nativeDestroyFrame must take a valid frame pointer!"); - LOGV("::WebCore:: deleting frame %p", pFrame); + ALOGV("::WebCore:: deleting frame %p", pFrame); WebCore::FrameView* view = pFrame->view(); view->ref(); @@ -1463,7 +1463,7 @@ static void LoadUrl(JNIEnv *env, jobject obj, jstring url, jobject headers) env->DeleteLocalRef(set); env->DeleteLocalRef(mapClass); } - LOGV("LoadUrl %s", kurl.string().latin1().data()); + ALOGV("LoadUrl %s", kurl.string().latin1().data()); pFrame->loader()->load(request, false); } @@ -1491,7 +1491,7 @@ static void PostUrl(JNIEnv *env, jobject obj, jstring url, jbyteArray postData) env->ReleaseByteArrayElements(postData, bytes, 0); } - LOGV("PostUrl %s", kurl.string().latin1().data()); + ALOGV("PostUrl %s", kurl.string().latin1().data()); WebCore::FrameLoadRequest frameRequest(pFrame->document()->securityOrigin(), request); pFrame->loader()->loadFrameRequest(frameRequest, false, false, 0, 0, WebCore::SendReferrer); } @@ -1531,7 +1531,7 @@ static void StopLoading(JNIEnv *env, jobject obj) #endif WebCore::Frame* pFrame = GET_NATIVE_FRAME(env, obj); LOG_ASSERT(pFrame, "nativeStopLoading must take a valid frame pointer!"); - LOGV("::WebCore:: stopLoading %p", pFrame); + ALOGV("::WebCore:: stopLoading %p", pFrame); // Stop loading the page and do not send an unload event pFrame->loader()->stopForUserCancel(); @@ -1843,7 +1843,7 @@ static void AddJavascriptInterface(JNIEnv *env, jobject obj, jint nativeFramePoi JavaVM* vm; env->GetJavaVM(&vm); - LOGV("::WebCore:: addJSInterface: %p", pFrame); + ALOGV("::WebCore:: addJSInterface: %p", pFrame); #if USE(JSC) // Copied from qwebframe.cpp @@ -2113,7 +2113,7 @@ static void OrientationChanged(JNIEnv *env, jobject obj, int orientation) TimeCounterAuto counter(TimeCounter::NativeCallbackTimeCounter); #endif WebCore::Frame* pFrame = GET_NATIVE_FRAME(env, obj); - LOGV("Sending orientation: %d", orientation); + 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 f9acc97..7845533 100644 --- a/Source/WebKit/android/jni/WebCoreResourceLoader.cpp +++ b/Source/WebKit/android/jni/WebCoreResourceLoader.cpp @@ -158,11 +158,11 @@ jint WebCoreResourceLoader::CreateResponse(JNIEnv* env, jobject obj, jstring url WTF::String mimeTypeStr; if (mimeType) { mimeTypeStr = jstringToWtfString(env, mimeType); - LOGV("Response setMIMEType: %s", mimeTypeStr.latin1().data()); + ALOGV("Response setMIMEType: %s", mimeTypeStr.latin1().data()); } if (encoding) { encodingStr = jstringToWtfString(env, encoding); - LOGV("Response setTextEncodingName: %s", encodingStr.latin1().data()); + ALOGV("Response setTextEncodingName: %s", encodingStr.latin1().data()); } WebCore::ResourceResponse* response = new WebCore::ResourceResponse( kurl, mimeTypeStr, (long long)expectedLength, @@ -171,7 +171,7 @@ jint WebCoreResourceLoader::CreateResponse(JNIEnv* env, jobject obj, jstring url if (statusText) { WTF::String status = jstringToWtfString(env, statusText); response->setHTTPStatusText(status); - LOGV("Response setStatusText: %s", status.latin1().data()); + ALOGV("Response setStatusText: %s", status.latin1().data()); } return (int)response; } @@ -199,7 +199,7 @@ void WebCoreResourceLoader::AddData(JNIEnv* env, jobject obj, jbyteArray dataArr #ifdef ANDROID_INSTRUMENT TimeCounterAuto counter(TimeCounter::ResourceTimeCounter); #endif - LOGV("webcore_resourceloader data(%d)", length); + ALOGV("webcore_resourceloader data(%d)", length); WebCore::ResourceHandle* handle = GET_NATIVE_HANDLE(env, obj); LOG_ASSERT(handle, "nativeAddData must take a valid handle!"); @@ -222,7 +222,7 @@ void WebCoreResourceLoader::Finished(JNIEnv* env, jobject obj) #ifdef ANDROID_INSTRUMENT TimeCounterAuto counter(TimeCounter::ResourceTimeCounter); #endif - LOGV("webcore_resourceloader finished"); + ALOGV("webcore_resourceloader finished"); WebCore::ResourceHandle* handle = GET_NATIVE_HANDLE(env, obj); LOG_ASSERT(handle, "nativeFinished must take a valid handle!"); // ResourceLoader::didFail() can set handle to be NULL, we need to check @@ -239,7 +239,7 @@ jstring WebCoreResourceLoader::RedirectedToUrl(JNIEnv* env, jobject obj, #ifdef ANDROID_INSTRUMENT TimeCounterAuto counter(TimeCounter::ResourceTimeCounter); #endif - LOGV("webcore_resourceloader redirectedToUrl"); + ALOGV("webcore_resourceloader redirectedToUrl"); WebCore::ResourceHandle* handle = GET_NATIVE_HANDLE(env, obj); LOG_ASSERT(handle, "nativeRedirectedToUrl must take a valid handle!"); // ResourceLoader::didFail() can set handle to be NULL, we need to check @@ -278,7 +278,7 @@ void WebCoreResourceLoader::Error(JNIEnv* env, jobject obj, jint id, jstring des #ifdef ANDROID_INSTRUMENT TimeCounterAuto counter(TimeCounter::ResourceTimeCounter); #endif - LOGV("webcore_resourceloader error"); + ALOGV("webcore_resourceloader error"); WebCore::ResourceHandle* handle = GET_NATIVE_HANDLE(env, obj); LOG_ASSERT(handle, "nativeError must take a valid handle!"); // ResourceLoader::didFail() can set handle to be NULL, we need to check diff --git a/Source/WebKit/android/jni/WebHistory.cpp b/Source/WebKit/android/jni/WebHistory.cpp index 7ec73a3..7e2e9b9 100644 --- a/Source/WebKit/android/jni/WebHistory.cpp +++ b/Source/WebKit/android/jni/WebHistory.cpp @@ -375,7 +375,7 @@ static void write_string(WTF::Vector<char>& v, const WTF::String& str) char* data = v.begin() + vectorLen; // Write the actual string int l = SkUTF16_ToUTF8(str.characters(), strLen, data); - LOGV("Writing string %d %.*s", l, l, data); + ALOGV("Writing string %d %.*s", l, l, data); // Go back and write the utf8 length. Subtract sizeof(unsigned) from // data to get the position to write the length. memcpy(data - sizeof(unsigned), (char*)&l, sizeof(unsigned)); @@ -417,10 +417,10 @@ static void write_item(WTF::Vector<char>& v, WebCore::HistoryItem* item) LOG_ASSERT(bridge, "We should have a bridge here!"); // Screen scale const float scale = bridge->scale(); - LOGV("Writing scale %f", scale); + ALOGV("Writing scale %f", scale); v.append((char*)&scale, sizeof(float)); const float textWrapScale = bridge->textWrapScale(); - LOGV("Writing text wrap scale %f", textWrapScale); + ALOGV("Writing text wrap scale %f", textWrapScale); v.append((char*)&textWrapScale, sizeof(float)); // Scroll position. @@ -433,19 +433,19 @@ static void write_item(WTF::Vector<char>& v, WebCore::HistoryItem* item) const WTF::Vector<WTF::String>& docState = item->documentState(); WTF::Vector<WTF::String>::const_iterator end = docState.end(); unsigned stateSize = docState.size(); - LOGV("Writing docState %d", stateSize); + ALOGV("Writing docState %d", stateSize); v.append((char*)&stateSize, sizeof(unsigned)); for (WTF::Vector<WTF::String>::const_iterator i = docState.begin(); i != end; ++i) { write_string(v, *i); } // Is target item - LOGV("Writing isTargetItem %d", item->isTargetItem()); + ALOGV("Writing isTargetItem %d", item->isTargetItem()); v.append((char)item->isTargetItem()); // Children count unsigned childCount = item->children().size(); - LOGV("Writing childCount %d", childCount); + ALOGV("Writing childCount %d", childCount); v.append((char*)&childCount, sizeof(unsigned)); } @@ -495,7 +495,7 @@ static bool read_item_recursive(WebCore::HistoryItem* newItem, // Increment data pointer by the size of an unsigned int. data += sizeofUnsigned; if (l) { - LOGV("Original url %d %.*s", l, l, data); + ALOGV("Original url %d %.*s", l, l, data); // If we have a length, check if that length exceeds the data length // and return null if there is not enough data. if (data + l < end) @@ -513,7 +513,7 @@ static bool read_item_recursive(WebCore::HistoryItem* newItem, memcpy(&l, data, sizeofUnsigned); data += sizeofUnsigned; if (l) { - LOGV("Url %d %.*s", l, l, data); + ALOGV("Url %d %.*s", l, l, data); if (data + l < end) newItem->setURLString(e.decode(data, l)); else @@ -527,7 +527,7 @@ static bool read_item_recursive(WebCore::HistoryItem* newItem, memcpy(&l, data, sizeofUnsigned); data += sizeofUnsigned; if (l) { - LOGV("Title %d %.*s", l, l, data); + ALOGV("Title %d %.*s", l, l, data); if (data + l < end) newItem->setTitle(e.decode(data, l)); else @@ -545,7 +545,7 @@ static bool read_item_recursive(WebCore::HistoryItem* newItem, memcpy(&l, data, sizeofUnsigned); data += sizeofUnsigned; if (l) { - LOGV("Content type %d %.*s", l, l, data); + ALOGV("Content type %d %.*s", l, l, data); if (data + l < end) formContentType = e.decode(data, l); else @@ -559,7 +559,7 @@ static bool read_item_recursive(WebCore::HistoryItem* newItem, memcpy(&l, data, sizeofUnsigned); data += sizeofUnsigned; if (l) { - LOGV("Form data %d %.*s", l, l, data); + ALOGV("Form data %d %.*s", l, l, data); if (data + l < end) formData = WebCore::FormData::create(data, l); else @@ -591,7 +591,7 @@ static bool read_item_recursive(WebCore::HistoryItem* newItem, memcpy(&l, data, sizeofUnsigned); data += sizeofUnsigned; if (l) { - LOGV("Target %d %.*s", l, l, data); + ALOGV("Target %d %.*s", l, l, data); if (data + l < end) newItem->setTarget(e.decode(data, l)); else @@ -606,11 +606,11 @@ static bool read_item_recursive(WebCore::HistoryItem* newItem, float fValue; // Read the screen scale memcpy(&fValue, data, sizeof(float)); - LOGV("Screen scale %f", fValue); + ALOGV("Screen scale %f", fValue); bridge->setScale(fValue); data += sizeof(float); memcpy(&fValue, data, sizeofUnsigned); - LOGV("Text wrap scale %f", fValue); + ALOGV("Text wrap scale %f", fValue); bridge->setTextWrapScale(fValue); data += sizeof(float); @@ -631,7 +631,7 @@ static bool read_item_recursive(WebCore::HistoryItem* newItem, // Read the document state memcpy(&l, data, sizeofUnsigned); - LOGV("Document state %d", l); + ALOGV("Document state %d", l); data += sizeofUnsigned; if (l) { // Check if we have enough data to at least parse the sizes of each @@ -653,7 +653,7 @@ static bool read_item_recursive(WebCore::HistoryItem* newItem, docState.append(e.decode(data, strLen)); else return false; - LOGV("\t\t%d %.*s", strLen, strLen, data); + ALOGV("\t\t%d %.*s", strLen, strLen, data); data += strLen; } newItem->setDocumentState(docState); @@ -668,7 +668,7 @@ static bool read_item_recursive(WebCore::HistoryItem* newItem, unsigned char c = (unsigned char)data[0]; if (c > 1) return false; - LOGV("Target item %d", c); + ALOGV("Target item %d", c); newItem->setIsTargetItem((bool)c); data++; if (end - data < sizeofUnsigned) @@ -676,7 +676,7 @@ static bool read_item_recursive(WebCore::HistoryItem* newItem, // Read the child count memcpy(&l, data, sizeofUnsigned); - LOGV("Child count %d", l); + ALOGV("Child count %d", l); data += sizeofUnsigned; *pData = data; if (l) { diff --git a/Source/WebKit/android/jni/WebIconDatabase.cpp b/Source/WebKit/android/jni/WebIconDatabase.cpp index d5f8947..e46b600 100644 --- a/Source/WebKit/android/jni/WebIconDatabase.cpp +++ b/Source/WebKit/android/jni/WebIconDatabase.cpp @@ -185,7 +185,7 @@ static void Open(JNIEnv* env, jobject obj, jstring path) } } if (didSetPermissions) { - LOGV("Opening WebIconDatabase file '%s'", pathStr.latin1().data()); + ALOGV("Opening WebIconDatabase file '%s'", pathStr.latin1().data()); bool res = iconDb.open(pathStr, WebCore::IconDatabase::defaultDatabaseFilename()); if (!res) LOGE("Open failed!"); @@ -200,7 +200,7 @@ static void Close(JNIEnv* env, jobject obj) static void RemoveAllIcons(JNIEnv* env, jobject obj) { - LOGV("Removing all icons"); + ALOGV("Removing all icons"); WebCore::iconDatabase().removeAllIcons(); } @@ -212,7 +212,7 @@ static jobject IconForPageUrl(JNIEnv* env, jobject obj, jstring url) // FIXME: This method should not be used from outside WebCore and will be removed. // http://trac.webkit.org/changeset/81484 WebCore::Image* icon = WebCore::iconDatabase().synchronousIconForPageURL(urlStr, WebCore::IntSize(16, 16)); - LOGV("Retrieving icon for '%s' %p", urlStr.latin1().data(), icon); + ALOGV("Retrieving icon for '%s' %p", urlStr.latin1().data(), icon); return webcoreImageToJavaBitmap(env, icon); } @@ -221,7 +221,7 @@ static void RetainIconForPageUrl(JNIEnv* env, jobject obj, jstring url) LOG_ASSERT(url, "No url given to retainIconForPageUrl"); WTF::String urlStr = jstringToWtfString(env, url); - LOGV("Retaining icon for '%s'", urlStr.latin1().data()); + ALOGV("Retaining icon for '%s'", urlStr.latin1().data()); WebCore::iconDatabase().retainIconForPageURL(urlStr); } @@ -230,7 +230,7 @@ static void ReleaseIconForPageUrl(JNIEnv* env, jobject obj, jstring url) LOG_ASSERT(url, "No url given to releaseIconForPageUrl"); WTF::String urlStr = jstringToWtfString(env, url); - LOGV("Releasing icon for '%s'", urlStr.latin1().data()); + ALOGV("Releasing icon for '%s'", urlStr.latin1().data()); WebCore::iconDatabase().releaseIconForPageURL(urlStr); } diff --git a/Source/WebKit/android/jni/WebViewCore.cpp b/Source/WebKit/android/jni/WebViewCore.cpp index d7a61aa..f3eac89 100644 --- a/Source/WebKit/android/jni/WebViewCore.cpp +++ b/Source/WebKit/android/jni/WebViewCore.cpp @@ -1140,7 +1140,7 @@ void WebViewCore::didFirstLayout() const WebCore::KURL& url = m_mainFrame->document()->url(); if (url.isEmpty()) return; - LOGV("::WebCore:: didFirstLayout %s", url.string().ascii().data()); + ALOGV("::WebCore:: didFirstLayout %s", url.string().ascii().data()); WebCore::FrameLoadType loadType = m_mainFrame->loader()->loadType(); @@ -2506,7 +2506,7 @@ String WebViewCore::modifySelectionTextNavigationAxis(DOMSelection* selection, i IntRect bounds = range->boundingBox(); selectAt(bounds.center().x(), bounds.center().y()); markup = formatMarkup(selection); - LOGV("Selection markup: %s", markup.utf8().data()); + ALOGV("Selection markup: %s", markup.utf8().data()); return markup; } @@ -2765,7 +2765,7 @@ String WebViewCore::modifySelectionDomNavigationAxis(DOMSelection* selection, in m_currentNodeDomNavigationAxis = currentNode; scrollNodeIntoView(m_mainFrame, currentNode); String selectionString = createMarkup(currentNode); - LOGV("Selection markup: %s", selectionString.utf8().data()); + ALOGV("Selection markup: %s", selectionString.utf8().data()); return selectionString; } return String(); @@ -4008,7 +4008,7 @@ static void SetSize(JNIEnv *env, jobject obj, jint width, jint height, TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter); #endif WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj); - LOGV("webviewcore::nativeSetSize(%u %u)\n viewImpl: %p", (unsigned)width, (unsigned)height, viewImpl); + ALOGV("webviewcore::nativeSetSize(%u %u)\n viewImpl: %p", (unsigned)width, (unsigned)height, viewImpl); LOG_ASSERT(viewImpl, "viewImpl not set in nativeSetSize"); viewImpl->setSizeScreenWidthAndScale(width, height, textWrapWidth, scale, screenWidth, screenHeight, anchorX, anchorY, ignoreHeight); @@ -4134,7 +4134,7 @@ static void SetFocusControllerActive(JNIEnv *env, jobject obj, jboolean active) #ifdef ANDROID_INSTRUMENT TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter); #endif - LOGV("webviewcore::nativeSetFocusControllerActive()\n"); + ALOGV("webviewcore::nativeSetFocusControllerActive()\n"); WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj); LOG_ASSERT(viewImpl, "viewImpl not set in nativeSetFocusControllerActive"); viewImpl->setFocusControllerActive(active); @@ -4145,7 +4145,7 @@ static void SaveDocumentState(JNIEnv *env, jobject obj, jint frame) #ifdef ANDROID_INSTRUMENT TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter); #endif - LOGV("webviewcore::nativeSaveDocumentState()\n"); + ALOGV("webviewcore::nativeSaveDocumentState()\n"); WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj); LOG_ASSERT(viewImpl, "viewImpl not set in nativeSaveDocumentState"); viewImpl->saveDocumentState((WebCore::Frame*) frame); diff --git a/Source/WebKit/android/wds/client/AdbConnection.cpp b/Source/WebKit/android/wds/client/AdbConnection.cpp index 465f9c3..617ed72 100644 --- a/Source/WebKit/android/wds/client/AdbConnection.cpp +++ b/Source/WebKit/android/wds/client/AdbConnection.cpp @@ -89,7 +89,7 @@ bool AdbConnection::sendRequest(const char* fmt, ...) const { int res = vsnprintf(buf, MAX_COMMAND_LENGTH, fmt, args); va_end(args); - LOGV("Sending command: %04X%.*s", res, res, buf); + ALOGV("Sending command: %04X%.*s", res, res, buf); // Construct the payload length char payloadLen[PAYLOAD_LENGTH + 1]; @@ -156,7 +156,7 @@ bool AdbConnection::checkOkayResponse() const { // Check for a response other than OKAY/FAIL if ((res == ADB_RESPONSE_LENGTH) && (strncmp(buf, "OKAY", res) == 0)) { - LOGV("Command OKAY"); + ALOGV("Command OKAY"); return true; } else if (strncmp(buf, "FAIL", ADB_RESPONSE_LENGTH) == 0) { // Something happened, print out the reason for failure @@ -224,7 +224,7 @@ const DeviceList& AdbConnection::getDeviceList() { static const char emulator[] = "emulator-"; if (strncmp(serial, emulator, sizeof(emulator) - 1) == 0) t = Device::EMULATOR; - LOGV("Adding device %s (%s)", serial, state); + ALOGV("Adding device %s (%s)", serial, state); m_devices.add(new Device(serial, t, this)); // Reset for the next line diff --git a/Source/WebKit/android/wds/client/main.cpp b/Source/WebKit/android/wds/client/main.cpp index 1c7d856..7e96f30 100644 --- a/Source/WebKit/android/wds/client/main.cpp +++ b/Source/WebKit/android/wds/client/main.cpp @@ -141,7 +141,7 @@ int main(int argc, char** argv) { return 1; } - LOGV("Connecting to localhost port " PORT_STR); + ALOGV("Connecting to localhost port " PORT_STR); const char* command = argv[optind]; int commandLen = strlen(command); |