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

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

Issue 504068: Revert 34994, maybe it regressed startup perf - Fix cpu/memory measurements o... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years 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 | « chrome/test/chrome_process_util.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 "webkit/glue/webkitclient_impl.h" 5 #include "webkit/glue/webkitclient_impl.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 unsigned key_size_index, 311 unsigned key_size_index,
312 const WebKit::WebString& challenge, 312 const WebKit::WebString& challenge,
313 const WebKit::WebURL& url) { 313 const WebKit::WebURL& url) {
314 NOTREACHED(); 314 NOTREACHED();
315 return WebKit::WebString(); 315 return WebKit::WebString();
316 } 316 }
317 317
318 size_t WebKitClientImpl::memoryUsageMB() { 318 size_t WebKitClientImpl::memoryUsageMB() {
319 using base::ProcessMetrics; 319 using base::ProcessMetrics;
320 static ProcessMetrics* process_metrics = 320 static ProcessMetrics* process_metrics =
321 #if !defined(OS_MACOSX)
322 ProcessMetrics::CreateProcessMetrics(base::GetCurrentProcessHandle()); 321 ProcessMetrics::CreateProcessMetrics(base::GetCurrentProcessHandle());
323 #else
324 // The default port provider is sufficient to get data for the current
325 // process.
326 ProcessMetrics::CreateProcessMetrics(base::GetCurrentProcessHandle(),
327 NULL);
328 #endif
329 DCHECK(process_metrics); 322 DCHECK(process_metrics);
330 return process_metrics->GetPagefileUsage() >> 20; 323 return process_metrics->GetPagefileUsage() >> 20;
331 } 324 }
332 325
333 bool WebKitClientImpl::fileExists(const WebKit::WebString& path) { 326 bool WebKitClientImpl::fileExists(const WebKit::WebString& path) {
334 FilePath::StringType file_path = webkit_glue::WebStringToFilePathString(path); 327 FilePath::StringType file_path = webkit_glue::WebStringToFilePathString(path);
335 return file_util::PathExists(FilePath(file_path)); 328 return file_util::PathExists(FilePath(file_path));
336 } 329 }
337 330
338 bool WebKitClientImpl::deleteFile(const WebKit::WebString& path) { 331 bool WebKitClientImpl::deleteFile(const WebKit::WebString& path) {
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 bool WebKitClientImpl::isDirectory(const WebKit::WebString& path) { 381 bool WebKitClientImpl::isDirectory(const WebKit::WebString& path) {
389 FilePath file_path(webkit_glue::WebStringToFilePathString(path)); 382 FilePath file_path(webkit_glue::WebStringToFilePathString(path));
390 return file_util::DirectoryExists(file_path); 383 return file_util::DirectoryExists(file_path);
391 } 384 }
392 385
393 WebKit::WebURL WebKitClientImpl::filePathToURL(const WebKit::WebString& path) { 386 WebKit::WebURL WebKitClientImpl::filePathToURL(const WebKit::WebString& path) {
394 return net::FilePathToFileURL(webkit_glue::WebStringToFilePath(path)); 387 return net::FilePathToFileURL(webkit_glue::WebStringToFilePath(path));
395 } 388 }
396 389
397 } // namespace webkit_glue 390 } // namespace webkit_glue
OLDNEW
« no previous file with comments | « chrome/test/chrome_process_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698