| 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 DEFINE_WRAPPERTYPEINFO(); | 51 DEFINE_WRAPPERTYPEINFO(); |
| 52 public: | 52 public: |
| 53 static Location* create(Frame* frame) | 53 static Location* create(Frame* frame) |
| 54 { | 54 { |
| 55 return new Location(frame); | 55 return new Location(frame); |
| 56 } | 56 } |
| 57 | 57 |
| 58 Frame* frame() const { return m_frame.get(); } | 58 Frame* frame() const { return m_frame.get(); } |
| 59 void reset() { m_frame = nullptr; } | 59 void reset() { m_frame = nullptr; } |
| 60 | 60 |
| 61 void setHref(LocalDOMWindow* currentWindow, LocalDOMWindow* enteredWindow, c
onst String&); | 61 void setHref(LocalDOMWindow* currentWindow, LocalDOMWindow* enteredWindow, c
onst String&, ExceptionState&); |
| 62 String href() const; | 62 String href() const; |
| 63 | 63 |
| 64 void assign(LocalDOMWindow* currentWindow, LocalDOMWindow* enteredWindow, co
nst String&, ExceptionState&); | 64 void assign(LocalDOMWindow* currentWindow, LocalDOMWindow* enteredWindow, co
nst String&, ExceptionState&); |
| 65 void replace(LocalDOMWindow* currentWindow, LocalDOMWindow* enteredWindow, c
onst String&, ExceptionState&); | 65 void replace(LocalDOMWindow* currentWindow, LocalDOMWindow* enteredWindow, c
onst String&, ExceptionState&); |
| 66 void reload(LocalDOMWindow* currentWindow); | 66 void reload(LocalDOMWindow* currentWindow); |
| 67 | 67 |
| 68 void setProtocol(LocalDOMWindow* currentWindow, LocalDOMWindow* enteredWindo
w, const String&, ExceptionState&); | 68 void setProtocol(LocalDOMWindow* currentWindow, LocalDOMWindow* enteredWindo
w, const String&, ExceptionState&); |
| 69 String protocol() const; | 69 String protocol() const; |
| 70 void setHost(LocalDOMWindow* currentWindow, LocalDOMWindow* enteredWindow, c
onst String&); | 70 void setHost(LocalDOMWindow* currentWindow, LocalDOMWindow* enteredWindow, c
onst String&, ExceptionState&); |
| 71 String host() const; | 71 String host() const; |
| 72 void setHostname(LocalDOMWindow* currentWindow, LocalDOMWindow* enteredWindo
w, const String&); | 72 void setHostname(LocalDOMWindow* currentWindow, LocalDOMWindow* enteredWindo
w, const String&, ExceptionState&); |
| 73 String hostname() const; | 73 String hostname() const; |
| 74 void setPort(LocalDOMWindow* currentWindow, LocalDOMWindow* enteredWindow, c
onst String&); | 74 void setPort(LocalDOMWindow* currentWindow, LocalDOMWindow* enteredWindow, c
onst String&, ExceptionState&); |
| 75 String port() const; | 75 String port() const; |
| 76 void setPathname(LocalDOMWindow* currentWindow, LocalDOMWindow* enteredWindo
w, const String&); | 76 void setPathname(LocalDOMWindow* currentWindow, LocalDOMWindow* enteredWindo
w, const String&, ExceptionState&); |
| 77 String pathname() const; | 77 String pathname() const; |
| 78 void setSearch(LocalDOMWindow* currentWindow, LocalDOMWindow* enteredWindow,
const String&); | 78 void setSearch(LocalDOMWindow* currentWindow, LocalDOMWindow* enteredWindow,
const String&, ExceptionState&); |
| 79 String search() const; | 79 String search() const; |
| 80 void setHash(LocalDOMWindow* currentWindow, LocalDOMWindow* enteredWindow, c
onst String&); | 80 void setHash(LocalDOMWindow* currentWindow, LocalDOMWindow* enteredWindow, c
onst String&, ExceptionState&); |
| 81 String hash() const; | 81 String hash() const; |
| 82 String origin() const; | 82 String origin() const; |
| 83 | 83 |
| 84 DOMStringList* ancestorOrigins() const; | 84 DOMStringList* ancestorOrigins() const; |
| 85 | 85 |
| 86 // Just return the |this| object the way the normal valueOf function on the
Object prototype would. | 86 // Just return the |this| object the way the normal valueOf function on the
Object prototype would. |
| 87 // The valueOf function is only added to make sure that it cannot be overwri
tten on location | 87 // The valueOf function is only added to make sure that it cannot be overwri
tten on location |
| 88 // objects, since that would provide a hook to change the string conversion
behavior of location objects. | 88 // objects, since that would provide a hook to change the string conversion
behavior of location objects. |
| 89 ScriptValue valueOf(const ScriptValue& thisObject) { return thisObject; } | 89 ScriptValue valueOf(const ScriptValue& thisObject) { return thisObject; } |
| 90 | 90 |
| 91 DECLARE_VIRTUAL_TRACE(); | 91 DECLARE_VIRTUAL_TRACE(); |
| 92 | 92 |
| 93 private: | 93 private: |
| 94 explicit Location(Frame*); | 94 explicit Location(Frame*); |
| 95 | 95 |
| 96 enum class SetLocation { Normal, ReplaceThisFrame }; | 96 enum class SetLocation { Normal, ReplaceThisFrame }; |
| 97 void setLocation(const String&, LocalDOMWindow* currentWindow, LocalDOMWindo
w* enteredWindow, ExceptionState* = nullptr, SetLocation = SetLocation::Normal); | 97 void setLocation(const String&, LocalDOMWindow* currentWindow, LocalDOMWindo
w* enteredWindow, ExceptionState* = nullptr, SetLocation = SetLocation::Normal); |
| 98 | 98 |
| 99 const KURL& url() const; | 99 const KURL& url() const; |
| 100 | 100 |
| 101 Member<Frame> m_frame; | 101 Member<Frame> m_frame; |
| 102 }; | 102 }; |
| 103 | 103 |
| 104 } // namespace blink | 104 } // namespace blink |
| 105 | 105 |
| 106 #endif // Location_h | 106 #endif // Location_h |
| OLD | NEW |