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

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

Issue 2710983003: Move HistoryItem handling to DocumentLoader (Closed)
Patch Set: Address kinuko'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 810 matching lines...) Expand 10 before | Expand all | Expand 10 after
821 } 821 }
822 822
823 bool Internals::hasAutofocusRequest() { 823 bool Internals::hasAutofocusRequest() {
824 return hasAutofocusRequest(0); 824 return hasAutofocusRequest(0);
825 } 825 }
826 826
827 Vector<String> Internals::formControlStateOfHistoryItem( 827 Vector<String> Internals::formControlStateOfHistoryItem(
828 ExceptionState& exceptionState) { 828 ExceptionState& exceptionState) {
829 HistoryItem* mainItem = nullptr; 829 HistoryItem* mainItem = nullptr;
830 if (frame()) 830 if (frame())
831 mainItem = frame()->loader().currentItem(); 831 mainItem = frame()->loader().documentLoader()->historyItem();
832 if (!mainItem) { 832 if (!mainItem) {
833 exceptionState.throwDOMException(InvalidAccessError, 833 exceptionState.throwDOMException(InvalidAccessError,
834 "No history item is available."); 834 "No history item is available.");
835 return Vector<String>(); 835 return Vector<String>();
836 } 836 }
837 return mainItem->getDocumentState(); 837 return mainItem->getDocumentState();
838 } 838 }
839 839
840 void Internals::setFormControlStateOfHistoryItem( 840 void Internals::setFormControlStateOfHistoryItem(
841 const Vector<String>& state, 841 const Vector<String>& state,
842 ExceptionState& exceptionState) { 842 ExceptionState& exceptionState) {
843 HistoryItem* mainItem = nullptr; 843 HistoryItem* mainItem = nullptr;
844 if (frame()) 844 if (frame())
845 mainItem = frame()->loader().currentItem(); 845 mainItem = frame()->loader().documentLoader()->historyItem();
846 if (!mainItem) { 846 if (!mainItem) {
847 exceptionState.throwDOMException(InvalidAccessError, 847 exceptionState.throwDOMException(InvalidAccessError,
848 "No history item is available."); 848 "No history item is available.");
849 return; 849 return;
850 } 850 }
851 mainItem->clearDocumentState(); 851 mainItem->clearDocumentState();
852 mainItem->setDocumentState(state); 852 mainItem->setDocumentState(state);
853 } 853 }
854 854
855 DOMWindow* Internals::pagePopupWindow() const { 855 DOMWindow* Internals::pagePopupWindow() const {
(...skipping 1495 matching lines...) Expand 10 before | Expand all | Expand 10 after
2351 } 2351 }
2352 2352
2353 CallbackFunctionTest* Internals::callbackFunctionTest() const { 2353 CallbackFunctionTest* Internals::callbackFunctionTest() const {
2354 return CallbackFunctionTest::create(); 2354 return CallbackFunctionTest::create();
2355 } 2355 }
2356 2356
2357 Vector<String> Internals::getReferencedFilePaths() const { 2357 Vector<String> Internals::getReferencedFilePaths() const {
2358 if (!frame()) 2358 if (!frame())
2359 return Vector<String>(); 2359 return Vector<String>();
2360 2360
2361 return frame()->loader().currentItem()->getReferencedFilePaths(); 2361 return frame()
2362 ->loader()
2363 .documentLoader()
2364 ->historyItem()
2365 ->getReferencedFilePaths();
2362 } 2366 }
2363 2367
2364 void Internals::startStoringCompositedLayerDebugInfo( 2368 void Internals::startStoringCompositedLayerDebugInfo(
2365 Document* document, 2369 Document* document,
2366 ExceptionState& exceptionState) { 2370 ExceptionState& exceptionState) {
2367 DCHECK(document); 2371 DCHECK(document);
2368 if (!document->view()) { 2372 if (!document->view()) {
2369 exceptionState.throwDOMException(InvalidAccessError, 2373 exceptionState.throwDOMException(InvalidAccessError,
2370 "The document provided is invalid."); 2374 "The document provided is invalid.");
2371 return; 2375 return;
(...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after
3216 3220
3217 void Internals::crash() { 3221 void Internals::crash() {
3218 CHECK(false) << "Intentional crash"; 3222 CHECK(false) << "Intentional crash";
3219 } 3223 }
3220 3224
3221 void Internals::setIsLowEndDevice(bool isLowEndDevice) { 3225 void Internals::setIsLowEndDevice(bool isLowEndDevice) {
3222 MemoryCoordinator::setIsLowEndDeviceForTesting(isLowEndDevice); 3226 MemoryCoordinator::setIsLowEndDeviceForTesting(isLowEndDevice);
3223 } 3227 }
3224 3228
3225 } // namespace blink 3229 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/loader/HistoryItem.cpp ('k') | third_party/WebKit/Source/web/ContextMenuClientImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698