| 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 25 matching lines...) Expand all Loading... |
| 36 | 36 |
| 37 namespace blink { | 37 namespace blink { |
| 38 | 38 |
| 39 PerformanceNavigation::PerformanceNavigation(LocalFrame* frame) | 39 PerformanceNavigation::PerformanceNavigation(LocalFrame* frame) |
| 40 : DOMWindowProperty(frame) | 40 : DOMWindowProperty(frame) |
| 41 { | 41 { |
| 42 } | 42 } |
| 43 | 43 |
| 44 unsigned short PerformanceNavigation::type() const | 44 unsigned short PerformanceNavigation::type() const |
| 45 { | 45 { |
| 46 if (!m_frame) | 46 if (!frame()) |
| 47 return kTypeNavigate; | 47 return kTypeNavigate; |
| 48 | 48 |
| 49 DocumentLoader* documentLoader = m_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()) { |
| 54 case NavigationTypeReload: | 54 case NavigationTypeReload: |
| 55 return kTypeReload; | 55 return kTypeReload; |
| 56 case NavigationTypeBackForward: | 56 case NavigationTypeBackForward: |
| 57 return kTypeBackForward; | 57 return kTypeBackForward; |
| 58 default: | 58 default: |
| 59 return kTypeNavigate; | 59 return kTypeNavigate; |
| 60 } | 60 } |
| 61 } | 61 } |
| 62 | 62 |
| 63 unsigned short PerformanceNavigation::redirectCount() const | 63 unsigned short PerformanceNavigation::redirectCount() const |
| 64 { | 64 { |
| 65 if (!m_frame) | 65 if (!frame()) |
| 66 return 0; | 66 return 0; |
| 67 | 67 |
| 68 DocumentLoader* loader = m_frame->loader().documentLoader(); | 68 DocumentLoader* loader = frame()->loader().documentLoader(); |
| 69 if (!loader) | 69 if (!loader) |
| 70 return 0; | 70 return 0; |
| 71 | 71 |
| 72 const DocumentLoadTiming& timing = loader->timing(); | 72 const DocumentLoadTiming& timing = loader->timing(); |
| 73 if (timing.hasCrossOriginRedirect()) | 73 if (timing.hasCrossOriginRedirect()) |
| 74 return 0; | 74 return 0; |
| 75 | 75 |
| 76 return timing.redirectCount(); | 76 return timing.redirectCount(); |
| 77 } | 77 } |
| 78 | 78 |
| 79 DEFINE_TRACE(PerformanceNavigation) | 79 DEFINE_TRACE(PerformanceNavigation) |
| 80 { | 80 { |
| 81 DOMWindowProperty::trace(visitor); | 81 DOMWindowProperty::trace(visitor); |
| 82 } | 82 } |
| 83 | 83 |
| 84 } // namespace blink | 84 } // namespace blink |
| OLD | NEW |