• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            C++博客 聯系 聚合 管理  

            Blog Stats

            文章分類(17)

            收藏夾(2)

            文章檔案(18)

            相冊

            Blogs

            citywanderer

            StormWebkit:webkit的一個port,專用于linux字符模式下的運行。2012年由storm創建

            參考qt
            1、判定知否支持的port
            541 # Force re-link of existing libraries if different than expected
            542 removeLibraryDependingOnFeature("WebCore", "SVG", $svgSupport);
            #返回 Unsupported platform, can't determine built library locations.

            Tools/Scripts/webkitperl/features.pm:97
             94 sub removeLibraryDependingOnFeature($$$)
             
            95 {
             
            96     my ($libraryName, $featureName, $shouldHaveFeature= @_;
             
            97     my $path = builtDylibPathForName($libraryName);

            增加代碼:
            Tools/Scripts/webkitdirs.pm
            2047 #ginozhang 2012.2.11
            2048 my $isStorm;
            2049 sub isStorm()
            2050 {   
            2051     determineIsStorm();
            2052     return $isStorm;
            2053 }       
            2054 sub determineIsStorm()
            2055 {
            2056     return if defined($isStorm);
            2057        
            2058     # Allow override in case QTDIR is not set.
            2059     if (checkForArgumentAndRemoveFromARGV("--storm")) {
            2060         $isStorm = 1;
            2061         return;
            2062     }
            2063        
            2064     # The presence of QTDIR only means Qt if --gtk or --wx or --efl are not on the command-line
            2065     if (isQt() || isGtk() || isWx() || isEfl()) {
            2066         $isStorm = 0;
            2067         return;
            2068     }  
            2069        
            2070     $isStorm = defined($ENV{'STORMDIR'});
            2071 }

             597 sub builtDylibPathForName
             
            598 {
             
            599     my $libraryName = shift;
             
            600     determineConfigurationProductDir();
             
            601     if (isChromium()) {
             
            602         return "$configurationProductDir/$libraryName";
             
            603     }
             
            604     #ginozhang
             605     if (isStorm()) { 
             
            606         $libraryName = "StormWebKit";
             
            607         return "$configurationProductDir/lib/lib$libraryName.so";
             
            608     }
             
            609     if (isQt()) {

            2、
            581     # For Gtk and Qt the WebKit project builds all others
            582     # ginozhang
            583     if ((isGtk() || isQt() || isStorm()) && $dir ne "Source/WebKit") {
            584         chdirWebKit();
            585         next;
            586     }

            3、buildQMakeStormProject,由 Source/DerivedSources.pro生成makefile 
            594     } #ginozhang
            595     elsif (isStorm()) {
            596         #FIXME: $dir should probably be $project.
            597         $result = buildQMakeStormProject($dir, $clean, @options);
            598     } elsif (isAppleMacWebKit()) {

            Tools/Scripts/webkitdirs.pm
            buildQMakeStormProject()
            3.1 增加WebKit/storm/Api/目錄
            用途:用于生成WebKit/storm/Api/Makefile.DerivedSources文件
            3.2 運行Source/DerivedSources.pro查看
            Source/JavaScriptCore/DerivedSources.pro、WebCore/DerivedSources.proSource/WebKit/storm/Api/DerivedSources.pro是否存在,并生成對應的makefile
            2136     push @dsQmakeArgs, "-o Makefile.DerivedSources";
            2137     print "Calling '$qmakebin @dsQmakeArgs' in " . $dir . "\n\n";
            #qmake -r OUTPUT_DIR=/root/TestQtWebKit-2.2.0/QtWebKit-2.2.0/WebKitBuild/Debug -r /root/TestQtWebKit-2.2.0/QtWebKit-2.2.0/Source/DerivedSources.pro -o Makefile.DerivedSources
            2138     my $result = system "$qmakebin @dsQmakeArgs";
            2139     if ($result ne 0) {
            2140         die "Failed while running $qmakebin to generate derived sources!\n";
            2141     }
            增加Source/WebKit/storm/Api/目錄
            增加、編輯Source/WebKit/storm/Api/DerivedSources.pro
            如果不正確,會報錯。(tmp 先注視錯誤)
            2163     for my $subdir (@subdirs) {
            2164         my $dsMakefile = "Makefile.DerivedSources";
            2165         print "Calling '$make $makeargs -C $subdir -f $dsMakefile generated_files' in " . $dir . "/$subdir\n\n";
            2166         if ($make eq "nmake") {
            2167             my $subdirWindows = $subdir;
            2168             $subdirWindows =~ s:/:\\:g;
            2169             $result = system "pushd $subdirWindows && $make $makeargs -f $dsMakefile generated_files && popd";
            2170         } else {
            2171             $result = system "$make $makeargs -C $subdir -f $dsMakefile generated_files";
            2172         }
            2173         if ($result ne 0) {
            2174             #ginozhang
            2175             #die "Failed to generate ${subdir}'s derived sources!\n";
            2176         }
            2177     }

            需要增加Source/WebKit/storm/Api/下面的port實現文件?

            3.3、運行Source/WebKit.pro
            2199     push @buildArgs, sourceDir() . "/Source/WebKit.pro";
            2200     print "Calling '$qmakebin @buildArgs' in " . $dir . "\n\n";
            #qmake -r OUTPUT_DIR=/root/TestQtWebKit-2.2.0/QtWebKit-2.2.0/WebKitBuild/Debug CONFIG-=release CONFIG+=debug /root/TestQtWebKit-2.2.0/QtWebKit-2.2.0/Source/WebKit.pro
            2201     print "Installation headers directory: $installHeaders\n" if(defined($installHeaders));
            2202     print "Installation libraries directory: $installLibs\n" if(defined($installLibs));
            2203 
            2204     $result = system "$qmakebin @buildArgs";
            將運行Source/JavaScriptCore/JavaScriptCore.proSource/JavaScriptCore/jsc.proSource/WebCore/WebCore.pro以及如下qt目錄下的pro
            只是WebKit/qt目錄下
            linux-pl6d:~/TestQtWebKit-2.2.0/QtWebKit-2.2.0 # egrep "\bqt\b" Source/WebKit.pro
            SUBDIRS += WebKit/qt/QtWebKit.pro
                
            exists($$PWD/WebKit2/UIProcess/API/qt/tests): SUBDIRS += WebKit2/UIProcess/API/qt/tests
                
            exists($$PWD/WebKit/qt/declarative): SUBDIRS += WebKit/qt/declarative
            exists($$PWD/WebKit/qt/tests): SUBDIRS += WebKit/qt/tests
                    JavaScriptCore
            /qt/api/QtScript.pro \
                    JavaScriptCore
            /qt/tests \
                    JavaScriptCore
            /qt/benchmarks
                
            exists($$PWD/WebKit/qt/symbian/platformplugin): SUBDIRS += WebKit/qt/symbian/platformplugin
            include(WebKit
            /qt/docs/docs.pri)

            3.4、運行Tools/Tools.pro
            需要修改!
            2221         print "Calling '$qmakebin @buildArgs -o $makefile' in " . $dir . "\n\n";
            2222         $result = system "$qmakebin @buildArgs -o $makefile";
            #qmake -r OUTPUT_DIR=/root/TestQtWebKit-2.2.0/QtWebKit-2.2.0/WebKitBuild/Debug CONFIG-=release CONFIG+=debug /root/TestQtWebKit-2.2.0/QtWebKit-2.2.0/Tools/Tools.pro -o Makefile.Tools
            2223         if ($result ne 0) {
            2224             die "Failed to setup build environment using $qmakebin!\n";
            2225         }
            講運行Tools/QtTestBrowser/QtTestBrowser.pro、Tools/DumpRenderTree/qt/DumpRenderTree.proTools/DumpRenderTree/qt/ImageDiff.proTools/DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro

            3.5、運行Source/WebKit/storm/examples/examples.pro
            需要修改!
            2230         my $examplesDir = $dir . "/WebKit/storm/examples";
            2231         File::Path::mkpath($examplesDir);
            2232         $buildArgs[-1= sourceDir() . "/Source/WebKit/storm/examples/examples.pro";
            2233         chdir $examplesDir or die;
            2234         print "Calling '$qmakebin @buildArgs' in " . $examplesDir . "\n\n";
            #qmake -r OUTPUT_DIR=/root/TestQtWebKit-2.2.0/QtWebKit-2.2.0/WebKitBuild/Debug CONFIG-=release CONFIG+=debug /root/TestQtWebKit-2.2.0/QtWebKit-2.2.0/Source/WebKit/storm/examples/examples.pro
            2235         $result = system "$qmakebin @buildArgs";
            2236         die "Failed to create makefiles for the examples!\n" if $result ne 0;
            2237         chdir $dir or die;


            、運行WebKitBuild/Debug/Makefile
             27 SUBTARGETS    =  \
             
            28         sub-JavaScriptCore-JavaScriptCore-pro \
             
            29         sub-JavaScriptCore-jsc-pro \
             
            30         sub-WebCore \
             
            31         sub-WebKit-storm-QtWebKit-pro
             
            32 
            storm的代碼
            141 WebKit/storm/$(MAKEFILE).QtWebKit: 
            142     @$(CHK_DIR_EXISTS) WebKit/storm/ || $(MKDIR) WebKit/storm/ 
            143     cd WebKit/storm/ && $(QMAKE) /root/TestQtWebKit-2.2.0/QtWebKit-2.2.0/Source/WebKit/storm/QtWebKit.pro OUTPUT_DIR=/root/     
                TestQtWebKit
            -2.2.0/QtWebKit-2.2.0/WebKitBuild/Debug CONFIG-=release CONFIG+=debug -o $(MAKEFILE).QtWebKit
            144 sub-WebKit-storm-QtWebKit-pro-qmake_all:  FORCE
            145     @$(CHK_DIR_EXISTS) WebKit/storm/ || $(MKDIR) WebKit/storm/ 
            146     cd WebKit/storm/ && $(QMAKE) /root/TestQtWebKit-2.2.0/QtWebKit-2.2.0/Source/WebKit/storm/QtWebKit.pro OUTPUT_DIR=/root/     
                TestQtWebKit
            -2.2.0/QtWebKit-2.2.0/WebKitBuild/Debug CONFIG-=release CONFIG+=debug -o $(MAKEFILE).QtWebKit
            147 sub-WebKit-storm-QtWebKit-pro: WebKit/storm/$(MAKEFILE).QtWebKit FORCE
            148     cd WebKit/storm/ && $(MAKE) -f $(MAKEFILE).QtWebKit
            storm的 Source/WebKit/storm/QtWebKit.pro(拷貝于qt)
            生成空的header,cpp文件
            egrep '\$\$PWD/(A|W)' QtWebKit.pro | perl -e 'while(my $line=<>){ print "$line";} '| awk -F'PWD/' '{print $2}' | awk '{print $1;}' | awk -F')' '{print $1}' | xargs touch

            Source/WebCore/WebCore.pro關聯的qt中的文件全部替換成storm,并生成空的header,cpp文件

            Source/JavaScriptCore/DerivedSources.pro
            生成JavaScriptCoreWebCoreWebKit/storm/Api目錄下的Makefile.DerivedSources


            類關系圖
            Tools/QtTestBrowser/mainwindow.cpp

            124 WebPage* MainWindow::page() const
            125 {
            126     return m_page;   
            127 }
             38 MainWindow::MainWindow()
             39     : m_page(new WebPage(this))

            Tools/QtTestBrowser/webpage.h
            39 class WebPage : public QWebPage {

            Source/WebKit/qt/Api/qwebpage.h
            70 class QWEBKIT_EXPORT QWebPage : public QObject {
            251     QWebFrame *mainFrame() const;



            在原有的qt上修改(標志:ginozhang)
            -1、./Tools/QtTestBrowser/main.cpp

            #include <QtGui>
            #include <stdio.h>
            #include "qwebframe.h"
            //#include "qwebpage.h"
            #include "webpage.h"
            //#include "webframe.h"
            #include "utils.h"
            #include "mainwindow.h"
            #include "locationedit.h"

            int
            main ( int argc, char *argv[] )
            {
                QUrl qurl = QUrl("http://127.0.0.1/index.html");
                //WebPage* m_page=new WebPage(this);
                QObject o;
                QWebPage* m_page=new QWebPage(&o);
                QWebFrame* mainFrame=m_page->mainFrame();
                mainFrame->load(qurl);
                //printf("url: %s\n", url.toString());
                return 0;
            }


            0、Source/JavaScriptCore/wtf/qt/MainThreadQt.cpp
            wtf將會調用port接口(Source/JavaScriptCore/wtf/qt)

            #0  0xb3a7d2a4 in QObject::thread() const () from /usr/lib/libQtCore.so.4
            #1  0xb6bc0929 in WTF::isMainThread () at ../../../Source/JavaScriptCore/wtf/qt/MainThreadQt.cpp:72
            //ginozhang
            //return QThread::currentThread() == QCoreApplication::instance()->thread();

            #2  0xb6bd168f in WTF::AtomicString::init () at ../../../Source/JavaScriptCore/wtf/text/StringStatics.cpp:77
            #3  0xb65b3001 in WebCore::Settings::Settings (this=0x8113c70, page=0x81124d0) at ../../../Source/WebCore/page/Settings.cpp:190
            #4  0xb659143c in WebCore::Page::Page (this=0x81124d0, pageClients=...) at ../../../Source/WebCore/page/Page.cpp:142
            #5  0xb60485a3 in QWebPagePrivate::QWebPagePrivate (this=0x8110220, qq=0x810fda0)
                at ../../../../Source/WebKit/qt/Api/qwebpage.cpp:349
            #6  0xb604dfcd in QWebPage::QWebPage (this=0x810fda0, parent=0xbffff3f8) at ../../../../Source/WebKit/qt/Api/qwebpage.cpp:1970
            #7  0x0806e29b in main (argc=1, argv=0xbffff4c4) at ../../../Tools/QtTestBrowser/main.cpp:35

            1、Source/WebCore/platform/qt/RenderThemeQt.cpp
            平臺
            QWidget: Must construct a QApplication before a QPaintDevice

            #0  0xffffe424 in __kernel_vsyscall ()
            #1  0xb35988df in raise () from /lib/libc.so.6
            #2  0xb359a220 in abort () from /lib/libc.so.6
            #3  0xb3965a2a in qt_message_output(QtMsgType, char const*) () from /usr/lib/libQtCore.so.4
            #4  0xb3965c2f in ?? () from /usr/lib/libQtCore.so.4
            #5  0xb3965d48 in qFatal(char const*, ...) () from /usr/lib/libQtCore.so.4
            #6  0xb3d37f48 in QWidgetPrivate::QWidgetPrivate(int) () from /usr/lib/libQtGui.so.4
            #7  0xb410307e in ?? () from /usr/lib/libQtGui.so.4
            #8  0xb41a659c in QPushButton::QPushButton(QWidget*) () from /usr/lib/libQtGui.so.4
            #9  0xb67fa67e in WebCore::RenderThemeQt::RenderThemeQt (this=0x8114118, page=0x81124d0)
                at ../../../Source/WebCore/platform/qt/RenderThemeQt.cpp:182
            #10 0xb67fa4b7 in WebCore::RenderThemeQt::create (page=0x81124d0) at ../../../Source/WebCore/platform/qt/RenderThemeQt.cpp:165
            #11 0xb67fa552 in WebCore::RenderTheme::themeForPage (page=0x81124d0) at ../../../Source/WebCore/platform/qt/RenderThemeQt.cpp:171
            //PassRefPtr<RenderTheme> RenderTheme::themeForPage(Page* page)
            //{
                //ginozhang
            //    return 0;
            //-這樣會導致RenderTheme::defaultTheme()返回0,取成員函數時將返回段錯誤(Source/WebCore/css/CSSStyleSelector.cpp572     String defaultRules)

            //修正方法:
            //注釋RenderThemeQt::RenderThemeQt構造函數中的實現
            //179 RenderThemeQt::RenderThemeQt(Page* page)

            #12 0xb6591564 in WebCore::Page::Page (this=0x81124d0, pageClients=...) at ../../../Source/WebCore/page/Page.cpp:165
            145     , m_theme(RenderTheme::themeForPage(this))
            #13 0xb60485a3 in QWebPagePrivate::QWebPagePrivate (this=0x8110220, qq=0x810fda0)
                at ../../../../Source/WebKit/qt/Api/qwebpage.cpp:349
            #14 0xb604dfcd in QWebPage::QWebPage (this=0x810fda0, parent=0xbffff3f8) at ../../../../Source/WebKit/qt/Api/qwebpage.cpp:1970
            #15 0x0806e29b in main (argc=1, argv=0xbffff4c4) at ../../../Tools/QtTestBrowser/main.cpp:35

            2、Source/WebCore/loader/MainResourceLoader.cpp
            436     //ginozhang
            437     //ASSERT(!m_response.isNull());

                 Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
            172 bool FrameLoaderClientQt::dumpFrameLoaderCallbacks = true;//false;//ginozhang

            3、
            linux-pl6d:~/QtWebKit-2.2.0/WebKitBuild/Debug/QtTestBrowser # ../bin/QtTestBrowser    
            QObject::startTimer: QTimer can only be used with threads started with QThread
            QObject::connect: Cannot connect (null)::aboutToQuit() to QWebPage::_q_cleanupLeakMessages()
            WebCoreLoading : About to commit provisional load from previous URL '' to new URL ''
            WebCoreHistory: Updating History for Standard Load in frame
            WebCoreLoading : Finished committing provisional load to URL
            UNIMPLEMENTED:
            ../../../Source/WebCore/html/parser/HTMLTreeBuilder.cpp(2669) : void WebCore::HTMLTreeBuilder::defaultForInitial()
            UNIMPLEMENTED:
            ../../../Source/WebCore/html/parser/HTMLTreeBuilder.cpp(2609) : void WebCore::HTMLTreeBuilder::processEndOfFile(WebCore::AtomicHTMLToken&)
            Progress started (0x8113f68) - frame 0x8129db0(""), value 0.000000, tracked frames 0, originating frame (nil)
            HostInformation '127.0.0.1' loading 'http://127.0.0.1/index.html'. Current count 0
            //253  Source/WebCore/loader/ResourceLoadScheduler.cpp
            ResourceLoadScheduler::scheduleServePendingRequests, m_requestTimer.isActive()=0
            UNIMPLEMENTED:
            ../../../../Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp(977) : virtual bool WebCore::FrameLoaderClientQt::shouldFallBack(const WebCore::ResourceError&)
            Progress completed (0x8113f68) - frame 0x8129db0(""), value 0.100000, tracked frames 1, originating frame 0x8129db0
            Final progress complete (0x8113f68)

            4、build.sh

            #!/bin/sh

            <<COMMENT
            @author: ginozhang
            @date: 2012-01-06
            @description:
            COMMENT

            #zypper in libqt4-devel gperf bison libicu-devel sqlite-devel libQtWebKit-devel
            ./Tools/Scripts/build-webkit --qt --no-video --debug > /root/build.log 2>&1 &
            #./Tools/Scripts/build-webkit --qt --makeargs="-j20 -s" --no-video --debug > /root/build.log 2>&1 &

            #main src:  ./Tools/QtTestBrowser/main.cpp
            #build: WebKitBuild/Debug/QtTestBrowser
            #run:  WebKitBuild/Debug/bin/QtTestBrowser

            5、start
            (./Tools/Scripts/run-launcher --qt --debug > ./log_start.log 2>&1)
            cd WebKitBuild/Debug/QtTestBrowser;
             ../bin/QtTestBrowser

            6、添加curl
            curl-7.20.0.tar.gz
            make;make install;
            #undefined reference to `clock_gettime'
            #vim src/Makefile
            #419     $(LINK) $(curl_LDFLAGS) $(curl_OBJECTS) $(curl_LDADD) $(LIBS) -lrt
            示例程序:docs/examples/getinmemory.c
            gcc -o simple gethtml.c -lcurl

            Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp
             45 #include <stdio.h>
             46 #include <stdlib.h>
             47 #include <string.h>
             48
             49 #include <curl/curl.h>
             50 #include <curl/types.h>
             51 #include <curl/easy.h>
            //添加 libcurl:cd /usr/lib/;ln -s -T /usr/local/lib/libcurl.so libcurl.so
            //vim ./Source/WebCore/WebCore.pri
            //186             LIBS += -lsqlite3 -lcurl

            753 //ginozhang download html use libcurl
            754 //代替 start,forwardData函數
            755 void QNetworkReplyHandler::start()
            756 {  
            757     const QUrl url = m_request.url();
            758     struct MemoryStruct chunk;
            759     QString strUrl=url.toString();
            760     const char* purl=strUrl.toAscii();
            761     download(purl, chunk);
            762
            763     QByteArray data =  chunk.memory;
            764
            765     ResourceHandleClient* client = m_resourceHandle->client();
            766     if (!client)
            767         return;            
            768    
            769     // FIXME: https://bugs.webkit.org/show_bug.cgi?id=19793
            770     // -1 means we do not provide any data about transfer size to inspector so it would use
            771     // Content-Length headers or content size to show transfer size.
            772     if (!data.isEmpty()) {  
            773         client->didReceiveData(m_resourceHandle, data.constData(), data.length(), -1);
                           client->didFinishLoading(m_resourceHandle, 0);
                      }
            774 }  
            671 struct MemoryStruct {
            672     char *memory;
            673     size_t size;
            674 }
            ;
            675 //static void *myrealloc(void *ptr, size_t size);
            676 
            677 static void *myrealloc(void *ptr, size_t size)
            678 //void *QNetworkReplyHandler::myrealloc(void *ptr, size_t size)
            679 {
            680   /* There might be a realloc() out there that doesn't like reallocing
            681      NULL pointers, so we take care of it here 
            */

            682   if(ptr)
            683     return realloc(ptr, size);
            684   else
            685     return malloc(size);
            686 }

            687 
            688 static size_t WriteMemoryCallback(void *ptr, size_t size, size_t nmemb, void *data)
            689 //size_t QNetworkReplyHandler::WriteMemoryCallback(void *ptr, size_t size, size_t nmemb, void *data)
            690 {
            691   size_t realsize = size * nmemb;
            692   struct MemoryStruct *mem = (struct MemoryStruct *)data;
            693 
            694   mem->memory = (char*)myrealloc(mem->memory, mem->size + realsize + 1);
            695   if (mem->memory) {
            696     memcpy(&(mem->memory[mem->size]), ptr, realsize);
            697     mem->size += realsize;
            698     mem->memory[mem->size] = 0;
            699   }

            700   return realsize;
            701 }

            858 void QNetworkReplyHandler::start()
            859 {
            860     const KURL url = m_request.url();
            861     struct MemoryStruct chunk;
            862     //QString strUrl=url.toString();
            863     const char* purl=url.string().latin1().data();
            864     //const char* purl1=strUrl.toAscii();
            865     //QString qString2 = QString::fromUtf8(purl1);
            866 
            867     //const char* purl = qString2.toAscii();
            868 
            869     printf("purl: -%s- url: %s\n", purl, url.string().latin1().data());
            870     CURL *curl_handle;
            871     CURLcode res;
            872     //struct data config;
            873 
            874     //config.trace_ascii = 1; /* enable ascii tracing */
            875 
            876     //struct MemoryStruct chunk;
            877 
            878     chunk.memory=NULL; /* we expect realloc(NULL, size) to work */
            879     chunk.size = 0;    /* no data at this point */
            880 
            881     curl_global_init(CURL_GLOBAL_ALL);
            882 
            883     /* init the curl session */
            884     curl_handle = curl_easy_init();
            885 
            886     //curl_easy_setopt(curl_handle, CURLOPT_DEBUGFUNCTION, my_trace);
            887     //curl_easy_setopt(curl_handle, CURLOPT_DEBUGDATA, &config);
            888     /* specify URL to get */
            889     printf("url: -%s-\n", url.string().latin1().data());
            890     curl_easy_setopt(curl_handle, CURLOPT_URL, url.string().latin1().data());
            891     //curl_easy_setopt(curl_handle, CURLOPT_URL, "http://127.0.0.1/test19.html");
            892 
            893     /* send all data to this function  */
            894     curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, WriteMemoryCallback);
            895 
            896     /* we pass our 'chunk' struct to the callback function */
            897     curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, (void *)&chunk);
            898 
            899     /* some servers don't like requests that are made without a user-agent
            900        field, so we provide one 
            */

            901     curl_easy_setopt(curl_handle, CURLOPT_USERAGENT, "libcurl-agent/1.0");
            902 
            903     /* get it! */
            904     res = curl_easy_perform(curl_handle);
            905     printf("res: %d %s\n", res,chunk.memory?chunk.memory:"no");
            906 
            907     char *ct;
            908     res = curl_easy_getinfo(curl_handle, CURLINFO_CONTENT_TYPE, &ct);
            909     printf("res: %d contenttype: %s\n", res,ct);
            910     WTF::String mimeType(ct);
            911 
            912     long long filesize;
            913     res = curl_easy_getinfo(curl_handle, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &filesize);
            914     printf("res: %d filesize: %llu\n", res,filesize);
            915 
            916 
            917     /* cleanup curl stuff */
            918     curl_easy_cleanup(curl_handle);
            934     /* we're done with libcurl, so clean it up */
            935     curl_global_cleanup();
            936     //download(purl, chunk);
            937 
            938     QByteArray data =  chunk.memory;
            939 
            940     ResourceHandleClient* client = m_resourceHandle->client();
            941     if (!client)
            942         return;
            947     if (!data.isEmpty())
            948     {
            957         ResourceResponse response(url, mimeType.lower()
            958                 , filesize
            959                 ,String()
            960                 , String());
            961         client->didReceiveResponse(m_resourceHandle, response);
            962         client->didReceiveData(m_resourceHandle, data.constData(), data.length(), -1);
            963         //Èç¹ûÔÚËùÓÐÒ³Ãæ¶¼ÏÂÔØ½áÊøºóÖ´ÐÐÏÂÁÐÓï¾ä£¿£¿
            964         client->didFinishLoading(m_resourceHandle, 0);
            965     }

            966 }


            Source/WebCore/loader/cache/CachedResourceRequest.cpp
            151     //ASSERT(loader == m_loader.get());//ginozhang
            Source/WebCore/loader/cache/CachedResourceLoader.cpp
            611     --m_requestCount;if(m_requestCount<0){m_requestCount=0;}//ginozhang 2012.6.10

            7、去除layout
            Source/WebCore/page/FrameView.cpp  790
             787 void FrameView::layout(bool allowSubtree)
             
            788 {
             
            789     //ginozhang
             790     return;

            8、
            Source/WebCore/platform/qt/PlatformScreenQt.cpp

            9、Source/WebCore/platform/qt/RenderThemeQt.cpp

            技巧:
            一、gdb使用python腳本打印qtwekit中對象的方法
            1、打印qtwebkit的python腳本
            例如:QtWebKit-2.2.0/Tools/gdb/webkit.py
            2、gdb啟動時加載python腳本
            ~/.gdbinit
            python
            import sys
            import os
            #python腳本目錄
            sys.path.insert(0, os.getenv('HOME') + '/QtWebKit-2.2.0/Tools/gdb/')
            import webkit
            3、清除其它port代碼
            for dir in chromium efl gtk haiku mac win wince wx;do find . -name "$dir" | xargs rm -fr ;done
            find . -name '*.o' | xargs rm
            find . -name '*.a' | xargs rm

            posted on 2013-08-22 14:25 citywanderer 閱讀(362) 評論(0)  編輯 收藏 引用 所屬分類: webkit
            久久久久久A亚洲欧洲AV冫| 久久精品国产清高在天天线| 久久久亚洲裙底偷窥综合| 国产激情久久久久影院小草| 97超级碰碰碰久久久久| 亚洲伊人久久大香线蕉综合图片| 久久91精品综合国产首页| 久久精品成人免费国产片小草 | 91视频国产91久久久| 97久久婷婷五月综合色d啪蜜芽| 香港aa三级久久三级老师2021国产三级精品三级在 | 精品熟女少妇a∨免费久久| 久久精品国产亚洲AV蜜臀色欲| 一本色道久久88综合日韩精品| 免费一级欧美大片久久网 | 久久国产精品-国产精品| 国产精品视频久久| 国产成人久久精品麻豆一区 | 国产精品一区二区久久| 久久免费高清视频| 大美女久久久久久j久久| 青青草国产97免久久费观看| 久久国产AVJUST麻豆| 欧美一区二区三区久久综合| 久久成人国产精品二三区| 欧洲国产伦久久久久久久| 亚洲国产精品嫩草影院久久| 亚洲精品乱码久久久久久蜜桃不卡 | 久久久久99精品成人片试看| 99久久99久久| 亚洲七七久久精品中文国产| 亚洲午夜久久久久久噜噜噜| 色噜噜狠狠先锋影音久久| 久久精品国产亚洲av麻豆图片| 久久综合狠狠色综合伊人| 久久婷婷是五月综合色狠狠| 久久精品国产一区| 少妇熟女久久综合网色欲| 97超级碰碰碰碰久久久久| 亚洲AV无码一区东京热久久| 97精品国产97久久久久久免费|