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

Side by Side Diff: Source/core/timing/Performance.cpp

Issue 106353005: Expose performance.memory in workers (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@Perf-Memory-SharedWorker
Patch Set: Created 6 years, 12 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * Copyright (C) 2012 Intel Inc. All rights reserved. 3 * Copyright (C) 2012 Intel Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 67
68 ExecutionContext* Performance::executionContext() const 68 ExecutionContext* Performance::executionContext() const
69 { 69 {
70 if (!frame()) 70 if (!frame())
71 return 0; 71 return 0;
72 return frame()->document(); 72 return frame()->document();
73 } 73 }
74 74
75 PassRefPtr<MemoryInfo> Performance::memory() const 75 PassRefPtr<MemoryInfo> Performance::memory() const
76 { 76 {
77 return MemoryInfo::create(m_frame); 77 return MemoryInfo::create(executionContext());
78 } 78 }
79 79
80 PerformanceNavigation* Performance::navigation() const 80 PerformanceNavigation* Performance::navigation() const
81 { 81 {
82 if (!m_navigation) 82 if (!m_navigation)
83 m_navigation = PerformanceNavigation::create(m_frame); 83 m_navigation = PerformanceNavigation::create(m_frame);
84 84
85 return m_navigation.get(); 85 return m_navigation.get();
86 } 86 }
87 87
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 m_userTiming = UserTiming::create(this); 271 m_userTiming = UserTiming::create(this);
272 m_userTiming->clearMeasures(measureName); 272 m_userTiming->clearMeasures(measureName);
273 } 273 }
274 274
275 double Performance::now() const 275 double Performance::now() const
276 { 276 {
277 return 1000.0 * (monotonicallyIncreasingTime() - m_referenceTime); 277 return 1000.0 * (monotonicallyIncreasingTime() - m_referenceTime);
278 } 278 }
279 279
280 } // namespace WebCore 280 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698