OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "config.h" | 5 #include "config.h" |
6 #include "core/frame/DOMWindow.h" | 6 #include "core/frame/DOMWindow.h" |
7 | 7 |
8 #include "core/dom/SecurityContext.h" | 8 #include "core/dom/SecurityContext.h" |
9 #include "core/frame/Frame.h" | 9 #include "core/frame/Frame.h" |
10 #include "core/frame/FrameClient.h" | 10 #include "core/frame/FrameClient.h" |
11 #include "core/frame/Location.h" | |
11 #include "platform/weborigin/KURL.h" | 12 #include "platform/weborigin/KURL.h" |
12 #include "platform/weborigin/SecurityOrigin.h" | 13 #include "platform/weborigin/SecurityOrigin.h" |
13 | 14 |
14 namespace blink { | 15 namespace blink { |
15 | 16 |
17 DOMWindow::~DOMWindow() | |
18 { | |
19 reset(); | |
sof
2015/02/03 21:25:10
This is problematic in an Oilpan setting, as destr
sof
2015/02/03 21:28:06
s/rest/reset/g
Nate Chapin
2015/02/06 19:39:58
Resetting the location in willDetachFrameHost() ha
sof
2015/02/07 17:09:32
I see, somewhat similar to changes seen for https:
Nate Chapin
2015/02/09 19:05:57
There was a single layout test that had output cha
| |
20 } | |
21 | |
22 Location* DOMWindow::location() const | |
23 { | |
24 if (!m_location) | |
25 m_location = Location::create(frame()); | |
26 return m_location.get(); | |
27 } | |
28 | |
16 bool DOMWindow::closed() const | 29 bool DOMWindow::closed() const |
17 { | 30 { |
18 return !frame() || !frame()->host(); | 31 return !frame() || !frame()->host(); |
19 } | 32 } |
20 | 33 |
21 unsigned DOMWindow::length() const | 34 unsigned DOMWindow::length() const |
22 { | 35 { |
23 return frame() ? frame()->tree().scopedChildCount() : 0; | 36 return frame() ? frame()->tree().scopedChildCount() : 0; |
24 } | 37 } |
25 | 38 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
85 return false; | 98 return false; |
86 | 99 |
87 // FIXME: The name canAccess seems to be a roundabout way to ask "can ex ecute script". | 100 // FIXME: The name canAccess seems to be a roundabout way to ask "can ex ecute script". |
88 // Can we name the SecurityOrigin function better to make this more clea r? | 101 // Can we name the SecurityOrigin function better to make this more clea r? |
89 if (callingWindow.frame()->securityContext()->securityOrigin()->canAcces s(frame()->securityContext()->securityOrigin())) | 102 if (callingWindow.frame()->securityContext()->securityOrigin()->canAcces s(frame()->securityContext()->securityOrigin())) |
90 return false; | 103 return false; |
91 } | 104 } |
92 return true; | 105 return true; |
93 } | 106 } |
94 | 107 |
108 void DOMWindow::reset() | |
109 { | |
110 // Location needs to be reset manually because it doesn't inherit from DOMWi ndowProperty. | |
111 if (m_location) { | |
112 m_location->reset(); | |
113 m_location = nullptr; | |
114 } | |
115 } | |
116 | |
95 } // namespace blink | 117 } // namespace blink |
OLD | NEW |