Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(136)

Side by Side Diff: Source/core/frame/History.cpp

Issue 552733003: Oilpan: make DOMWindowProperty a GC mixin. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Pacify GC plugin wrt LocalDOMWindow::trace() Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2007 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 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 30 matching lines...) Expand all
41 #include "wtf/MainThread.h" 41 #include "wtf/MainThread.h"
42 42
43 namespace blink { 43 namespace blink {
44 44
45 History::History(LocalFrame* frame) 45 History::History(LocalFrame* frame)
46 : DOMWindowProperty(frame) 46 : DOMWindowProperty(frame)
47 , m_lastStateObjectRequested(nullptr) 47 , m_lastStateObjectRequested(nullptr)
48 { 48 {
49 } 49 }
50 50
51 void History::trace(Visitor* visitor)
52 {
53 DOMWindowProperty::trace(visitor);
54 }
55
51 unsigned History::length() const 56 unsigned History::length() const
52 { 57 {
53 if (!m_frame) 58 if (!m_frame)
54 return 0; 59 return 0;
55 if (!m_frame->page()) 60 if (!m_frame->page())
56 return 0; 61 return 0;
57 return m_frame->page()->backForward().backForwardListCount(); 62 return m_frame->page()->backForward().backForwardListCount();
58 } 63 }
59 64
60 SerializedScriptValue* History::state() 65 SerializedScriptValue* History::state()
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 KURL fullURL = urlForState(urlString); 135 KURL fullURL = urlForState(urlString);
131 if (!fullURL.isValid() || !m_frame->document()->securityOrigin()->canRequest (fullURL)) { 136 if (!fullURL.isValid() || !m_frame->document()->securityOrigin()->canRequest (fullURL)) {
132 // We can safely expose the URL to JavaScript, as a) no redirection take s place: JavaScript already had this URL, b) JavaScript can only access a same-o rigin History object. 137 // We can safely expose the URL to JavaScript, as a) no redirection take s place: JavaScript already had this URL, b) JavaScript can only access a same-o rigin History object.
133 exceptionState.throwSecurityError("A history state object with URL '" + fullURL.elidedString() + "' cannot be created in a document with origin '" + m_f rame->document()->securityOrigin()->toString() + "'."); 138 exceptionState.throwSecurityError("A history state object with URL '" + fullURL.elidedString() + "' cannot be created in a document with origin '" + m_f rame->document()->securityOrigin()->toString() + "'.");
134 return; 139 return;
135 } 140 }
136 m_frame->loader().updateForSameDocumentNavigation(fullURL, SameDocumentNavig ationHistoryApi, data, type); 141 m_frame->loader().updateForSameDocumentNavigation(fullURL, SameDocumentNavig ationHistoryApi, data, type);
137 } 142 }
138 143
139 } // namespace blink 144 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698