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

Side by Side Diff: chrome/browser/prerender/prerender_browsertest.cc

Issue 2893653002: Rename Ownership Transferring Methods for Prerenderer (Closed)
Patch Set: Created 3 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 <stddef.h> 5 #include <stddef.h>
6 #include <deque> 6 #include <deque>
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 #include <unordered_map> 9 #include <unordered_map>
10 #include <utility> 10 #include <utility>
(...skipping 814 matching lines...) Expand 10 before | Expand all | Expand 10 after
825 return GetPrerenderLinkManager()->prerenders_.size(); 825 return GetPrerenderLinkManager()->prerenders_.size();
826 } 826 }
827 827
828 size_t GetRunningLinkPrerenderCount() const { 828 size_t GetRunningLinkPrerenderCount() const {
829 return GetPrerenderLinkManager()->CountRunningPrerenders(); 829 return GetPrerenderLinkManager()->CountRunningPrerenders();
830 } 830 }
831 831
832 // Returns length of |prerender_manager_|'s history, or SIZE_MAX on failure. 832 // Returns length of |prerender_manager_|'s history, or SIZE_MAX on failure.
833 size_t GetHistoryLength() const { 833 size_t GetHistoryLength() const {
834 std::unique_ptr<base::DictionaryValue> prerender_dict = 834 std::unique_ptr<base::DictionaryValue> prerender_dict =
835 GetPrerenderManager()->GetAsValue(); 835 GetPrerenderManager()->CopyAsValue();
836 if (!prerender_dict) 836 if (!prerender_dict)
837 return std::numeric_limits<size_t>::max(); 837 return std::numeric_limits<size_t>::max();
838 base::ListValue* history_list; 838 base::ListValue* history_list;
839 if (!prerender_dict->GetList("history", &history_list)) 839 if (!prerender_dict->GetList("history", &history_list))
840 return std::numeric_limits<size_t>::max(); 840 return std::numeric_limits<size_t>::max();
841 return history_list->GetSize(); 841 return history_list->GetSize();
842 } 842 }
843 843
844 void SetLoaderHostOverride(const std::string& host) { 844 void SetLoaderHostOverride(const std::string& host) {
845 loader_host_override_ = host; 845 loader_host_override_ = host;
(...skipping 3082 matching lines...) Expand 10 before | Expand all | Expand 10 after
3928 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(web_contents, 3928 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(web_contents,
3929 "DidDisplayReallyPass()", 3929 "DidDisplayReallyPass()",
3930 &display_test_result)); 3930 &display_test_result));
3931 ASSERT_TRUE(display_test_result); 3931 ASSERT_TRUE(display_test_result);
3932 } 3932 }
3933 #endif // !defined(DISABLE_NACL) 3933 #endif // !defined(DISABLE_NACL)
3934 3934
3935 } // namespace prerender 3935 } // namespace prerender
3936 3936
3937 #endif // !defined(OS_MACOSX) || !defined(ADDRESS_SANITIZER) 3937 #endif // !defined(OS_MACOSX) || !defined(ADDRESS_SANITIZER)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698