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

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

Issue 2592953004: Replace DOMWindowProperty in core/timing/ with ContextClient (Closed)
Patch Set: 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 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 22 matching lines...) Expand all
33 #include "bindings/core/v8/ScriptValue.h" 33 #include "bindings/core/v8/ScriptValue.h"
34 #include "bindings/core/v8/V8ObjectBuilder.h" 34 #include "bindings/core/v8/V8ObjectBuilder.h"
35 #include "core/frame/LocalFrame.h" 35 #include "core/frame/LocalFrame.h"
36 #include "core/loader/DocumentLoader.h" 36 #include "core/loader/DocumentLoader.h"
37 #include "core/loader/FrameLoaderTypes.h" 37 #include "core/loader/FrameLoaderTypes.h"
38 38
39 // Legacy support for NT1(https://www.w3.org/TR/navigation-timing/). 39 // Legacy support for NT1(https://www.w3.org/TR/navigation-timing/).
40 namespace blink { 40 namespace blink {
41 41
42 PerformanceNavigation::PerformanceNavigation(LocalFrame* frame) 42 PerformanceNavigation::PerformanceNavigation(LocalFrame* frame)
43 : DOMWindowProperty(frame) {} 43 : ContextClient(frame) {}
44 44
45 unsigned short PerformanceNavigation::type() const { 45 unsigned short PerformanceNavigation::type() const {
46 if (!frame()) 46 if (!frame())
47 return kTypeNavigate; 47 return kTypeNavigate;
48 48
49 DocumentLoader* documentLoader = frame()->loader().documentLoader(); 49 DocumentLoader* documentLoader = frame()->loader().documentLoader();
50 if (!documentLoader) 50 if (!documentLoader)
51 return kTypeNavigate; 51 return kTypeNavigate;
52 52
53 switch (documentLoader->getNavigationType()) { 53 switch (documentLoader->getNavigationType()) {
(...skipping 23 matching lines...) Expand all
77 77
78 ScriptValue PerformanceNavigation::toJSONForBinding( 78 ScriptValue PerformanceNavigation::toJSONForBinding(
79 ScriptState* scriptState) const { 79 ScriptState* scriptState) const {
80 V8ObjectBuilder result(scriptState); 80 V8ObjectBuilder result(scriptState);
81 result.addNumber("type", type()); 81 result.addNumber("type", type());
82 result.addNumber("redirectCount", redirectCount()); 82 result.addNumber("redirectCount", redirectCount());
83 return result.scriptValue(); 83 return result.scriptValue();
84 } 84 }
85 85
86 DEFINE_TRACE(PerformanceNavigation) { 86 DEFINE_TRACE(PerformanceNavigation) {
87 DOMWindowProperty::trace(visitor); 87 ContextClient::trace(visitor);
88 } 88 }
89 89
90 } // namespace blink 90 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698