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

Side by Side Diff: Source/core/testing/Internals.cpp

Issue 239993011: Lazily generate HistoryItem's serialized form state (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Merged to trunk Created 6 years, 8 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/loader/HistoryItem.cpp ('k') | Source/web/WebHistoryItem.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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2013 Apple Inc. All rights reserved. 3 * Copyright (C) 2013 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after
714 return mainItem->documentState(); 714 return mainItem->documentState();
715 } 715 }
716 716
717 void Internals::setFormControlStateOfHistoryItem(const Vector<String>& state, Ex ceptionState& exceptionState) 717 void Internals::setFormControlStateOfHistoryItem(const Vector<String>& state, Ex ceptionState& exceptionState)
718 { 718 {
719 HistoryItem* mainItem = frame()->loader().currentItem(); 719 HistoryItem* mainItem = frame()->loader().currentItem();
720 if (!mainItem) { 720 if (!mainItem) {
721 exceptionState.throwDOMException(InvalidAccessError, "No history item is available."); 721 exceptionState.throwDOMException(InvalidAccessError, "No history item is available.");
722 return; 722 return;
723 } 723 }
724 mainItem->clearDocumentState();
724 mainItem->setDocumentState(state); 725 mainItem->setDocumentState(state);
725 } 726 }
726 727
727 void Internals::setEnableMockPagePopup(bool enabled, ExceptionState& exceptionSt ate) 728 void Internals::setEnableMockPagePopup(bool enabled, ExceptionState& exceptionSt ate)
728 { 729 {
729 Document* document = contextDocument(); 730 Document* document = contextDocument();
730 if (!document || !document->page()) 731 if (!document || !document->page())
731 return; 732 return;
732 Page* page = document->page(); 733 Page* page = document->page();
733 if (!enabled) { 734 if (!enabled) {
(...skipping 1320 matching lines...) Expand 10 before | Expand all | Expand 10 after
2054 return MallocStatistics::create(); 2055 return MallocStatistics::create();
2055 } 2056 }
2056 2057
2057 PassRefPtrWillBeRawPtr<TypeConversions> Internals::typeConversions() const 2058 PassRefPtrWillBeRawPtr<TypeConversions> Internals::typeConversions() const
2058 { 2059 {
2059 return TypeConversions::create(); 2060 return TypeConversions::create();
2060 } 2061 }
2061 2062
2062 Vector<String> Internals::getReferencedFilePaths() const 2063 Vector<String> Internals::getReferencedFilePaths() const
2063 { 2064 {
2064 frame()->loader().saveDocumentState(); 2065 return frame()->loader().currentItem()->getReferencedFilePaths();
2065 return FormController::getReferencedFilePaths(frame()->loader().currentItem( )->documentState());
2066 } 2066 }
2067 2067
2068 void Internals::startTrackingRepaints(Document* document, ExceptionState& except ionState) 2068 void Internals::startTrackingRepaints(Document* document, ExceptionState& except ionState)
2069 { 2069 {
2070 if (!document || !document->view()) { 2070 if (!document || !document->view()) {
2071 exceptionState.throwDOMException(InvalidAccessError, document ? "The doc ument's view cannot be retrieved." : "The document provided is invalid."); 2071 exceptionState.throwDOMException(InvalidAccessError, document ? "The doc ument's view cannot be retrieved." : "The document provided is invalid.");
2072 return; 2072 return;
2073 } 2073 }
2074 2074
2075 FrameView* frameView = document->view(); 2075 FrameView* frameView = document->view();
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
2431 String Internals::textSurroundingNode(Node* node, int x, int y, unsigned long ma xLength) 2431 String Internals::textSurroundingNode(Node* node, int x, int y, unsigned long ma xLength)
2432 { 2432 {
2433 if (!node) 2433 if (!node)
2434 return String(); 2434 return String();
2435 blink::WebPoint point(x, y); 2435 blink::WebPoint point(x, y);
2436 SurroundingText surroundingText(VisiblePosition(node->renderer()->positionFo rPoint(static_cast<IntPoint>(point))), maxLength); 2436 SurroundingText surroundingText(VisiblePosition(node->renderer()->positionFo rPoint(static_cast<IntPoint>(point))), maxLength);
2437 return surroundingText.content(); 2437 return surroundingText.content();
2438 } 2438 }
2439 2439
2440 } 2440 }
OLDNEW
« no previous file with comments | « Source/core/loader/HistoryItem.cpp ('k') | Source/web/WebHistoryItem.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698