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

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

Issue 540283003: bindings: Retires ScriptWrappable::init, etc. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Addressed a review comment. 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/frame/Console.cpp ('k') | Source/core/frame/ImageBitmap.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 28 matching lines...) Expand all
39 #include "platform/weborigin/KURL.h" 39 #include "platform/weborigin/KURL.h"
40 #include "platform/weborigin/SecurityOrigin.h" 40 #include "platform/weborigin/SecurityOrigin.h"
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 ScriptWrappable::init(this);
50 } 49 }
51 50
52 unsigned History::length() const 51 unsigned History::length() const
53 { 52 {
54 if (!m_frame) 53 if (!m_frame)
55 return 0; 54 return 0;
56 if (!m_frame->page()) 55 if (!m_frame->page())
57 return 0; 56 return 0;
58 return m_frame->page()->backForward().backForwardListCount(); 57 return m_frame->page()->backForward().backForwardListCount();
59 } 58 }
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 KURL fullURL = urlForState(urlString); 130 KURL fullURL = urlForState(urlString);
132 if (!fullURL.isValid() || !m_frame->document()->securityOrigin()->canRequest (fullURL)) { 131 if (!fullURL.isValid() || !m_frame->document()->securityOrigin()->canRequest (fullURL)) {
133 // 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. 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.
134 exceptionState.throwSecurityError("A history state object with URL '" + fullURL.elidedString() + "' cannot be created in a document with origin '" + m_f rame->document()->securityOrigin()->toString() + "'."); 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() + "'.");
135 return; 134 return;
136 } 135 }
137 m_frame->loader().updateForSameDocumentNavigation(fullURL, SameDocumentNavig ationHistoryApi, data, type); 136 m_frame->loader().updateForSameDocumentNavigation(fullURL, SameDocumentNavig ationHistoryApi, data, type);
138 } 137 }
139 138
140 } // namespace blink 139 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/frame/Console.cpp ('k') | Source/core/frame/ImageBitmap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698