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

Unified Diff: chrome/browser/android/web_contents_factory.cc

Issue 1432143002: Track where WebContents are created in order to better understand issue. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
Index: chrome/browser/android/web_contents_factory.cc
diff --git a/chrome/browser/android/web_contents_factory.cc b/chrome/browser/android/web_contents_factory.cc
index 605c5abf114b79e0a571761f14e6e5601cf64b96..80c4a816fa655c66947ea3af32c3cd04e51d6545 100644
--- a/chrome/browser/android/web_contents_factory.cc
+++ b/chrome/browser/android/web_contents_factory.cc
@@ -10,6 +10,7 @@
#include "chrome/browser/profiles/profile_manager.h"
#include "content/public/browser/android/content_view_core.h"
#include "content/public/browser/web_contents.h"
+#include "content/public/browser/web_contents_source.h"
#include "jni/WebContentsFactory_jni.h"
static ScopedJavaLocalRef<jobject> CreateWebContents(
@@ -23,7 +24,9 @@ static ScopedJavaLocalRef<jobject> CreateWebContents(
content::WebContents::CreateParams params(profile);
params.initially_hidden = static_cast<bool>(initially_hidden);
- return content::WebContents::Create(params)->GetJavaWebContents();
+ content::WebContents* web_contents = content::WebContents::Create(params);
+ WebContentsSource::CreateForWebContentsAndLocation(web_contents, FROM_HERE);
+ return web_contents->GetJavaWebContents();
}
bool RegisterWebContentsFactory(JNIEnv* env) {

Powered by Google App Engine
This is Rietveld 408576698