Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1226)

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 803873004: ContentBrowserSanityChecker (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add semicolon. Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | content/content_tests.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/web_contents_impl.cc
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 7151e151eebee9326e8a68b38424373b94d39aa1..41a767e7da3fe91aac8fa5579ed60d5240b79bb7 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -222,11 +222,13 @@ WebContents* WebContents::CreateWithSessionStorage(
return new_contents;
}
-void WebContentsImpl::AddCreatedCallback(const CreatedCallback& callback) {
+void WebContentsImpl::FriendZone::AddCreatedCallbackForTesting(
+ const CreatedCallback& callback) {
g_created_callbacks.Get().push_back(callback);
}
-void WebContentsImpl::RemoveCreatedCallback(const CreatedCallback& callback) {
+void WebContentsImpl::FriendZone::RemoveCreatedCallbackForTesting(
+ const CreatedCallback& callback) {
for (size_t i = 0; i < g_created_callbacks.Get().size(); ++i) {
if (g_created_callbacks.Get().at(i).Equals(callback)) {
g_created_callbacks.Get().erase(g_created_callbacks.Get().begin() + i);
@@ -333,8 +335,6 @@ WebContentsImpl::WebContentsImpl(BrowserContext* browser_context,
audio_stream_monitor_(this),
virtual_keyboard_requested_(false),
loading_weak_factory_(this) {
- for (size_t i = 0; i < g_created_callbacks.Get().size(); i++)
- g_created_callbacks.Get().at(i).Run(this);
frame_tree_.SetFrameRemoveListener(
base::Bind(&WebContentsImpl::OnFrameRemoved,
base::Unretained(this)));
@@ -1206,6 +1206,9 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
// a RenderWidgetHostViewGuest. That is, |view_->CreateView| above.
if (browser_plugin_guest_)
browser_plugin_guest_->Init();
+
+ for (size_t i = 0; i < g_created_callbacks.Get().size(); i++)
+ g_created_callbacks.Get().at(i).Run(this);
}
void WebContentsImpl::OnWebContentsDestroyed(WebContentsImpl* web_contents) {
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | content/content_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698