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

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

Issue 949443002: Upstream ChromeTab.hasPrerenderedUrl to Tab (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « chrome/browser/android/tab_android.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 746 matching lines...) Expand 10 before | Expand all | Expand 10 after
757 // Return the first node matching the search criteria. 757 // Return the first node matching the search criteria.
758 for (size_t i = 0; i < nodes.size(); ++i) { 758 for (size_t i = 0; i < nodes.size(); ++i) {
759 if (only_editable && !client->CanBeEditedByUser(nodes[i])) 759 if (only_editable && !client->CanBeEditedByUser(nodes[i]))
760 continue; 760 continue;
761 return nodes[i]->id(); 761 return nodes[i]->id();
762 } 762 }
763 763
764 return -1; 764 return -1;
765 } 765 }
766 766
767 bool TabAndroid::HasPrerenderedUrl(JNIEnv* env, jobject obj, jstring url) {
768 GURL gurl(base::android::ConvertJavaStringToUTF8(env, url));
769 return HasPrerenderedUrl(gurl);
770 }
771
767 namespace { 772 namespace {
768 773
769 class ChromeInterceptNavigationDelegate : public InterceptNavigationDelegate { 774 class ChromeInterceptNavigationDelegate : public InterceptNavigationDelegate {
770 public: 775 public:
771 ChromeInterceptNavigationDelegate(JNIEnv* env, jobject jdelegate) 776 ChromeInterceptNavigationDelegate(JNIEnv* env, jobject jdelegate)
772 : InterceptNavigationDelegate(env, jdelegate) {} 777 : InterceptNavigationDelegate(env, jdelegate) {}
773 778
774 bool ShouldIgnoreNavigation( 779 bool ShouldIgnoreNavigation(
775 const NavigationParams& navigation_params) override { 780 const NavigationParams& navigation_params) override {
776 NavigationParams chrome_navigation_params(navigation_params); 781 NavigationParams chrome_navigation_params(navigation_params);
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
849 // s^{n+1} / s^{n} = 2100 / 2000 854 // s^{n+1} / s^{n} = 2100 / 2000
850 // s = 1.05 855 // s = 1.05
851 // s^b = 60000 856 // s^b = 60000
852 // b = ln(60000) / ln(1.05) ~= 225 857 // b = ln(60000) / ln(1.05) ~= 225
853 UMA_HISTOGRAM_CUSTOM_TIMES("Startup.FirstCommitNavigationTime", 858 UMA_HISTOGRAM_CUSTOM_TIMES("Startup.FirstCommitNavigationTime",
854 base::Time::Now() - chrome::android::GetMainEntryPointTime(), 859 base::Time::Now() - chrome::android::GetMainEntryPointTime(),
855 base::TimeDelta::FromMilliseconds(1), 860 base::TimeDelta::FromMilliseconds(1),
856 base::TimeDelta::FromMinutes(1), 861 base::TimeDelta::FromMinutes(1),
857 225); 862 225);
858 } 863 }
OLDNEW
« no previous file with comments | « chrome/browser/android/tab_android.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698