OLD | NEW |
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 <deque> | 5 #include <deque> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 1066 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1077 // or the channel for the renderer process is closed on the IO thread. In the | 1077 // or the channel for the renderer process is closed on the IO thread. In the |
1078 // last case, the code must be careful to wait for the channel to close, as it | 1078 // last case, the code must be careful to wait for the channel to close, as it |
1079 // is done asynchronously after swapping out the old process. See | 1079 // is done asynchronously after swapping out the old process. See |
1080 // ChannelDestructionWatcher. | 1080 // ChannelDestructionWatcher. |
1081 bool IsEmptyPrerenderLinkManager() const { | 1081 bool IsEmptyPrerenderLinkManager() const { |
1082 return GetPrerenderLinkManager()->IsEmpty(); | 1082 return GetPrerenderLinkManager()->IsEmpty(); |
1083 } | 1083 } |
1084 | 1084 |
1085 // Returns length of |prerender_manager_|'s history, or -1 on failure. | 1085 // Returns length of |prerender_manager_|'s history, or -1 on failure. |
1086 int GetHistoryLength() const { | 1086 int GetHistoryLength() const { |
1087 scoped_ptr<DictionaryValue> prerender_dict( | 1087 scoped_ptr<base::DictionaryValue> prerender_dict( |
1088 static_cast<DictionaryValue*>(GetPrerenderManager()->GetAsValue())); | 1088 static_cast<base::DictionaryValue*>( |
| 1089 GetPrerenderManager()->GetAsValue())); |
1089 if (!prerender_dict.get()) | 1090 if (!prerender_dict.get()) |
1090 return -1; | 1091 return -1; |
1091 ListValue* history_list; | 1092 base::ListValue* history_list; |
1092 if (!prerender_dict->GetList("history", &history_list)) | 1093 if (!prerender_dict->GetList("history", &history_list)) |
1093 return -1; | 1094 return -1; |
1094 return static_cast<int>(history_list->GetSize()); | 1095 return static_cast<int>(history_list->GetSize()); |
1095 } | 1096 } |
1096 | 1097 |
1097 #if defined(FULL_SAFE_BROWSING) | 1098 #if defined(FULL_SAFE_BROWSING) |
1098 FakeSafeBrowsingDatabaseManager* GetFakeSafeBrowsingDatabaseManager() { | 1099 FakeSafeBrowsingDatabaseManager* GetFakeSafeBrowsingDatabaseManager() { |
1099 return safe_browsing_factory_->most_recent_service()-> | 1100 return safe_browsing_factory_->most_recent_service()-> |
1100 fake_database_manager(); | 1101 fake_database_manager(); |
1101 } | 1102 } |
(...skipping 2257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3359 const NavigationController& controller = web_contents->GetController(); | 3360 const NavigationController& controller = web_contents->GetController(); |
3360 // First entry is about:blank, second is prerender_page.html. | 3361 // First entry is about:blank, second is prerender_page.html. |
3361 EXPECT_TRUE(controller.GetPendingEntry() == NULL); | 3362 EXPECT_TRUE(controller.GetPendingEntry() == NULL); |
3362 EXPECT_EQ(2, controller.GetEntryCount()); | 3363 EXPECT_EQ(2, controller.GetEntryCount()); |
3363 EXPECT_EQ(GURL(content::kAboutBlankURL), | 3364 EXPECT_EQ(GURL(content::kAboutBlankURL), |
3364 controller.GetEntryAtIndex(0)->GetURL()); | 3365 controller.GetEntryAtIndex(0)->GetURL()); |
3365 EXPECT_EQ(dest_url(), controller.GetEntryAtIndex(1)->GetURL()); | 3366 EXPECT_EQ(dest_url(), controller.GetEntryAtIndex(1)->GetURL()); |
3366 } | 3367 } |
3367 | 3368 |
3368 } // namespace prerender | 3369 } // namespace prerender |
OLD | NEW |