summaryrefslogtreecommitdiffstats
path: root/WebKitTools/MiniBrowser/mac/BrowserStatisticsWindowController.m
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2010-05-11 18:35:50 +0100
committerBen Murdoch <benm@google.com>2010-05-14 10:23:05 +0100
commit21939df44de1705786c545cd1bf519d47250322d (patch)
treeef56c310f5c0cdc379c2abb2e212308a3281ce20 /WebKitTools/MiniBrowser/mac/BrowserStatisticsWindowController.m
parent4ff1d8891d520763f17675827154340c7c740f90 (diff)
downloadexternal_webkit-21939df44de1705786c545cd1bf519d47250322d.zip
external_webkit-21939df44de1705786c545cd1bf519d47250322d.tar.gz
external_webkit-21939df44de1705786c545cd1bf519d47250322d.tar.bz2
Merge Webkit at r58956: Initial merge by Git.
Change-Id: I1d9fb60ea2c3f2ddc04c17a871acdb39353be228
Diffstat (limited to 'WebKitTools/MiniBrowser/mac/BrowserStatisticsWindowController.m')
-rw-r--r--WebKitTools/MiniBrowser/mac/BrowserStatisticsWindowController.m58
1 files changed, 58 insertions, 0 deletions
diff --git a/WebKitTools/MiniBrowser/mac/BrowserStatisticsWindowController.m b/WebKitTools/MiniBrowser/mac/BrowserStatisticsWindowController.m
new file mode 100644
index 0000000..bb5fc7d
--- /dev/null
+++ b/WebKitTools/MiniBrowser/mac/BrowserStatisticsWindowController.m
@@ -0,0 +1,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 = WKContextRetain(threadContext);
+ _processContext = WKContextRetain(processContext);
+ }
+
+ return self;
+}
+
+- (void)dealloc
+{
+ WKContextRelease(_threadContext);
+ _threadContext = 0;
+
+ WKContextRelease(_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