| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008, 2010 Apple 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 #include "bindings/core/v8/BindingSecurity.h" | 31 #include "bindings/core/v8/BindingSecurity.h" |
| 32 #include "bindings/core/v8/ExceptionState.h" | 32 #include "bindings/core/v8/ExceptionState.h" |
| 33 #include "bindings/core/v8/V8DOMActivityLogger.h" | 33 #include "bindings/core/v8/V8DOMActivityLogger.h" |
| 34 #include "core/dom/DOMURLUtilsReadOnly.h" | 34 #include "core/dom/DOMURLUtilsReadOnly.h" |
| 35 #include "core/dom/Document.h" | 35 #include "core/dom/Document.h" |
| 36 #include "core/dom/ExceptionCode.h" | 36 #include "core/dom/ExceptionCode.h" |
| 37 #include "core/frame/DOMWindow.h" | 37 #include "core/frame/DOMWindow.h" |
| 38 #include "core/frame/LocalDOMWindow.h" | 38 #include "core/frame/LocalDOMWindow.h" |
| 39 #include "core/frame/LocalFrame.h" | 39 #include "core/frame/LocalFrame.h" |
| 40 #include "core/loader/FrameLoader.h" | 40 #include "core/loader/FrameLoader.h" |
| 41 #include "platform/instrumentation/tracing/TraceEvent.h" | |
| 42 #include "platform/weborigin/KURL.h" | 41 #include "platform/weborigin/KURL.h" |
| 43 #include "platform/weborigin/SecurityOrigin.h" | 42 #include "platform/weborigin/SecurityOrigin.h" |
| 44 | 43 |
| 45 namespace blink { | 44 namespace blink { |
| 46 | 45 |
| 47 Location::Location(DOMWindow* domWindow) : m_domWindow(domWindow) {} | 46 Location::Location(DOMWindow* domWindow) : m_domWindow(domWindow) {} |
| 48 | 47 |
| 49 DEFINE_TRACE(Location) { | 48 DEFINE_TRACE(Location) { |
| 50 visitor->trace(m_domWindow); | 49 visitor->trace(m_domWindow); |
| 51 } | 50 } |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 ExceptionState& exceptionState) { | 169 ExceptionState& exceptionState) { |
| 171 KURL url = document()->url(); | 170 KURL url = document()->url(); |
| 172 url.setQuery(search); | 171 url.setQuery(search); |
| 173 setLocation(url.getString(), currentWindow, enteredWindow, &exceptionState); | 172 setLocation(url.getString(), currentWindow, enteredWindow, &exceptionState); |
| 174 } | 173 } |
| 175 | 174 |
| 176 void Location::setHash(LocalDOMWindow* currentWindow, | 175 void Location::setHash(LocalDOMWindow* currentWindow, |
| 177 LocalDOMWindow* enteredWindow, | 176 LocalDOMWindow* enteredWindow, |
| 178 const String& hash, | 177 const String& hash, |
| 179 ExceptionState& exceptionState) { | 178 ExceptionState& exceptionState) { |
| 180 TRACE_EVENT0("blink", "Location::setHash"); | |
| 181 KURL url = document()->url(); | 179 KURL url = document()->url(); |
| 182 String oldFragmentIdentifier = url.fragmentIdentifier(); | 180 String oldFragmentIdentifier = url.fragmentIdentifier(); |
| 183 String newFragmentIdentifier = hash; | 181 String newFragmentIdentifier = hash; |
| 184 if (hash[0] == '#') | 182 if (hash[0] == '#') |
| 185 newFragmentIdentifier = hash.substring(1); | 183 newFragmentIdentifier = hash.substring(1); |
| 186 url.setFragmentIdentifier(newFragmentIdentifier); | 184 url.setFragmentIdentifier(newFragmentIdentifier); |
| 187 // Note that by parsing the URL and *then* comparing fragments, we are | 185 // Note that by parsing the URL and *then* comparing fragments, we are |
| 188 // comparing fragments post-canonicalization, and so this handles the | 186 // comparing fragments post-canonicalization, and so this handles the |
| 189 // cases where fragment identifiers are ignored or invalid. | 187 // cases where fragment identifiers are ignored or invalid. |
| 190 if (equalIgnoringNullity(oldFragmentIdentifier, url.fragmentIdentifier())) | 188 if (equalIgnoringNullity(oldFragmentIdentifier, url.fragmentIdentifier())) |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 | 281 |
| 284 Document* Location::document() const { | 282 Document* Location::document() const { |
| 285 return toLocalDOMWindow(m_domWindow)->document(); | 283 return toLocalDOMWindow(m_domWindow)->document(); |
| 286 } | 284 } |
| 287 | 285 |
| 288 bool Location::isAttached() const { | 286 bool Location::isAttached() const { |
| 289 return m_domWindow->frame(); | 287 return m_domWindow->frame(); |
| 290 } | 288 } |
| 291 | 289 |
| 292 } // namespace blink | 290 } // namespace blink |
| OLD | NEW |