[GTK] Add support for loading web process extensions
https://bugs.webkit.org/show_bug.cgi?id=105631

Patch by Carlos Garcia Campos <cgarcia@igalia.com> on 2013-01-10
Reviewed by Gustavo Noronha Silva.

.:

* GNUmakefile.am: Add webkit2_web_extension_h_api.
* Source/autotools/symbols.filter: Export WebGtkExtensionManager
symbols required by the injected bundle lib.

Source/WebKit2:

* GNUmakefile.am: Link to libWebCoreDOM.la and build injected
bundle lib.
* GNUmakefile.list.am: Add new files to compilation.
* UIProcess/API/gtk/WebKitWebContext.cpp:
(injectedBundleDirectory): Helper funtion to get the injected
bundle directory.
(injectedBundleFilename): Helper funtion to get the injected undle
library full path.
(createDefaultWebContext): Create the WebContext with an injected
bundle path.
* UIProcess/API/gtk/WebKitWebView.cpp:
(webkit_web_view_get_page_id): Return the identifier of the web
page associated to the web view.
* UIProcess/API/gtk/WebKitWebView.h:
* UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Add new chapter for
web extensions.
* UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Add new symbols.
* UIProcess/API/gtk/docs/webkit2gtk.types: Add new types.
* UIProcess/API/gtk/tests/GNUmakefile.am: Add new files to compilation.
* UIProcess/API/gtk/tests/TestMain.cpp:
(main):
* UIProcess/API/gtk/tests/TestWebExtensions.cpp: Added.
(testWebExtension):
(beforeAll):
(afterAll):
* UIProcess/API/gtk/tests/WebExtensionTest.cpp: Added.
(methodCallCallback):
(webkit_web_extension_initialize):
* UIProcess/API/gtk/tests/WebKitTestBus.cpp: Added.
(WebKitTestBus::WebKitTestBus):
(WebKitTestBus::run):
(WebKitTestBus::~WebKitTestBus):
(WebKitTestBus::connection):
(onNameAppeared):
(WebKitTestBus::createProxy):
* UIProcess/API/gtk/tests/WebKitTestBus.h: Added.
(WebKitTestBus):
* WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp: Added.
(_WebKitWebExtensionPrivate):
(webkitWebExtensionPageCreated): Create a WebKitWebPage for the
newly crated page and emit WebKitWebExtension::page-created
signals.
(webkitWebExtensionPageDestroy): Remove the page from the map.
(didCreatePage): Call webkitWebExtensionPageCreated().
(willDestroyPage): Call webkitWebExtensionPageDestroy().
(webkitWebExtensionCreate): Create a new WebKitWebExtension and
initialize the injected bundle client.
(webkit_web_extension_get_page): Return the WebKitWebPage for the
given page identifier.
* WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.h: Added.
(_WebKitWebExtension):
(_WebKitWebExtensionClass):
* WebProcess/InjectedBundle/API/gtk/WebKitWebExtensionDefines.h: Added.
* WebProcess/InjectedBundle/API/gtk/WebKitWebExtensionPrivate.h: Added.
* WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp: Added.
(_WebKitWebPagePrivate):
(webkit_web_page_class_init):
(webkitWebPageCreate): Create a new WebKitWebPage.
(webkit_web_page_get_dom_document): Return the WebKitDOMDocument
loaded in the WebKitWebPage.
* WebProcess/InjectedBundle/API/gtk/WebKitWebPage.h: Added.
(_WebKitWebPage):
(_WebKitWebPageClass):
* WebProcess/InjectedBundle/API/gtk/WebKitWebPagePrivate.h: Added.
* WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h: Added.
* WebProcess/gtk/WebGtkExtensionManager.cpp: Added.
(WebKit::WebGtkExtensionManager::shared): Return the global shared
instance.
(WebKit::WebGtkExtensionManager::WebGtkExtensionManager):
(WebKit::WebGtkExtensionManager::appendModuleDirectories): Add
directories to scan for modules.
(WebKit::WebGtkExtensionManager::scanModules): Scan for modules.
(WebKit::WebGtkExtensionManager::initialize): Load and initialize
the modules found.
* WebProcess/gtk/WebGtkExtensionManager.h: Added.
* WebProcess/gtk/WebGtkInjectedBundleMain.cpp: Added.
(WKBundleInitialize): Initialize WebGtkExtensionManager.

Tools:

* MiniBrowser/gtk/GNUmakefile.am:
* MiniBrowser/gtk/main.c:
(main): Set WEBKIT_INJECTED_BUNDLE env var to use the injected
bundle lib from build dir.
* Scripts/webkitpy/style/checker.py: Add exceptions for GTK+ API
located in WebProcess/InjectedBundle/API/gtk.
* gtk/generate-gtkdoc:
(get_webkit2_options): Scan also files in
WebProcess/InjectedBundle/API/gtk to generate API docs.
(get_webkit2_options.injected_bundle_src_path): Helper function to
build paths in WebProcess/InjectedBundle/API/gtk.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@139305 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Native Memory Instrumentation: fix instrumentation for already instrumented classes 2/N
https://bugs.webkit.org/show_bug.cgi?id=106546

Reviewed by Vsevolod Vlasov.

Many nontrivial class members were instrumented in reportMemoryUsage methods.

* bindings/v8/V8PerIsolateData.cpp:
(WebCore::V8PerIsolateData::reportMemoryUsage):
* css/CSSMediaRule.cpp:
(WebCore::CSSMediaRule::reportMemoryUsage):
* css/CSSProperty.cpp:
(WebCore::CSSProperty::reportMemoryUsage):
* css/CSSStyleSheet.cpp:
(WebCore::CSSStyleSheet::reportMemoryUsage):
* css/MediaList.cpp:
(WebCore::MediaList::reportMemoryUsage):
* css/RuleSet.cpp:
(WebCore::RuleData::reportMemoryUsage):
(WebCore::RuleSet::reportMemoryUsage):
(WebCore::RuleSet::RuleSetSelectorPair::reportMemoryUsage):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::MatchedPropertiesCacheItem::reportMemoryUsage):
(WebCore::StyleResolver::reportMemoryUsage):
* css/StyleSheetContents.cpp:
(WebCore::StyleSheetContents::reportMemoryUsage):
* dom/TreeScope.cpp:
(WebCore::TreeScope::reportMemoryUsage):
* inspector/HeapGraphSerializer.cpp:
(WebCore::HeapGraphSerializer::reportMemoryUsage):
* inspector/InspectorMemoryAgent.cpp:
* inspector/InspectorProfilerAgent.cpp:
(WebCore::InspectorProfilerAgent::reportMemoryUsage):
* inspector/MemoryInstrumentationImpl.cpp:
(WebCore::MemoryInstrumentationClientImpl::reportMemoryUsage):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::reportMemoryUsage):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::reportMemoryUsage):
* loader/MainResourceLoader.cpp:
(WebCore::MainResourceLoader::reportMemoryUsage):
* loader/Prerenderer.cpp:
(WebCore::Prerenderer::reportMemoryUsage):
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::reportMemoryUsage):
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::reportMemoryUsage):
* page/Page.cpp:
(WebCore::Page::reportMemoryUsage):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@139306 268f45cc-cd09-0410-ab3c-d52691b4dbfc