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

Side by Side Diff: chrome/browser/android/tab_android.cc

Issue 1122393003: CC: Plumb LayerSettings parameter for cc::Layer construction. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 7 months 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/android/tab_android.h" 5 #include "chrome/browser/android/tab_android.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_array.h" 8 #include "base/android/jni_array.h"
9 #include "base/android/jni_string.h" 9 #include "base/android/jni_string.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 #include "chrome/common/url_constants.h" 50 #include "chrome/common/url_constants.h"
51 #include "components/bookmarks/browser/bookmark_model.h" 51 #include "components/bookmarks/browser/bookmark_model.h"
52 #include "components/bookmarks/browser/bookmark_node.h" 52 #include "components/bookmarks/browser/bookmark_node.h"
53 #include "components/bookmarks/browser/bookmark_utils.h" 53 #include "components/bookmarks/browser/bookmark_utils.h"
54 #include "components/dom_distiller/core/url_utils.h" 54 #include "components/dom_distiller/core/url_utils.h"
55 #include "components/favicon/content/content_favicon_driver.h" 55 #include "components/favicon/content/content_favicon_driver.h"
56 #include "components/infobars/core/infobar_container.h" 56 #include "components/infobars/core/infobar_container.h"
57 #include "components/navigation_interception/intercept_navigation_delegate.h" 57 #include "components/navigation_interception/intercept_navigation_delegate.h"
58 #include "components/navigation_interception/navigation_params.h" 58 #include "components/navigation_interception/navigation_params.h"
59 #include "components/url_fixer/url_fixer.h" 59 #include "components/url_fixer/url_fixer.h"
60 #include "content/public/browser/android/compositor.h"
60 #include "content/public/browser/android/content_view_core.h" 61 #include "content/public/browser/android/content_view_core.h"
61 #include "content/public/browser/browser_thread.h" 62 #include "content/public/browser/browser_thread.h"
62 #include "content/public/browser/interstitial_page.h" 63 #include "content/public/browser/interstitial_page.h"
63 #include "content/public/browser/navigation_entry.h" 64 #include "content/public/browser/navigation_entry.h"
64 #include "content/public/browser/notification_service.h" 65 #include "content/public/browser/notification_service.h"
65 #include "content/public/browser/render_frame_host.h" 66 #include "content/public/browser/render_frame_host.h"
66 #include "content/public/browser/render_process_host.h" 67 #include "content/public/browser/render_process_host.h"
67 #include "content/public/browser/render_view_host.h" 68 #include "content/public/browser/render_view_host.h"
68 #include "content/public/browser/user_metrics.h" 69 #include "content/public/browser/user_metrics.h"
69 #include "content/public/browser/web_contents.h" 70 #include "content/public/browser/web_contents.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 } 115 }
115 116
116 void TabAndroid::AttachTabHelpers(content::WebContents* web_contents) { 117 void TabAndroid::AttachTabHelpers(content::WebContents* web_contents) {
117 DCHECK(web_contents); 118 DCHECK(web_contents);
118 119
119 TabHelpers::AttachTabHelpers(web_contents); 120 TabHelpers::AttachTabHelpers(web_contents);
120 } 121 }
121 122
122 TabAndroid::TabAndroid(JNIEnv* env, jobject obj) 123 TabAndroid::TabAndroid(JNIEnv* env, jobject obj)
123 : weak_java_tab_(env, obj), 124 : weak_java_tab_(env, obj),
124 content_layer_(cc::Layer::Create()), 125 content_layer_(cc::Layer::Create(content::Compositor::LayerSettings())),
125 tab_content_manager_(NULL), 126 tab_content_manager_(NULL),
126 synced_tab_delegate_(new browser_sync::SyncedTabDelegateAndroid(this)) { 127 synced_tab_delegate_(new browser_sync::SyncedTabDelegateAndroid(this)) {
127 Java_Tab_setNativePtr(env, obj, reinterpret_cast<intptr_t>(this)); 128 Java_Tab_setNativePtr(env, obj, reinterpret_cast<intptr_t>(this));
128 } 129 }
129 130
130 TabAndroid::~TabAndroid() { 131 TabAndroid::~TabAndroid() {
131 GetContentLayer()->RemoveAllChildren(); 132 GetContentLayer()->RemoveAllChildren();
132 JNIEnv* env = base::android::AttachCurrentThread(); 133 JNIEnv* env = base::android::AttachCurrentThread();
133 Java_Tab_clearNativePtr(env, weak_java_tab_.get(env).obj()); 134 Java_Tab_clearNativePtr(env, weak_java_tab_.get(env).obj());
134 } 135 }
(...skipping 751 matching lines...) Expand 10 before | Expand all | Expand 10 after
886 // s^{n+1} / s^{n} = 2100 / 2000 887 // s^{n+1} / s^{n} = 2100 / 2000
887 // s = 1.05 888 // s = 1.05
888 // s^b = 60000 889 // s^b = 60000
889 // b = ln(60000) / ln(1.05) ~= 225 890 // b = ln(60000) / ln(1.05) ~= 225
890 UMA_HISTOGRAM_CUSTOM_TIMES("Startup.FirstCommitNavigationTime", 891 UMA_HISTOGRAM_CUSTOM_TIMES("Startup.FirstCommitNavigationTime",
891 base::Time::Now() - chrome::android::GetMainEntryPointTime(), 892 base::Time::Now() - chrome::android::GetMainEntryPointTime(),
892 base::TimeDelta::FromMilliseconds(1), 893 base::TimeDelta::FromMilliseconds(1),
893 base::TimeDelta::FromMinutes(1), 894 base::TimeDelta::FromMinutes(1),
894 225); 895 225);
895 } 896 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698