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

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

Issue 2710983003: Move HistoryItem handling to DocumentLoader (Closed)
Patch Set: Address yhirano's comments Created 3 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
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 809 matching lines...) Expand 10 before | Expand all | Expand 10 after
820 } 820 }
821 821
822 bool Internals::hasAutofocusRequest() { 822 bool Internals::hasAutofocusRequest() {
823 return hasAutofocusRequest(0); 823 return hasAutofocusRequest(0);
824 } 824 }
825 825
826 Vector<String> Internals::formControlStateOfHistoryItem( 826 Vector<String> Internals::formControlStateOfHistoryItem(
827 ExceptionState& exceptionState) { 827 ExceptionState& exceptionState) {
828 HistoryItem* mainItem = nullptr; 828 HistoryItem* mainItem = nullptr;
829 if (frame()) 829 if (frame())
830 mainItem = frame()->loader().currentItem(); 830 mainItem = frame()->loader().documentLoader()->historyItem();
831 if (!mainItem) { 831 if (!mainItem) {
832 exceptionState.throwDOMException(InvalidAccessError, 832 exceptionState.throwDOMException(InvalidAccessError,
833 "No history item is available."); 833 "No history item is available.");
834 return Vector<String>(); 834 return Vector<String>();
835 } 835 }
836 return mainItem->getDocumentState(); 836 return mainItem->getDocumentState();
837 } 837 }
838 838
839 void Internals::setFormControlStateOfHistoryItem( 839 void Internals::setFormControlStateOfHistoryItem(
840 const Vector<String>& state, 840 const Vector<String>& state,
841 ExceptionState& exceptionState) { 841 ExceptionState& exceptionState) {
842 HistoryItem* mainItem = nullptr; 842 HistoryItem* mainItem = nullptr;
843 if (frame()) 843 if (frame())
844 mainItem = frame()->loader().currentItem(); 844 mainItem = frame()->loader().documentLoader()->historyItem();
845 if (!mainItem) { 845 if (!mainItem) {
846 exceptionState.throwDOMException(InvalidAccessError, 846 exceptionState.throwDOMException(InvalidAccessError,
847 "No history item is available."); 847 "No history item is available.");
848 return; 848 return;
849 } 849 }
850 mainItem->clearDocumentState(); 850 mainItem->clearDocumentState();
851 mainItem->setDocumentState(state); 851 mainItem->setDocumentState(state);
852 } 852 }
853 853
854 DOMWindow* Internals::pagePopupWindow() const { 854 DOMWindow* Internals::pagePopupWindow() const {
(...skipping 1481 matching lines...) Expand 10 before | Expand all | Expand 10 after
2336 } 2336 }
2337 2337
2338 CallbackFunctionTest* Internals::callbackFunctionTest() const { 2338 CallbackFunctionTest* Internals::callbackFunctionTest() const {
2339 return CallbackFunctionTest::create(); 2339 return CallbackFunctionTest::create();
2340 } 2340 }
2341 2341
2342 Vector<String> Internals::getReferencedFilePaths() const { 2342 Vector<String> Internals::getReferencedFilePaths() const {
2343 if (!frame()) 2343 if (!frame())
2344 return Vector<String>(); 2344 return Vector<String>();
2345 2345
2346 return frame()->loader().currentItem()->getReferencedFilePaths(); 2346 return frame()
2347 ->loader()
2348 .documentLoader()
2349 ->historyItem()
2350 ->getReferencedFilePaths();
2347 } 2351 }
2348 2352
2349 void Internals::startStoringCompositedLayerDebugInfo( 2353 void Internals::startStoringCompositedLayerDebugInfo(
2350 Document* document, 2354 Document* document,
2351 ExceptionState& exceptionState) { 2355 ExceptionState& exceptionState) {
2352 DCHECK(document); 2356 DCHECK(document);
2353 if (!document->view()) { 2357 if (!document->view()) {
2354 exceptionState.throwDOMException(InvalidAccessError, 2358 exceptionState.throwDOMException(InvalidAccessError,
2355 "The document provided is invalid."); 2359 "The document provided is invalid.");
2356 return; 2360 return;
(...skipping 853 matching lines...) Expand 10 before | Expand all | Expand 10 after
3210 3214
3211 void Internals::crash() { 3215 void Internals::crash() {
3212 CHECK(false) << "Intentional crash"; 3216 CHECK(false) << "Intentional crash";
3213 } 3217 }
3214 3218
3215 void Internals::setIsLowEndDevice(bool isLowEndDevice) { 3219 void Internals::setIsLowEndDevice(bool isLowEndDevice) {
3216 MemoryCoordinator::setIsLowEndDeviceForTesting(isLowEndDevice); 3220 MemoryCoordinator::setIsLowEndDeviceForTesting(isLowEndDevice);
3217 } 3221 }
3218 3222
3219 } // namespace blink 3223 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698