| 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 "chrome/browser/prerender/prerender_manager.h" | 5 #include "chrome/browser/prerender/prerender_manager.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 #include "content/public/browser/notification_observer.h" | 42 #include "content/public/browser/notification_observer.h" |
| 43 #include "content/public/browser/notification_registrar.h" | 43 #include "content/public/browser/notification_registrar.h" |
| 44 #include "content/public/browser/notification_source.h" | 44 #include "content/public/browser/notification_source.h" |
| 45 #include "content/public/browser/render_process_host.h" | 45 #include "content/public/browser/render_process_host.h" |
| 46 #include "content/public/browser/render_view_host.h" | 46 #include "content/public/browser/render_view_host.h" |
| 47 #include "content/public/browser/session_storage_namespace.h" | 47 #include "content/public/browser/session_storage_namespace.h" |
| 48 #include "content/public/browser/web_contents.h" | 48 #include "content/public/browser/web_contents.h" |
| 49 #include "content/public/browser/web_contents_delegate.h" | 49 #include "content/public/browser/web_contents_delegate.h" |
| 50 | 50 |
| 51 using content::BrowserThread; | 51 using content::BrowserThread; |
| 52 using content::RenderViewHost; |
| 52 using content::SessionStorageNamespace; | 53 using content::SessionStorageNamespace; |
| 53 using content::WebContents; | 54 using content::WebContents; |
| 54 | 55 |
| 55 namespace prerender { | 56 namespace prerender { |
| 56 | 57 |
| 57 namespace { | 58 namespace { |
| 58 | 59 |
| 59 // Time window for which we will record windowed PLT's from the last | 60 // Time window for which we will record windowed PLT's from the last |
| 60 // observed link rel=prefetch tag. | 61 // observed link rel=prefetch tag. |
| 61 const int kWindowDurationSeconds = 30; | 62 const int kWindowDurationSeconds = 30; |
| (...skipping 1138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1200 if (!render_process_host || !render_process_host->GetBrowserContext()) | 1201 if (!render_process_host || !render_process_host->GetBrowserContext()) |
| 1201 return NULL; | 1202 return NULL; |
| 1202 Profile* profile = Profile::FromBrowserContext( | 1203 Profile* profile = Profile::FromBrowserContext( |
| 1203 render_process_host->GetBrowserContext()); | 1204 render_process_host->GetBrowserContext()); |
| 1204 if (!profile) | 1205 if (!profile) |
| 1205 return NULL; | 1206 return NULL; |
| 1206 return PrerenderManagerFactory::GetInstance()->GetForProfile(profile); | 1207 return PrerenderManagerFactory::GetInstance()->GetForProfile(profile); |
| 1207 } | 1208 } |
| 1208 | 1209 |
| 1209 } // namespace prerender | 1210 } // namespace prerender |
| OLD | NEW |