Code paths for common operations
There is additional information and more examples on how Chromium displays web pages.
Application startup
- Our
WinMain
function is inchrome/app/main.cc
, and is linked in thechrome
project. -
WinMain
launches the Google Update Client, which is the installer/autoupdater. It will find the subdirectory for the current version, and loadchrome.dll
from there. - It calls
ChromeMain
in the newly loaded library, which is inchrome_main.cc
in thechrome_dll
project. -
ChromeMain
does initialization for common components, and then forwards to eitherRendererMain
inchrome/renderer/renderer_main.cc
if the command line flag indicates that this should be a subprocess, orBrowserMain
inchrome/browser/browser_main.cc
if not to load a new copy of the application. Since this is startup, we're launching the browser. -
BrowserMain
does common browser initialization. It has different modes for running installed webapps, connecting to the automation system if the browser is being tested, etc. - It calls
LaunchWithProfile
inbrowser_init.cc
which creates a newBrowser
object inchrome/browser/ui/browser.cc
. This object encapsulates one toplevel window in the application. The first tab is appended at this time.
Tab startup & initial navigation
-
Browser::AddTab
inchrome/browser/ui/browser.cc
is called to append a new tab. - It will create a new
TabContents
object frombrowser/tab_contents/tab_contents.cc
-
TabContents
creates aRenderViewHost
(chrome/browser/renderer_host/render_view_host.cc
) via theRenderViewHostManager
's
Init function inchrome/browser/tab_contents/render_view_host_manager.cc
). Depending on theSiteInstance
, theRenderViewHost
either spawns a new renderer process, or re-uses an existingRenderProcessHost
.RenderProcessHost
is the object in the browser that represents a single renderer subprocess. - The
NavigationController
inchrome/browser/tab_contents/navigation_controller.cc
which is owned by the tab contents, is instructed to navigate to the URL for the new tab inNavigationController::LoadURL
. "Navigating from the URL bar" from step 3 onward describes what happens from this point.
Navigating from the URL bar
- When the user types into or accepts an entry in the URL bar, the autocomplete edit box determines the final target URL and passes that to
AutocompleteEdit::OpenURL
. (This may not be exactly what the user typed - for example, an URL is generated in the case of a search query.) - The navigation controller is instructed to navigate to the URL in
NavigationController::LoadURL
. - The
NavigationController
callsTabContents::Navigate
with theNavigationEntry
it created to represent this particular page transition. It will create a newRenderViewHost
if necessary, which will cause creation of aRenderView
in the renderer process. ARenderView
won't exist if this is the first navigation, or if the renderer has crashed, so this will also recover from crashes. -
Navigate
forwards toRenderViewHost::NavigateToEntry
. TheNavigationController
stores this navigation entry, but it is marked as "pending" because it doesn't know for sure if the transition will take place (maybe the host can not be resolved). -
RenderViewHost::NavigateToEntry
sends aViewMsg_Navigate
to the newRenderView
in the renderer process. - When told to navigate,
RenderView
may navigate, it may fail, or it may navigate somewhere else instead (for example, if the user clicks a link).RenderViewHost
waits for aViewHostMsg_FrameNavigate
from theRenderView
. - When the load is "committed" by WebKit (the server responded and is sending us data), the
RenderView
sends this message, which is handled inRenderViewHost::OnMsgNavigate
. - The
NavigationEntry
is updated with the information on the load. In the case of a link click, the browser has never seen this URL before. If the navigation was browser-initiated, as in the startup case, there may have been redirects that have changed the URL. - The
NavigationController
updates its list of navigations to account for this new information.
Navigations and session history
Each NavigationEntry
stores a page ID and a block of history state data. The page ID is used to uniquely identify a page load, so we know which NavigationEntry
it corresponds to. It is assigned when the page is committed commit, so a pending NavigationEntry
will have a page ID of -1. The history state data is simply a WebCore::HistoryItem
serialized to a string. Included on this item are things like the page URL, subframe URLs, and form data.
- When the browser initiates the request (typing in the URL bar, or clicking back/forward/reload)
- A
WebRequest
is made representing the navigation, along with extra information like a page ID for bookkeeping. New navigations have an ID of -1. Navigations to old entries have the ID assigned to theNavigationEntry
when the page was first visited. This extra information will be queried later when the load commits. - The main
WebFrame
is told to load the new request.
- A
- When the renderer initiates the request (user clicks a link, javascript changes the location, etc):
-
WebCore::FrameLoader
is told to load the request via one of its bajillion varied load methods.
-
- In either case, when the first packet from the server is received, the load is committed (no longer "pending" or "provisional").
- If this was a new navigation,
WebCore
will create a newHistoryItem
and add it to theBackForwardList
, aWebCore
class. In this way, we can differentiate which navigations are new, and which are session history navigations. -
RenderView::DidCommitLoadForFrame
handles the commit for the load. Here, the previous page's state is stored in session history, via theViewHostMsg_UpdateState
message. This will tell the browser to update the correspondingNavigationEntry
(identified byRenderView's
currentpage ID
) with the new history state. -
RenderView's
currentpage ID
is updated to reflect the committed page. For a new navigation, a new uniquepage ID
is generated. For a session history navigation, it will be thepage ID
originally assigned when it was first visited, which we had stored on theWebRequest
when initiating the navigation. - A
ViewHostMsg_FrameNavigate
message is sent to the browser, updating the correspondingNavigationEntry
(identified byRenderView's
newly updatedpage ID
) with the new URL and other information
相关推荐
4.16 Stack operations for nested subroutines 4.17 Block copy with LDM and STM 4.18 Memory accesses 4.19 The Read-Modify-Write operation 4.20 Optional hash with immediate constants 4.21 Use of macros ...
Validation can include checks for code signing, entitlements, and other requirements necessary for distribution through the App Store. #### Build and Product Location Build Settings ##### BUILT_...
- **I/O:** Akka I/O provides a non-blocking API for performing I/O operations, such as reading from and writing to sockets. - **Using TCP:** Using TCP in Akka involves creating TCP connections and ...
Filter settings allow for fine-tuning the profiling process by excluding irrelevant code paths. Key aspects include: - Defining custom filters based on class names, package names, or method signatures...
- **Path and Files API**: Overview of the `Paths` and `Files` classes, which provide a high-level interface for working with file system paths and performing common file operations. - **Asynchronous...
We do this to keep code simple and to avoid the various common errors and problems that these features can cause. This guide lists these features and explains why their use is restricted. Open-...
EhLib 8.0 Build 8.0.023 Pro Edition FullSource for D7-XE8 亲测可用,含全部源码及 Demo The Library contains components and classes for ...Copy files from folders Common and RADStudioXE2 of EhLib archive...
- **Conditions and Actions:** Building blocks of workflows, including conditions that determine workflow paths and actions that perform operations. - **Workflow User Experience:** How workflows appear...
Mathematics in Computing An Accessible Guide to Historical,...16.2.1 Hamiltonian Paths 16.3 Trees 16.3.1 Binary Trees 16.4 Graph Algorithms 16.5 Review Questions 16.6 Summary References Glossary Index
- Video playback, Hard disk and CD/DVD test 'no operations' error reporting changed. - When BurnInTest crashes, it will not generate a "minidump" file. Minidumps will need to be sent to Microsoft ...
Common Stumbling Blocks Print Is A Function Views And Iterators Instead Of Lists Ordering Comparisons Integers Text Vs. Data Instead Of Unicode Vs. 8-bit Overview Of Syntax Changes New Syntax ...
objects, which contains types of group operations (goSum or goCount) and name sum field (goCount name of field is unnecessary). TPrintDBGridEh component TPrintDBGridEh provides properties and ...
objects, which contains types of group operations (goSum or goCount) and name sum field (goCount name of field is unnecessary). TPrintDBGridEh component TPrintDBGridEh provides properties and ...
objects, which contains types of group operations (goSum or goCount) and name sum field (goCount name of field is unnecessary). TPrintDBGridEh component TPrintDBGridEh provides properties and ...
(Their paths used to break during grouping). Fixed TFlexControl.DoNotify for fnRect, fnParent. - FIX: Function ListScanEx in the module FlexUtils returned wrong item index (counted from the first ...
This directive determines whether or not PHP will recognize code between ; <? and ?> tags as PHP source which should be processed as such. It is ; generally recommended that <?php and ?> should be ...
9.4.3. Basic Zend_Date Operations Common to Many Date Parts 9.4.3.1. List of Date Parts 9.4.3.2. List of Date Operations 9.4.4. Comparing Dates 9.4.5. Getting Dates and Date Parts 9.4.6. Working ...
1.9.2 Other Representations of the Hamming Code . . . . . . . . . . . . 36 An Algebraic Representation . . . . . . . . . . . . . . . . . . . . . 37 A Polynomial Representation . . . . . . . . . . . . ...