Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Side by Side Diff: webkit/glue/webkitclient_impl.cc

Issue 332010: Expose a method to access amount of memory used by the current process. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « webkit/glue/webkitclient_impl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this
2 // source code is governed by a BSD-style license that can be found in the 2 // source code is governed by a BSD-style license that can be found in the
3 // LICENSE file. 3 // LICENSE file.
4 4
5 #include <math.h> 5 #include <math.h>
6 #include "config.h" 6 #include "config.h"
7 7
8 #include "FrameView.h" 8 #include "FrameView.h"
9 #include "ScrollView.h" 9 #include "ScrollView.h"
10 #include <wtf/Assertions.h> 10 #include <wtf/Assertions.h>
11 #undef LOG 11 #undef LOG
12 12
13 #include "webkit/glue/webkitclient_impl.h" 13 #include "webkit/glue/webkitclient_impl.h"
14 14
15 #include "base/file_path.h" 15 #include "base/file_path.h"
16 #include "base/file_util.h" 16 #include "base/file_util.h"
17 #include "base/message_loop.h" 17 #include "base/message_loop.h"
18 #include "base/process_util.h"
18 #include "base/platform_file.h" 19 #include "base/platform_file.h"
19 #include "base/stats_counters.h" 20 #include "base/stats_counters.h"
20 #include "base/string_util.h" 21 #include "base/string_util.h"
21 #include "base/trace_event.h" 22 #include "base/trace_event.h"
22 #include "grit/webkit_resources.h" 23 #include "grit/webkit_resources.h"
23 #include "grit/webkit_strings.h" 24 #include "grit/webkit_strings.h"
24 #include "net/base/net_util.h" 25 #include "net/base/net_util.h"
25 #include "webkit/api/public/WebCookie.h" 26 #include "webkit/api/public/WebCookie.h"
26 #include "webkit/api/public/WebCursorInfo.h" 27 #include "webkit/api/public/WebCursorInfo.h"
27 #include "webkit/api/public/WebData.h" 28 #include "webkit/api/public/WebData.h"
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 } 357 }
357 358
358 WebKit::WebString WebKitClientImpl::signedPublicKeyAndChallengeString( 359 WebKit::WebString WebKitClientImpl::signedPublicKeyAndChallengeString(
359 unsigned key_size_index, 360 unsigned key_size_index,
360 const WebKit::WebString& challenge, 361 const WebKit::WebString& challenge,
361 const WebKit::WebURL& url) { 362 const WebKit::WebURL& url) {
362 NOTREACHED(); 363 NOTREACHED();
363 return WebKit::WebString(); 364 return WebKit::WebString();
364 } 365 }
365 366
367 int WebKitClientImpl::memoryUsageMB() {
368 using base::ProcessMetrics;
369 static ProcessMetrics* process_metrics =
370 ProcessMetrics::CreateProcessMetrics(base::GetCurrentProcessHandle());
371 DCHECK(process_metrics);
372 return process_metrics->GetPagefileUsage() >> 20;
373 }
374
366 bool WebKitClientImpl::fileExists(const WebKit::WebString& path) { 375 bool WebKitClientImpl::fileExists(const WebKit::WebString& path) {
367 FilePath::StringType file_path = webkit_glue::WebStringToFilePathString(path); 376 FilePath::StringType file_path = webkit_glue::WebStringToFilePathString(path);
368 return file_util::PathExists(FilePath(file_path)); 377 return file_util::PathExists(FilePath(file_path));
369 } 378 }
370 379
371 bool WebKitClientImpl::deleteFile(const WebKit::WebString& path) { 380 bool WebKitClientImpl::deleteFile(const WebKit::WebString& path) {
372 NOTREACHED(); 381 NOTREACHED();
373 return false; 382 return false;
374 } 383 }
375 384
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
544 return file_util::DirectoryExists(file_path); 553 return file_util::DirectoryExists(file_path);
545 } 554 }
546 555
547 WebKit::WebURL WebKitClientImpl::filePathToURL(const WebKit::WebString& path) { 556 WebKit::WebURL WebKitClientImpl::filePathToURL(const WebKit::WebString& path) {
548 FilePath file_path(webkit_glue::WebStringToFilePathString(path)); 557 FilePath file_path(webkit_glue::WebStringToFilePathString(path));
549 GURL file_url = net::FilePathToFileURL(file_path); 558 GURL file_url = net::FilePathToFileURL(file_path);
550 return webkit_glue::KURLToWebURL(webkit_glue::GURLToKURL(file_url)); 559 return webkit_glue::KURLToWebURL(webkit_glue::GURLToKURL(file_url));
551 } 560 }
552 561
553 } // namespace webkit_glue 562 } // namespace webkit_glue
OLDNEW
« no previous file with comments | « webkit/glue/webkitclient_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698