diff options
Diffstat (limited to 'WebKit/mac/WebView/WebDataSource.mm')
| -rw-r--r-- | WebKit/mac/WebView/WebDataSource.mm | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/WebKit/mac/WebView/WebDataSource.mm b/WebKit/mac/WebView/WebDataSource.mm index 8a3842e..02dbc2c 100644 --- a/WebKit/mac/WebView/WebDataSource.mm +++ b/WebKit/mac/WebView/WebDataSource.mm @@ -60,6 +60,7 @@ #import <WebKit/DOMPrivate.h> #import <runtime/InitializeThreading.h> #import <wtf/Assertions.h> +#import <wtf/Threading.h> using namespace WebCore; @@ -70,6 +71,7 @@ using namespace WebCore; id <WebDocumentRepresentation> representation; BOOL representationFinishedLoading; + BOOL includedInWebKitStatistics; } @end @@ -78,6 +80,7 @@ using namespace WebCore; + (void)initialize { JSC::initializeThreading(); + WTF::initializeMainThreadToProcessMainThread(); #ifndef BUILDING_ON_TIGER WebCoreObjCFinalizeOnMainThread(self); #endif @@ -208,6 +211,16 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl #endif } +- (void)_setDeferMainResourceDataLoad:(BOOL)flag +{ + DocumentLoader* loader = [self _documentLoader]; + + if (!loader) + return; + + loader->setDeferMainResourceDataLoad(flag); +} + @end @implementation WebDataSource (WebInternal) @@ -372,10 +385,11 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl _private->loader = loader.releaseRef(); LOG(Loading, "creating datasource for %@", static_cast<NSURL *>(_private->loader->request().url())); - - ++WebDataSourceCount; - - return self; + + if ((_private->includedInWebKitStatistics = [[self webFrame] _isIncludedInWebKitStatistics])) + ++WebDataSourceCount; + + return self; } @end @@ -389,16 +403,18 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl - (void)dealloc { - --WebDataSourceCount; - + if (_private && _private->includedInWebKitStatistics) + --WebDataSourceCount; + [_private release]; - + [super dealloc]; } - (void)finalize { - --WebDataSourceCount; + if (_private && _private->includedInWebKitStatistics) + --WebDataSourceCount; [super finalize]; } |
