Commit 913750b0 authored by Hiroki Nakagawa's avatar Hiroki Nakagawa Committed by Commit Bot

NoStatePrefetch: Rename Prerender to NoStatePrefetch in chrome/ (1)

This CL renames PrerenderTabHelper to NoStatePrefetchTabHelper. See the
design doc for the overall plan:
https://docs.google.com/document/d/1e_8buEEhqgY72R2_kjGC3ChBRbA9lt5jEAZr8RLc-5Q/edit?usp=sharing

Bug: 1144577
Change-Id: I5629d556e5a5269da007f1fa32a36d0e2ce48fe6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2516679Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Reviewed-by: default avatarMatt Falkenhagen <falken@chromium.org>
Commit-Queue: Hiroki Nakagawa <nhiroki@chromium.org>
Cr-Commit-Position: refs/heads/master@{#823892}
parent 183cf60b
...@@ -1278,12 +1278,12 @@ static_library("browser") { ...@@ -1278,12 +1278,12 @@ static_library("browser") {
"prefetch/no_state_prefetch/chrome_prerender_manager_delegate.h", "prefetch/no_state_prefetch/chrome_prerender_manager_delegate.h",
"prefetch/no_state_prefetch/chrome_prerender_processor_impl_delegate.cc", "prefetch/no_state_prefetch/chrome_prerender_processor_impl_delegate.cc",
"prefetch/no_state_prefetch/chrome_prerender_processor_impl_delegate.h", "prefetch/no_state_prefetch/chrome_prerender_processor_impl_delegate.h",
"prefetch/no_state_prefetch/no_state_prefetch_tab_helper.cc",
"prefetch/no_state_prefetch/no_state_prefetch_tab_helper.h",
"prefetch/no_state_prefetch/prerender_link_manager_factory.cc", "prefetch/no_state_prefetch/prerender_link_manager_factory.cc",
"prefetch/no_state_prefetch/prerender_link_manager_factory.h", "prefetch/no_state_prefetch/prerender_link_manager_factory.h",
"prefetch/no_state_prefetch/prerender_manager_factory.cc", "prefetch/no_state_prefetch/prerender_manager_factory.cc",
"prefetch/no_state_prefetch/prerender_manager_factory.h", "prefetch/no_state_prefetch/prerender_manager_factory.h",
"prefetch/no_state_prefetch/prerender_tab_helper.cc",
"prefetch/no_state_prefetch/prerender_tab_helper.h",
"prefetch/prefetch_proxy/prefetch_proxy_features.cc", "prefetch/prefetch_proxy/prefetch_proxy_features.cc",
"prefetch/prefetch_proxy/prefetch_proxy_features.h", "prefetch/prefetch_proxy/prefetch_proxy_features.h",
"prefetch/prefetch_proxy/prefetch_proxy_from_string_url_loader.cc", "prefetch/prefetch_proxy/prefetch_proxy_from_string_url_loader.cc",
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "chrome/browser/prefetch/no_state_prefetch/prerender_tab_helper.h" #include "chrome/browser/prefetch/no_state_prefetch/no_state_prefetch_tab_helper.h"
#include "chrome/browser/prefetch/no_state_prefetch/prerender_manager_factory.h" #include "chrome/browser/prefetch/no_state_prefetch/prerender_manager_factory.h"
#include "components/prerender/browser/prerender_manager.h" #include "components/prerender/browser/prerender_manager.h"
...@@ -13,12 +13,13 @@ using content::WebContents; ...@@ -13,12 +13,13 @@ using content::WebContents;
namespace prerender { namespace prerender {
PrerenderTabHelper::PrerenderTabHelper(content::WebContents* web_contents) NoStatePrefetchTabHelper::NoStatePrefetchTabHelper(
content::WebContents* web_contents)
: content::WebContentsObserver(web_contents) {} : content::WebContentsObserver(web_contents) {}
PrerenderTabHelper::~PrerenderTabHelper() = default; NoStatePrefetchTabHelper::~NoStatePrefetchTabHelper() = default;
void PrerenderTabHelper::DidFinishNavigation( void NoStatePrefetchTabHelper::DidFinishNavigation(
content::NavigationHandle* navigation_handle) { content::NavigationHandle* navigation_handle) {
if (!navigation_handle->IsInMainFrame() || if (!navigation_handle->IsInMainFrame() ||
!navigation_handle->HasCommitted() || navigation_handle->IsErrorPage()) { !navigation_handle->HasCommitted() || navigation_handle->IsErrorPage()) {
...@@ -35,6 +36,6 @@ void PrerenderTabHelper::DidFinishNavigation( ...@@ -35,6 +36,6 @@ void PrerenderTabHelper::DidFinishNavigation(
prerender_manager->RecordNavigation(navigation_handle->GetURL()); prerender_manager->RecordNavigation(navigation_handle->GetURL());
} }
WEB_CONTENTS_USER_DATA_KEY_IMPL(PrerenderTabHelper) WEB_CONTENTS_USER_DATA_KEY_IMPL(NoStatePrefetchTabHelper)
} // namespace prerender } // namespace prerender
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef CHROME_BROWSER_PREFETCH_NO_STATE_PREFETCH_PRERENDER_TAB_HELPER_H_ #ifndef CHROME_BROWSER_PREFETCH_NO_STATE_PREFETCH_NO_STATE_PREFETCH_TAB_HELPER_H_
#define CHROME_BROWSER_PREFETCH_NO_STATE_PREFETCH_PRERENDER_TAB_HELPER_H_ #define CHROME_BROWSER_PREFETCH_NO_STATE_PREFETCH_NO_STATE_PREFETCH_TAB_HELPER_H_
#include "base/macros.h" #include "base/macros.h"
#include "content/public/browser/web_contents_observer.h" #include "content/public/browser/web_contents_observer.h"
...@@ -13,27 +13,27 @@ namespace prerender { ...@@ -13,27 +13,27 @@ namespace prerender {
class PrerenderManager; class PrerenderManager;
// Notifies the PrerenderManager with the events happening in the prerendered // Notifies the PrerenderManager with the events happening in the WebContents
// WebContents. // for NoStatePrefetch.
class PrerenderTabHelper class NoStatePrefetchTabHelper
: public content::WebContentsObserver, : public content::WebContentsObserver,
public content::WebContentsUserData<PrerenderTabHelper> { public content::WebContentsUserData<NoStatePrefetchTabHelper> {
public: public:
~PrerenderTabHelper() override; ~NoStatePrefetchTabHelper() override;
PrerenderTabHelper(const PrerenderTabHelper&) = delete; NoStatePrefetchTabHelper(const NoStatePrefetchTabHelper&) = delete;
PrerenderTabHelper& operator=(const PrerenderTabHelper&) = delete; NoStatePrefetchTabHelper& operator=(const NoStatePrefetchTabHelper&) = delete;
// content::WebContentsObserver implementation. // content::WebContentsObserver implementation.
void DidFinishNavigation( void DidFinishNavigation(
content::NavigationHandle* navigation_handle) override; content::NavigationHandle* navigation_handle) override;
private: private:
explicit PrerenderTabHelper(content::WebContents* web_contents); explicit NoStatePrefetchTabHelper(content::WebContents* web_contents);
friend class content::WebContentsUserData<PrerenderTabHelper>; friend class content::WebContentsUserData<NoStatePrefetchTabHelper>;
WEB_CONTENTS_USER_DATA_KEY_DECL(); WEB_CONTENTS_USER_DATA_KEY_DECL();
}; };
} // namespace prerender } // namespace prerender
#endif // CHROME_BROWSER_PREFETCH_NO_STATE_PREFETCH_PRERENDER_TAB_HELPER_H_ #endif // CHROME_BROWSER_PREFETCH_NO_STATE_PREFETCH_NO_STATE_PREFETCH_TAB_HELPER_H_
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
#include "chrome/browser/plugins/pdf_plugin_placeholder_observer.h" #include "chrome/browser/plugins/pdf_plugin_placeholder_observer.h"
#include "chrome/browser/predictors/loading_predictor_factory.h" #include "chrome/browser/predictors/loading_predictor_factory.h"
#include "chrome/browser/predictors/loading_predictor_tab_helper.h" #include "chrome/browser/predictors/loading_predictor_tab_helper.h"
#include "chrome/browser/prefetch/no_state_prefetch/prerender_tab_helper.h" #include "chrome/browser/prefetch/no_state_prefetch/no_state_prefetch_tab_helper.h"
#include "chrome/browser/prefetch/prefetch_proxy/prefetch_proxy_tab_helper.h" #include "chrome/browser/prefetch/prefetch_proxy/prefetch_proxy_tab_helper.h"
#include "chrome/browser/previews/previews_ui_tab_helper.h" #include "chrome/browser/previews/previews_ui_tab_helper.h"
#include "chrome/browser/previews/resource_loading_hints/resource_loading_hints_web_contents_observer.h" #include "chrome/browser/previews/resource_loading_hints/resource_loading_hints_web_contents_observer.h"
...@@ -297,7 +297,7 @@ void TabHelpers::AttachTabHelpers(WebContents* web_contents) { ...@@ -297,7 +297,7 @@ void TabHelpers::AttachTabHelpers(WebContents* web_contents) {
if (predictors::LoadingPredictorFactory::GetForProfile(profile)) if (predictors::LoadingPredictorFactory::GetForProfile(profile))
predictors::LoadingPredictorTabHelper::CreateForWebContents(web_contents); predictors::LoadingPredictorTabHelper::CreateForWebContents(web_contents);
PrefsTabHelper::CreateForWebContents(web_contents); PrefsTabHelper::CreateForWebContents(web_contents);
prerender::PrerenderTabHelper::CreateForWebContents(web_contents); prerender::NoStatePrefetchTabHelper::CreateForWebContents(web_contents);
PreviewsUITabHelper::CreateForWebContents(web_contents); PreviewsUITabHelper::CreateForWebContents(web_contents);
RecentlyAudibleHelper::CreateForWebContents(web_contents); RecentlyAudibleHelper::CreateForWebContents(web_contents);
// TODO(siggi): Remove this once the Resource Coordinator refactoring is done. // TODO(siggi): Remove this once the Resource Coordinator refactoring is done.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment