gecko-dev/layout/inspector/inSearchLoop.cpp
Robert O'Callahan 57435abee6 Bug 945091. Part 1: Flatten inspector/public and inspector/src into inspector. r=glandium
--HG--
rename : layout/inspector/src/inCSSValueSearch.cpp => layout/inspector/inCSSValueSearch.cpp
rename : layout/inspector/src/inCSSValueSearch.h => layout/inspector/inCSSValueSearch.h
rename : layout/inspector/src/inDOMUtils.cpp => layout/inspector/inDOMUtils.cpp
rename : layout/inspector/src/inDOMUtils.h => layout/inspector/inDOMUtils.h
rename : layout/inspector/src/inDOMView.cpp => layout/inspector/inDOMView.cpp
rename : layout/inspector/src/inDOMView.h => layout/inspector/inDOMView.h
rename : layout/inspector/src/inDeepTreeWalker.cpp => layout/inspector/inDeepTreeWalker.cpp
rename : layout/inspector/src/inDeepTreeWalker.h => layout/inspector/inDeepTreeWalker.h
rename : layout/inspector/src/inFlasher.cpp => layout/inspector/inFlasher.cpp
rename : layout/inspector/src/inFlasher.h => layout/inspector/inFlasher.h
rename : layout/inspector/public/inICSSValueSearch.idl => layout/inspector/inICSSValueSearch.idl
rename : layout/inspector/public/inIDOMUtils.idl => layout/inspector/inIDOMUtils.idl
rename : layout/inspector/public/inIDOMView.idl => layout/inspector/inIDOMView.idl
rename : layout/inspector/public/inIDeepTreeWalker.idl => layout/inspector/inIDeepTreeWalker.idl
rename : layout/inspector/public/inIFlasher.idl => layout/inspector/inIFlasher.idl
rename : layout/inspector/public/inISearchObserver.idl => layout/inspector/inISearchObserver.idl
rename : layout/inspector/public/inISearchProcess.idl => layout/inspector/inISearchProcess.idl
rename : layout/inspector/src/inLayoutUtils.cpp => layout/inspector/inLayoutUtils.cpp
rename : layout/inspector/src/inLayoutUtils.h => layout/inspector/inLayoutUtils.h
rename : layout/inspector/src/inSearchLoop.cpp => layout/inspector/inSearchLoop.cpp
rename : layout/inspector/src/inSearchLoop.h => layout/inspector/inSearchLoop.h
rename : layout/inspector/src/moz.build => layout/inspector/moz.build
rename : layout/inspector/src/nsFontFace.cpp => layout/inspector/nsFontFace.cpp
rename : layout/inspector/src/nsFontFace.h => layout/inspector/nsFontFace.h
rename : layout/inspector/src/nsFontFaceList.cpp => layout/inspector/nsFontFaceList.cpp
rename : layout/inspector/src/nsFontFaceList.h => layout/inspector/nsFontFaceList.h
rename : layout/inspector/public/nsIDOMFontFace.idl => layout/inspector/nsIDOMFontFace.idl
rename : layout/inspector/public/nsIDOMFontFaceList.idl => layout/inspector/nsIDOMFontFaceList.idl
2013-12-04 14:04:23 +13:00

59 lines
1.2 KiB
C++

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "inSearchLoop.h"
#include "nsITimer.h"
#include "nsIServiceManager.h"
///////////////////////////////////////////////////////////////////////////////
inSearchLoop::inSearchLoop(inISearchProcess* aSearchProcess)
{
mSearchProcess = aSearchProcess;
nsresult rv;
mTimer = do_CreateInstance("@mozilla.org/timer;1", &rv);
}
inSearchLoop::~inSearchLoop()
{
}
///////////////////////////////////////////////////////////////////////////////
// inSearchLoop
nsresult
inSearchLoop::Start()
{
mTimer->InitWithFuncCallback(inSearchLoop::TimerCallback, (void*)this, 0, nsITimer::TYPE_REPEATING_SLACK);
return NS_OK;
}
nsresult
inSearchLoop::Step()
{
bool done = false;
mSearchProcess->SearchStep(&done);
if (done)
Stop();
return NS_OK;
}
nsresult
inSearchLoop::Stop()
{
mTimer->Cancel();
return NS_OK;
}
void
inSearchLoop::TimerCallback(nsITimer *aTimer, void *aClosure)
{
inSearchLoop* loop = (inSearchLoop*) aClosure;
loop->Step();
}