OLD | NEW |
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 30 matching lines...) Expand all Loading... |
41 : DOMWindowProperty(frame) | 41 : DOMWindowProperty(frame) |
42 { | 42 { |
43 ScriptWrappable::init(this); | 43 ScriptWrappable::init(this); |
44 } | 44 } |
45 | 45 |
46 unsigned short PerformanceNavigation::type() const | 46 unsigned short PerformanceNavigation::type() const |
47 { | 47 { |
48 if (!m_frame) | 48 if (!m_frame) |
49 return TYPE_NAVIGATE; | 49 return TYPE_NAVIGATE; |
50 | 50 |
51 DocumentLoader* documentLoader = m_frame->loader()->documentLoader(); | 51 DocumentLoader* documentLoader = m_frame->loader().documentLoader(); |
52 if (!documentLoader) | 52 if (!documentLoader) |
53 return TYPE_NAVIGATE; | 53 return TYPE_NAVIGATE; |
54 | 54 |
55 WebCore::NavigationType navigationType = documentLoader->triggeringAction().
type(); | 55 WebCore::NavigationType navigationType = documentLoader->triggeringAction().
type(); |
56 switch (navigationType) { | 56 switch (navigationType) { |
57 case NavigationTypeReload: | 57 case NavigationTypeReload: |
58 return TYPE_RELOAD; | 58 return TYPE_RELOAD; |
59 case NavigationTypeBackForward: | 59 case NavigationTypeBackForward: |
60 return TYPE_BACK_FORWARD; | 60 return TYPE_BACK_FORWARD; |
61 default: | 61 default: |
62 return TYPE_NAVIGATE; | 62 return TYPE_NAVIGATE; |
63 } | 63 } |
64 } | 64 } |
65 | 65 |
66 unsigned short PerformanceNavigation::redirectCount() const | 66 unsigned short PerformanceNavigation::redirectCount() const |
67 { | 67 { |
68 if (!m_frame) | 68 if (!m_frame) |
69 return 0; | 69 return 0; |
70 | 70 |
71 DocumentLoader* loader = m_frame->loader()->documentLoader(); | 71 DocumentLoader* loader = m_frame->loader().documentLoader(); |
72 if (!loader) | 72 if (!loader) |
73 return 0; | 73 return 0; |
74 | 74 |
75 DocumentLoadTiming* timing = loader->timing(); | 75 DocumentLoadTiming* timing = loader->timing(); |
76 if (timing->hasCrossOriginRedirect()) | 76 if (timing->hasCrossOriginRedirect()) |
77 return 0; | 77 return 0; |
78 | 78 |
79 return timing->redirectCount(); | 79 return timing->redirectCount(); |
80 } | 80 } |
81 | 81 |
82 } // namespace WebCore | 82 } // namespace WebCore |
OLD | NEW |