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

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

Issue 2388693002: Make DOMWindowProperty a thin wrapper of ContextLifecycleObserver
Patch Set: temp Created 4 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
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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 } 100 }
101 101
102 Performance::Performance(LocalFrame* frame) 102 Performance::Performance(LocalFrame* frame)
103 : PerformanceBase(toTimeOrigin(frame)), DOMWindowProperty(frame) {} 103 : PerformanceBase(toTimeOrigin(frame)), DOMWindowProperty(frame) {}
104 104
105 Performance::~Performance() { 105 Performance::~Performance() {
106 if (frame()) 106 if (frame())
107 frame()->performanceMonitor()->unsubscribeAll(this); 107 frame()->performanceMonitor()->unsubscribeAll(this);
108 } 108 }
109 109
110 void Performance::frameDestroyed() { 110 void Performance::contextDestroyed() {
111 frame()->performanceMonitor()->unsubscribeAll(this); 111 frame()->performanceMonitor()->unsubscribeAll(this);
112 DOMWindowProperty::frameDestroyed(); 112 DOMWindowProperty::contextDestroyed();
113 } 113 }
114 114
115 ExecutionContext* Performance::getExecutionContext() const { 115 ExecutionContext* Performance::getExecutionContext() const {
116 if (!frame()) 116 if (!frame())
117 return nullptr; 117 return nullptr;
118 return frame()->document(); 118 return frame()->document();
119 } 119 }
120 120
121 MemoryInfo* Performance::memory() { 121 MemoryInfo* Performance::memory() {
122 return MemoryInfo::create(); 122 return MemoryInfo::create();
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 HTMLFrameOwnerElement* frameOwner = 240 HTMLFrameOwnerElement* frameOwner =
241 culpritDomWindow->document()->localOwner(); 241 culpritDomWindow->document()->localOwner();
242 addLongTaskTiming(startTime, endTime, attribution.first, 242 addLongTaskTiming(startTime, endTime, attribution.first,
243 getFrameAttribute(frameOwner, HTMLNames::srcAttr, false), 243 getFrameAttribute(frameOwner, HTMLNames::srcAttr, false),
244 getFrameAttribute(frameOwner, HTMLNames::idAttr, false), 244 getFrameAttribute(frameOwner, HTMLNames::idAttr, false),
245 getFrameAttribute(frameOwner, HTMLNames::nameAttr, true)); 245 getFrameAttribute(frameOwner, HTMLNames::nameAttr, true));
246 } 246 }
247 } 247 }
248 248
249 } // namespace blink 249 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698