Aug 21, 2014

Learnt from bugs

1049195

  • gl uses kgsl through kgsl_ioctl()
  • gralloc uses ion memory

1054011

  •  HTMLIFrameElement::SetAttr()
       nsElementFrameLoaderOwner::LoadSrc()
         nsFrameLoader::LoadFrame()
           nsFrameLoader::LoadURI()
             nsDocument::InitializeFrameLoader()
               nsDocument::MaybeInitializeFinalizeFrameLoaders()
                  nsFrameLoader::ReallyStartLoading()
                    nsFrameLoader::ReallyStartLoadingInternal()
                      if (mRemoteFrame) {
                        TabParent::LoadURL()
                          PBrowserParent::SendLoadURL()
                          --- IPC ---
                          TabChild::RecvLoadURL()
                            nsIWebNavigation::LoadURI()
                              nsDocShell::LoadURI()
                      } else {
                        nsDocShell::LoadURI()
                      }

1045715

  •  Console::Notify()
       Console::ProcessCallData()
         NotifyObservers("console-api-log-event"...)
           CAL_Observe()
             WCA_onConsoleAPICall()
               WCA_preapareConsoleMessageForRemote()
               DSC_send()
1014649
  • Escape analysis
    When a variable (or an object) is allocated in a subroutine, a pointer to the variable can escape to other threads of execution, or to calling subroutines. Escape analysis determines all the places where a pointer can be stored and whether the lifetime of the pointer can be proven to be restricted only to the current procedure and/or thread.
  • Tail call
    Tail calls can be implemented without adding a new stack frame to the call stack. Most of the frame of the current procedure is not needed any more, and it can be replaced by the frame of the tail call, modified as appropriate (similar to overlay for processes, but for function calls).

1050122

  •  window.parent
     parent@dom/interfaces/base/nsIDOMWindow.idl
     get_parent()@objdir-gecko/dom/bindings/WindowBinding.cpp
       nsGlobalWindow::GetParent()
  • Mochitest
    • runner_cls.start() [testing/mochitest/runtests.py]
        ProcessHandlerMixin.run() [testing/mozbase/mozprocess/mozprocess/processhandler.py]
          self.processOutput()
            self.outThread.start()
              while lines (stdout) != "": self.processOutputLine()
      runner.process_handler.wait()
        while self.outThread.isAlive(): self.outThread.join()
    • SimpleTest.finish() [testing/mochitest/tests/SimpleTest/SimpleTest.js]
        parentRunner.testFinished()
          TestRunner.testFinished() [testing/mochitest/tests/SimpleTest/TestRunner.js]
            runNextTest()
              TestRunner.testUnloaded()
                TestRuner.runNextTest()
                  TestRunner.onComplete()

1064800

  • MTBF
    • test_mtbf_fmradio_turn_on_off.py (MtbfTestCase.setUp > GaiaTestCase.setUp)
        MTBF_FmRadio.launch()
          Base.lauch() [gaia-ui-tests/gaiatest/apps/base.py]
            GaiaApps.launch() [gaiatest/gaia-test.py]
              self.marionette.execute_async_script("GaiaApps.lauchWithName")
                self._send_message('executeAsyncScript') [marionette.py]
       --- marionette_server.js ---
       --- marionette_listener.js ---
       executeAsyncScript()
         executeWithCallback()
           createExecuteContentSandbox()
             Cu.Sandbox()
               new Marionette()
           Cu.evalInSandbox()
    • $ adb -s 3739ce32 forward tcp:2829 tcp:2828
      $ ANDROID_SERIAL=3739ce32 MTBF_CONF=conf/flame_v210.json MTBF_TIME=1d python mtbf.py --testvars=testvars.json --address=localhost:2829 tests/test_dummy_case.py

1094010

  • TabChild::RecvLoadURL()
    ...
      nsJARChannel::AsyncOpen(jar:remoteopenfile:///...application.zip!/index.html)
        nsJARChannel::LookupFile()
          RemoteOpenFileChild::AsyncRemoteFileOpen()
    ...
    TabChild::RecvCacheFileDescriptor()
      nsJARChannel::OnRemoteFileOpenComplete()
        nsJARChannell::OpenLocalFile()
          nsJARChannel::CreateJarInput()
            nsJARChannel::OpenLocalFile()
              nsInputStreamPump::AsyncRead()
                nsIStreamTransportService::CreateInputTransport()
                nsInputStreamTransport::OpenInputStream
                  NS_AsyncCopy()
                    ...
                      nsAStreamCopier::Start()
                        nsAStreamCopier::PostContinuationEvent()
                          nsAStreamCopier::PostContinuationEvent_Locked()
                            nsIStreamTransportService::Dispatch()
                            ---
                            nsJARInputStream::Read()
                              nsJARInputStream::ContinueInflate()
                            NS_NewInputStreamReadyEvent()
                            nsInputStreamReadyEvent::OnInputStreamReady()
               nsInputStreamPump::EnsureWaiting()
                  nsPipeInputStream::AsyncWait()
                    NS_NewInputStreamReadyEvent()
    ...
    nsInputStreamReadyEvent::Run()
      nsInputStreamPump::OnInputStreamReady()
        nsInputStreamPump::OnStateStart()
          nsJARChannel::OnStateStart()
            nsDocumentOpenInfo::OnStartRequest()
    ...
    nsInputStreamReadyEvent::Run()
      nsInputStreamPump::OnInputStreamReady()
        nsInputStreamPump::OnStateTransfer()
          nsJARChannel::OnDataAvailable()
            nsDocumentOpenInfo::OnDataAvailable()
        ...
    ...
    nsHtml5LoadFlusher::Run()
      ...
      nsJARChannel::AsyncOpen(...css)
        nsJARChannel::OpenLoaclFile()
          nsInputStreamPump::AsyncRead()
            nsInputStreamPump::EnsureWaiting()
              EnsureWaiting()
                nsPipeInputStream::AsyncWait()
                  NS_NewInputStreamReadyEvent()

1068232

  • IDBCursor::Continue()
      BackgroundCursorChild::SendContinueInternal() > SendContinue()
    --- IPC ---
    Cursor::RecvContinue()
      TransactionThreadPool::TransactionQueue::Dispatch()
    --- Thread Switching ---
    ContinueOp::DoDatabaseWork()
    --- Thread Switching ---
    ContinueOp::SendSuccessResult()
      Cursor::SendResponseInternal() > SendResponse()
    --- IPC ---
    BackgroundCursorChild::RecvResponse()

1110624

  • HTMLIFrameElement.getCanGoForward()
      BrowserElementParent.getCanGoForward()
        sendAsyncMessage('browser-element-api:call', { msg_name='get-can-go-forward', ...})
        --- IPC ---
        BrowserElementChildPreload._recvCanGoForward
          sendAsyncMessage('got-can-go-forward', { successRv: docshell.QueryInterface(Ci.nsIWebNavigation).canGoForward })
  • TabChild::Init()
      do_CreateInstance(NS_WEBBROWSER)
        nsWebBrowser::Create()
          SetDocShell(do_CreateInstance(docshell))
      mWebNav = do_QueryInterface(WebBrowser)  // Will be used in TabChild::RecvLoadURL()

No comments:

Post a Comment