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

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

Issue 12398007: Replaced deprecated v8 API calls by their non-deprecated counterparts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 months 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "webkit/glue/webkit_glue.h" 5 #include "webkit/glue/webkit_glue.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <mlang.h> 8 #include <mlang.h>
9 #include <objidl.h> 9 #include <objidl.h>
10 #elif defined(OS_POSIX) && !defined(OS_MACOSX) 10 #elif defined(OS_POSIX) && !defined(OS_MACOSX)
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 struct mallinfo minfo = mallinfo(); 344 struct mallinfo minfo = mallinfo();
345 uint64_t mem_usage = 345 uint64_t mem_usage =
346 #if defined(USE_TCMALLOC) 346 #if defined(USE_TCMALLOC)
347 minfo.uordblks 347 minfo.uordblks
348 #else 348 #else
349 (minfo.hblkhd + minfo.arena) 349 (minfo.hblkhd + minfo.arena)
350 #endif 350 #endif
351 >> 10; 351 >> 10;
352 352
353 v8::HeapStatistics stat; 353 v8::HeapStatistics stat;
354 v8::V8::GetHeapStatistics(&stat); 354 v8::Isolate::GetCurrent()->GetHeapStatistics(&stat);
355 return mem_usage + (static_cast<uint64_t>(stat.total_heap_size()) >> 10); 355 return mem_usage + (static_cast<uint64_t>(stat.total_heap_size()) >> 10);
356 } 356 }
357 #elif defined(OS_MACOSX) 357 #elif defined(OS_MACOSX)
358 size_t MemoryUsageKB() { 358 size_t MemoryUsageKB() {
359 scoped_ptr<base::ProcessMetrics> process_metrics( 359 scoped_ptr<base::ProcessMetrics> process_metrics(
360 // The default port provider is sufficient to get data for the current 360 // The default port provider is sufficient to get data for the current
361 // process. 361 // process.
362 base::ProcessMetrics::CreateProcessMetrics( 362 base::ProcessMetrics::CreateProcessMetrics(
363 base::GetCurrentProcessHandle(), NULL)); 363 base::GetCurrentProcessHandle(), NULL));
364 return process_metrics->GetWorkingSetSize() >> 10; 364 return process_metrics->GetWorkingSetSize() >> 10;
365 } 365 }
366 #else 366 #else
367 size_t MemoryUsageKB() { 367 size_t MemoryUsageKB() {
368 scoped_ptr<base::ProcessMetrics> process_metrics( 368 scoped_ptr<base::ProcessMetrics> process_metrics(
369 base::ProcessMetrics::CreateProcessMetrics( 369 base::ProcessMetrics::CreateProcessMetrics(
370 base::GetCurrentProcessHandle())); 370 base::GetCurrentProcessHandle()));
371 return process_metrics->GetPagefileUsage() >> 10; 371 return process_metrics->GetPagefileUsage() >> 10;
372 } 372 }
373 #endif 373 #endif
374 374
375 double ZoomFactorToZoomLevel(double factor) { 375 double ZoomFactorToZoomLevel(double factor) {
376 return WebView::zoomFactorToZoomLevel(factor); 376 return WebView::zoomFactorToZoomLevel(factor);
377 } 377 }
378 378
379 } // namespace webkit_glue 379 } // namespace webkit_glue
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698