startup_browser_creator_impl.cc

————————》打开任何页面或浏览器的入口函数
bool StartupBrowserCreatorImpl::ProcessStartupURLs(const std::vector<GURL>& urls_to_open)
————————》
Browser* browser = SessionRestore::RestoreSession(profile_, NULL, restore_behavior, adjusted_urls);
————————》session_restore.cc
Browser* SessionRestore::RestoreSession(Profile* profile,Browser* browser,uint32_t behavior,const std::vector<GURL>& urls_to_open)
————————》
  Browser* Restore()
————————》
  void OnGotSession(std::vector<std::unique_ptr<sessions::SessionWindow>> windows,SessionID::id_type active_window_id)
————————》
  Browser* ProcessSessionWindowsAndNotify(std::vector<std::unique_ptr<sessions::SessionWindow>>* windows,SessionID::id_type active_window_id)
————————》
  Browser* ProcessSessionWindows(std::vector<std::unique_ptr<sessions::SessionWindow>>* windows,SessionID::id_type active_window_id,std::vector<RestoredTab>* created_contents)
————————》在以下函数中将上次的标签页存储到created_contents中并通过RestoreTab一一保存      
—》RestoreTabsToBrowser(*(*i), browser, initial_tab_count,selected_tab_index, created_contents);——》WebContents* contents = RestoreTab(tab, i, browser, is_selected_tab);
        
—》Browser* finished_browser = FinishedTabCreation(true, has_tabbed_browser, created_contents);
————————》之后是将上次保存的标签页全部打开
Browser* FinishedTabCreation(bool succeeded,bool created_tabbed_browser,std::vector<RestoredTab>* contents_created)
————————》session_restore_delegate.cc
SessionRestoreDelegate::RestoreTabs(*contents_created, restore_started_);
————————》
void SessionRestoreDelegate::RestoreTabs(const std::vector<RestoredTab>& tabs,const base::TimeTicks& restore_started)
————————》
void TabLoader::RestoreTabs(const std::vector<RestoredTab>& tabs,const base::TimeTicks& restore_started)

1.首次正常打开
Restore——》ProcessSessionWindowsAndNotify(Restore中调用)——》ProcessSessionWindows——》RestoreTabsToBrowser——》RestoreTab——》FinishedTabCreation——》RestoreTabs
2.非首次正常打开(之前有正常关闭的标签页)
Restore——》ProcessSessionWindowsAndNotify(Restore中调用)——》ProcessSessionWindows——》RestoreTabsToBrowser——》RestoreTab(n个:n为之前打开的标签页个数)——》FinishedTabCreation——》RestoreTabs
3.非首次非正常打开(之前有未正常关闭的标签页)
Restore——》OnGotSession——》ProcessSessionWindowsAndNotify(OnGotSession中调用)——》ProcessSessionWindows——》RestoreTabsToBrowser——》RestoreTab(n个:n为之前打开的标签页个数)——》FinishedTabCreation——》RestoreTabs

chrome源码之恢复上次打开的标签页的学习的更多相关文章

  1. 从Chrome源码看浏览器如何构建DOM树

    .aligncenter { clear: both; display: block; margin-left: auto; margin-right: auto } p { font-size: 1 ...

  2. 从Chrome源码看audio/video流媒体实现二(转)

    第一篇主要介绍了Chrome加载音视频的缓冲控制机制和编解码基础,本篇将比较深入地介绍解码播放的过程.以Chromium 69版本做研究. 由于Chromium默认不能播放Mp4,所以需要需要改一下源 ...

  3. 从Chrome源码看浏览器的事件机制

    .aligncenter { clear: both; display: block; margin-left: auto; margin-right: auto } .crayon-line spa ...

  4. Google Chrome 源码下载地址 (Google Chrome Source Code Download)

    1. Google Chrome 源码 SVN 地址:http://src.chromium.org/svn.包含有 Chrome.Gears.Webkit.GCC 等源码以及编译依赖工具.Chrom ...

  5. 从Chrome源码看JS Array的实现

    .aligncenter { clear: both; display: block; margin-left: auto; margin-right: auto } .crayon-line spa ...

  6. 下载Spring4.1.x源码并用IntelliJ IDEA打开-----

    下载Spring4.1.x源码并用IntelliJ IDEA打开-------https://blog.csdn.net/boling_cavalry/article/details/79426075 ...

  7. VSCode打开文件总是会覆盖上次打开的标签

    在使用VSCode的时候,打开一个文件之后,如果没有修改的话,那么再打开下一个文件的时候,他总会替换上次打开的标签,那么怎么样才能每次都在新的标签打开文件呢? 实际上,这种情况的出现是因为我们点击文件 ...

  8. chrome打开新标签页插件

    标签(空格分隔): 日常办公,chrome浏览器 一直被chrome浏览器打开新标签页困扰,每次点开一个新标签页还要再去点一下主页,才能打开搜索页面.如果直接点击主页,又会把当前的页面刷掉,实在是非常 ...

  9. spring源码深度解析— IOC 之 默认标签解析(下)

    在spring源码深度解析— IOC 之 默认标签解析(上)中我们已经完成了从xml配置文件到BeanDefinition的转换,转换后的实例是GenericBeanDefinition的实例.本文主 ...

随机推荐

  1. nio之netty3的应用

    1.netty3是nio的封装版本.在使用上面比nio的直接使用更好.nio简单使用都是单线程的方式(比如:一个服务员服务很多客户),但是netty3的方式不一样的是,引入线程池的方式来实现服务的通信 ...

  2. 笔记本ubuntu安装wifi驱动(未完成)

    1. 用联想E440,Ubuntu14.04,安装完之后,没有检查到wifi的驱动,所以需要安装.

  3. 使用nmon监控得出网络实时速度以及最大、最小、平均网络传送速度

    首先我们得搞清楚几个概念,即什么是网速?什么是带宽? 举两个个例子: 1.家里装网线,宽带提供商说我们的带宽是100兆. 2.用迅雷下载电影,迅雷显示实时的下载速度是每秒3兆,或者说是3MB/s. 这 ...

  4. hdu2199Can you solve this equation?(解方程+二分)

    Can you solve this equation? Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K ( ...

  5. Qt listwigwt item 加入自定义元素

    <span style="font-family: Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255) ...

  6. 2019年1月23日,好像是这个日子,RF发布了 1.7.3.1 支持python3.6以上了,安装成功。

    安装步骤:(win10 家庭版 64) 1.安装Python3.7.2,记得勾选添加Path 2.pip install robotframework 3.pip install wxPython 4 ...

  7. 软件测试的基础-摘自《selenium实践-基于电子商务平台》

    软件测试的方法 一.等价类划分法 等价类划分法是把所有可能的输入数据,即程序的输入域划分成若干部分(子集),然后从每一个子集中选取少量具有代表性的数据作为测试用例. 有两种不同的情况:有效等价和无效等 ...

  8. 【转】: 《江湖X》开发笔谈 - 热更新框架

    前言 大家好,我们这期继续借着我们工作室正在运营的在线游戏<江湖X>来谈一下热更新机制以及我们的理解和解决方案.这里先简单的介绍一下热更新的概念,熟悉这部分的朋友可以跳过,直接看我们的方案 ...

  9. 《Effective C++》读书笔记 被你忽略的关于构造析构赋值

    如果程序员没有定义,那么编译器会默认隐式为你创建一个copy构造函数,一个copy赋值操作符,一个析构函数.另外如果你没有声明任何构造函数,编译器会为你声明一个default构造函数. 但是只有当这些 ...

  10. HDU 1394Minimum Inversion Number

    The inversion number of a given number sequence a1, a2, ..., an is the number of pairs (ai, aj) that ...