| OLD | NEW |
| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 #include "platform/weborigin/SecurityOrigin.h" | 42 #include "platform/weborigin/SecurityOrigin.h" |
| 43 #include "wtf/CurrentTime.h" | 43 #include "wtf/CurrentTime.h" |
| 44 | 44 |
| 45 namespace blink { | 45 namespace blink { |
| 46 | 46 |
| 47 static const size_t defaultResourceTimingBufferSize = 150; | 47 static const size_t defaultResourceTimingBufferSize = 150; |
| 48 | 48 |
| 49 Performance::Performance(LocalFrame* frame) | 49 Performance::Performance(LocalFrame* frame) |
| 50 : DOMWindowProperty(frame) | 50 : DOMWindowProperty(frame) |
| 51 , m_resourceTimingBufferSize(defaultResourceTimingBufferSize) | 51 , m_resourceTimingBufferSize(defaultResourceTimingBufferSize) |
| 52 , m_referenceTime(frame && frame->host() ? frame->document()->loader()->timi
ng()->referenceMonotonicTime() : 0.0) | 52 , m_referenceTime(localFrame() && localFrame()->host() ? localFrame()->docum
ent()->loader()->timing()->referenceMonotonicTime() : 0.0) |
| 53 , m_userTiming(nullptr) | 53 , m_userTiming(nullptr) |
| 54 { | 54 { |
| 55 } | 55 } |
| 56 | 56 |
| 57 Performance::~Performance() | 57 Performance::~Performance() |
| 58 { | 58 { |
| 59 } | 59 } |
| 60 | 60 |
| 61 const AtomicString& Performance::interfaceName() const | 61 const AtomicString& Performance::interfaceName() const |
| 62 { | 62 { |
| 63 return EventTargetNames::Performance; | 63 return EventTargetNames::Performance; |
| 64 } | 64 } |
| 65 | 65 |
| 66 ExecutionContext* Performance::executionContext() const | 66 ExecutionContext* Performance::executionContext() const |
| 67 { | 67 { |
| 68 if (!frame()) | 68 if (!localFrame()) |
| 69 return nullptr; | 69 return nullptr; |
| 70 return frame()->document(); | 70 return localFrame()->document(); |
| 71 } | 71 } |
| 72 | 72 |
| 73 PassRefPtrWillBeRawPtr<MemoryInfo> Performance::memory() const | 73 PassRefPtrWillBeRawPtr<MemoryInfo> Performance::memory() const |
| 74 { | 74 { |
| 75 return MemoryInfo::create(); | 75 return MemoryInfo::create(); |
| 76 } | 76 } |
| 77 | 77 |
| 78 PerformanceNavigation* Performance::navigation() const | 78 PerformanceNavigation* Performance::navigation() const |
| 79 { | 79 { |
| 80 if (!m_navigation) | 80 if (!m_navigation) |
| 81 m_navigation = PerformanceNavigation::create(m_frame); | 81 m_navigation = PerformanceNavigation::create(localFrame()); |
| 82 | 82 |
| 83 return m_navigation.get(); | 83 return m_navigation.get(); |
| 84 } | 84 } |
| 85 | 85 |
| 86 PerformanceTiming* Performance::timing() const | 86 PerformanceTiming* Performance::timing() const |
| 87 { | 87 { |
| 88 if (!m_timing) | 88 if (!m_timing) |
| 89 m_timing = PerformanceTiming::create(m_frame); | 89 m_timing = PerformanceTiming::create(localFrame()); |
| 90 | 90 |
| 91 return m_timing.get(); | 91 return m_timing.get(); |
| 92 } | 92 } |
| 93 | 93 |
| 94 PerformanceEntryVector Performance::getEntries() const | 94 PerformanceEntryVector Performance::getEntries() const |
| 95 { | 95 { |
| 96 PerformanceEntryVector entries; | 96 PerformanceEntryVector entries; |
| 97 | 97 |
| 98 entries.appendVector(m_resourceTimingBuffer); | 98 entries.appendVector(m_resourceTimingBuffer); |
| 99 | 99 |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 { | 282 { |
| 283 visitor->trace(m_navigation); | 283 visitor->trace(m_navigation); |
| 284 visitor->trace(m_timing); | 284 visitor->trace(m_timing); |
| 285 visitor->trace(m_resourceTimingBuffer); | 285 visitor->trace(m_resourceTimingBuffer); |
| 286 visitor->trace(m_userTiming); | 286 visitor->trace(m_userTiming); |
| 287 EventTargetWithInlineData::trace(visitor); | 287 EventTargetWithInlineData::trace(visitor); |
| 288 DOMWindowProperty::trace(visitor); | 288 DOMWindowProperty::trace(visitor); |
| 289 } | 289 } |
| 290 | 290 |
| 291 } // namespace blink | 291 } // namespace blink |
| OLD | NEW |