blob: 28ddb7aa2e906bf067769eebbab143cff7f2c757 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
//
// BrowserStatisticsWindowController.m
// MiniBrowser
//
// Created by Sam Weinig on 4/21/10.
// Copyright 2010 Apple Inc. All rights reserved.
//
#import "BrowserStatisticsWindowController.h"
#import <WebKit2/WKContextPrivate.h>
@implementation BrowserStatisticsWindowController
- (id)initWithThreadedWKContextRef:(WKContextRef)threadContext processWKContextRef:(WKContextRef)processContext
{
if ((self = [super initWithWindowNibName:@"BrowserStatisticsWindow"])) {
_threadContext = WKRetain(threadContext);
_processContext = WKRetain(processContext);
}
return self;
}
- (void)dealloc
{
WKRelease(_threadContext);
_threadContext = 0;
WKRelease(_processContext);
_processContext = 0;
[super dealloc];
}
- (void)windowDidLoad
{
[super windowDidLoad];
[self refreshStatistics:nil];
}
- (IBAction)refreshStatistics:(id)sender
{
WKContextStatistics threadStats;
WKContextGetStatistics(_threadContext, &threadStats);
WKContextStatistics processStats;
WKContextGetStatistics(_processContext, &processStats);
[[_basicStatsMatrix cellWithTag:11] setIntValue:processStats.numberOfWKPages];
[[_basicStatsMatrix cellWithTag:12] setIntValue:processStats.numberOfWKFrames];
[[_basicStatsMatrix cellWithTag:21] setIntValue:threadStats.numberOfWKPages];
[[_basicStatsMatrix cellWithTag:22] setIntValue:threadStats.numberOfWKFrames];
}
@end
|