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. ASCII、Unicode、UTF-8编码关系

    由于计算机是美国人发明的,因此,最早只有127个字符被编码到计算机里,也就是大小写英文字母.数字和一些符号,这个编码表被称为ASCII编码,比如大写字母A的编码是65,小写字母z的编码是122.但是要 ...

  2. 5 多进程copy文件

    1.如何进行开发? 2.版本1:程序大框架 #1.创建一个文件夹 #2.获取old文件夹中所有的文件名字 #3.使用多进程的方式copy原文件夹中的所有文件到新文件夹中 3.版本2:创建一个文件夹 1 ...

  3. P1060 开心的金明

    P1060 开心的金明 题目描述 金明今天很开心,家里购置的新房就要领钥匙了,新房里有一间他自己专用的很宽敞的房间.更让他高兴的是,妈妈昨天对他说:“你的房间需要购买哪些物品,怎么布置,你说了算,只要 ...

  4. centos7 的防火墙命令调整了

    CentOS 7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙.firewall:systemctl start firewalld.service#启动firewalls ...

  5. uvaoj 101 - The Blocks Problem(vector应用+技巧)

    https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=835&page= ...

  6. 365. Count 1 in Binary【LintCode java】

    Description Count how many 1 in binary representation of a 32-bit integer. Example Given 32, return  ...

  7. [HNOI2018]寻宝游戏(题解转载自别处)

    题解(自别处转载): Luogu CSDN 这题关键是将运算符也替换成0,1 然后在运算符与原串混杂里找规律. 而且替换的方式也有所要求,考场上两种替换方式都要尝试. #include <bit ...

  8. MR execution in YARN

    Overview YARN provides API not for application developers but for the great developers working on ne ...

  9. ZOJ 2760 How Many Shortest Path(最短路径+最大流)

    Description Given a weighted directed graph, we define the shortest path as the path who has the sma ...

  10. mysql mariadb 密码设置

    原文:https://my.oschina.net/uyunsky/blog/109532 一.初始安装 Method 1:在/usr/local/mysql/bin/下:./mysqladmin - ...