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

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

Issue 171333003: Pass implementation object to supplemental classes by reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 10 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
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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 } 235 }
236 236
237 InternalSettings* Internals::settings() const 237 InternalSettings* Internals::settings() const
238 { 238 {
239 Document* document = contextDocument(); 239 Document* document = contextDocument();
240 if (!document) 240 if (!document)
241 return 0; 241 return 0;
242 Page* page = document->page(); 242 Page* page = document->page();
243 if (!page) 243 if (!page)
244 return 0; 244 return 0;
245 return InternalSettings::from(page); 245 return InternalSettings::from(*page);
246 } 246 }
247 247
248 InternalRuntimeFlags* Internals::runtimeFlags() const 248 InternalRuntimeFlags* Internals::runtimeFlags() const
249 { 249 {
250 return m_runtimeFlags.get(); 250 return m_runtimeFlags.get();
251 } 251 }
252 252
253 InternalProfilers* Internals::profilers() 253 InternalProfilers* Internals::profilers()
254 { 254 {
255 if (!m_profilers) 255 if (!m_profilers)
(...skipping 999 matching lines...) Expand 10 before | Expand all | Expand 10 after
1255 WebCore::overrideUserPreferredLanguages(atomicLanguages); 1255 WebCore::overrideUserPreferredLanguages(atomicLanguages);
1256 } 1256 }
1257 1257
1258 unsigned Internals::wheelEventHandlerCount(Document* document, ExceptionState& e xceptionState) 1258 unsigned Internals::wheelEventHandlerCount(Document* document, ExceptionState& e xceptionState)
1259 { 1259 {
1260 if (!document) { 1260 if (!document) {
1261 exceptionState.throwDOMException(InvalidAccessError, "No context documen t is available."); 1261 exceptionState.throwDOMException(InvalidAccessError, "No context documen t is available.");
1262 return 0; 1262 return 0;
1263 } 1263 }
1264 1264
1265 return WheelController::from(document)->wheelEventHandlerCount(); 1265 return WheelController::from(*document)->wheelEventHandlerCount();
1266 } 1266 }
1267 1267
1268 unsigned Internals::touchEventHandlerCount(Document* document, ExceptionState& e xceptionState) 1268 unsigned Internals::touchEventHandlerCount(Document* document, ExceptionState& e xceptionState)
1269 { 1269 {
1270 if (!document) { 1270 if (!document) {
1271 exceptionState.throwDOMException(InvalidAccessError, "No context documen t is available."); 1271 exceptionState.throwDOMException(InvalidAccessError, "No context documen t is available.");
1272 return 0; 1272 return 0;
1273 } 1273 }
1274 1274
1275 const TouchEventTargetSet* touchHandlers = document->touchEventTargets(); 1275 const TouchEventTargetSet* touchHandlers = document->touchEventTargets();
(...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after
1996 exceptionState.throwDOMException(InvalidAccessError, document ? "The doc ument's page cannot be retrieved." : "No context document can be obtained."); 1996 exceptionState.throwDOMException(InvalidAccessError, document ? "The doc ument's page cannot be retrieved." : "No context document can be obtained.");
1997 return; 1997 return;
1998 } 1998 }
1999 document->page()->setIsCursorVisible(isVisible); 1999 document->page()->setIsCursorVisible(isVisible);
2000 } 2000 }
2001 2001
2002 void Internals::webkitWillEnterFullScreenForElement(Document* document, Element* element) 2002 void Internals::webkitWillEnterFullScreenForElement(Document* document, Element* element)
2003 { 2003 {
2004 if (!document) 2004 if (!document)
2005 return; 2005 return;
2006 FullscreenElementStack::from(document)->webkitWillEnterFullScreenForElement( element); 2006 FullscreenElementStack::from(*document).webkitWillEnterFullScreenForElement( element);
2007 } 2007 }
2008 2008
2009 void Internals::webkitDidEnterFullScreenForElement(Document* document, Element* element) 2009 void Internals::webkitDidEnterFullScreenForElement(Document* document, Element* element)
2010 { 2010 {
2011 if (!document) 2011 if (!document)
2012 return; 2012 return;
2013 FullscreenElementStack::from(document)->webkitDidEnterFullScreenForElement(e lement); 2013 FullscreenElementStack::from(*document).webkitDidEnterFullScreenForElement(e lement);
2014 } 2014 }
2015 2015
2016 void Internals::webkitWillExitFullScreenForElement(Document* document, Element* element) 2016 void Internals::webkitWillExitFullScreenForElement(Document* document, Element* element)
2017 { 2017 {
2018 if (!document) 2018 if (!document)
2019 return; 2019 return;
2020 FullscreenElementStack::from(document)->webkitWillExitFullScreenForElement(e lement); 2020 FullscreenElementStack::from(*document).webkitWillExitFullScreenForElement(e lement);
2021 } 2021 }
2022 2022
2023 void Internals::webkitDidExitFullScreenForElement(Document* document, Element* e lement) 2023 void Internals::webkitDidExitFullScreenForElement(Document* document, Element* e lement)
2024 { 2024 {
2025 if (!document) 2025 if (!document)
2026 return; 2026 return;
2027 FullscreenElementStack::from(document)->webkitDidExitFullScreenForElement(el ement); 2027 FullscreenElementStack::from(*document).webkitDidExitFullScreenForElement(el ement);
2028 } 2028 }
2029 2029
2030 void Internals::registerURLSchemeAsBypassingContentSecurityPolicy(const String& scheme) 2030 void Internals::registerURLSchemeAsBypassingContentSecurityPolicy(const String& scheme)
2031 { 2031 {
2032 SchemeRegistry::registerURLSchemeAsBypassingContentSecurityPolicy(scheme); 2032 SchemeRegistry::registerURLSchemeAsBypassingContentSecurityPolicy(scheme);
2033 } 2033 }
2034 2034
2035 void Internals::removeURLSchemeRegisteredAsBypassingContentSecurityPolicy(const String& scheme) 2035 void Internals::removeURLSchemeRegisteredAsBypassingContentSecurityPolicy(const String& scheme)
2036 { 2036 {
2037 SchemeRegistry::removeURLSchemeRegisteredAsBypassingContentSecurityPolicy(sc heme); 2037 SchemeRegistry::removeURLSchemeRegisteredAsBypassingContentSecurityPolicy(sc heme);
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
2363 }; 2363 };
2364 2364
2365 } // namespace 2365 } // namespace
2366 2366
2367 ScriptPromise Internals::addOneToPromise(ExecutionContext* context, ScriptPromis e promise) 2367 ScriptPromise Internals::addOneToPromise(ExecutionContext* context, ScriptPromis e promise)
2368 { 2368 {
2369 return promise.then(AddOneFunction::create(context)); 2369 return promise.then(AddOneFunction::create(context));
2370 } 2370 }
2371 2371
2372 } 2372 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698