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

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

Issue 2629593004: Disambiguate LifecycleObserver::contextDestroyed (Closed)
Patch Set: temp Created 3 years, 11 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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 return loader->timing().referenceMonotonicTime(); 99 return loader->timing().referenceMonotonicTime();
100 } 100 }
101 101
102 Performance::Performance(LocalFrame* frame) 102 Performance::Performance(LocalFrame* frame)
103 : PerformanceBase(toTimeOrigin(frame)), 103 : PerformanceBase(toTimeOrigin(frame)),
104 ContextLifecycleObserver(frame ? frame->document() : nullptr) {} 104 ContextLifecycleObserver(frame ? frame->document() : nullptr) {}
105 105
106 Performance::~Performance() { 106 Performance::~Performance() {
107 } 107 }
108 108
109 void Performance::contextDestroyed() { 109 void Performance::contextDestroyed(ExecutionContext* destroyedContext) {
110 frame()->performanceMonitor()->unsubscribeAll(this); 110 toDocument(destroyedContext)
111 ->frame()
112 ->performanceMonitor()
113 ->unsubscribeAll(this);
111 } 114 }
112 115
113 ExecutionContext* Performance::getExecutionContext() const { 116 ExecutionContext* Performance::getExecutionContext() const {
114 if (!frame()) 117 if (!frame())
115 return nullptr; 118 return nullptr;
116 return frame()->document(); 119 return frame()->document();
117 } 120 }
118 121
119 MemoryInfo* Performance::memory() { 122 MemoryInfo* Performance::memory() {
120 return MemoryInfo::create(); 123 return MemoryInfo::create();
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 HTMLFrameOwnerElement* frameOwner = 241 HTMLFrameOwnerElement* frameOwner =
239 culpritDomWindow->document()->localOwner(); 242 culpritDomWindow->document()->localOwner();
240 addLongTaskTiming(startTime, endTime, attribution.first, 243 addLongTaskTiming(startTime, endTime, attribution.first,
241 getFrameAttribute(frameOwner, HTMLNames::srcAttr, false), 244 getFrameAttribute(frameOwner, HTMLNames::srcAttr, false),
242 getFrameAttribute(frameOwner, HTMLNames::idAttr, false), 245 getFrameAttribute(frameOwner, HTMLNames::idAttr, false),
243 getFrameAttribute(frameOwner, HTMLNames::nameAttr, true)); 246 getFrameAttribute(frameOwner, HTMLNames::nameAttr, true));
244 } 247 }
245 } 248 }
246 249
247 } // namespace blink 250 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/timing/Performance.h ('k') | third_party/WebKit/Source/core/workers/DedicatedWorkerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698