| 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_message_filter.h" | 5 #include "chrome/browser/prerender/prerender_message_filter.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/memory/singleton.h" | 8 #include "base/memory/singleton.h" |
| 9 #include "chrome/browser/prerender/prerender_link_manager.h" | 9 #include "chrome/browser/prerender/prerender_link_manager.h" |
| 10 #include "chrome/browser/prerender/prerender_link_manager_factory.h" | 10 #include "chrome/browser/prerender/prerender_link_manager_factory.h" |
| 11 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
| 12 #include "chrome/common/prerender_messages.h" | 12 #include "chrome/common/prerender_messages.h" |
| 13 #include "components/keyed_service/content/browser_context_keyed_service_shutdow
n_notifier_factory.h" | 13 #include "components/keyed_service/content/browser_context_keyed_service_shutdow
n_notifier_factory.h" |
| 14 #include "content/public/browser/browser_thread.h" | 14 #include "content/public/browser/browser_thread.h" |
| 15 | 15 |
| 16 using content::BrowserThread; | 16 using content::BrowserThread; |
| 17 | 17 |
| 18 namespace prerender { | 18 namespace prerender { |
| 19 | 19 |
| 20 namespace { | 20 namespace { |
| 21 | 21 |
| 22 class ShutdownNotifierFactory | 22 class ShutdownNotifierFactory |
| 23 : public BrowserContextKeyedServiceShutdownNotifierFactory { | 23 : public BrowserContextKeyedServiceShutdownNotifierFactory { |
| 24 public: | 24 public: |
| 25 static ShutdownNotifierFactory* GetInstance() { | 25 static ShutdownNotifierFactory* GetInstance() { |
| 26 return Singleton<ShutdownNotifierFactory>::get(); | 26 return base::Singleton<ShutdownNotifierFactory>::get(); |
| 27 } | 27 } |
| 28 | 28 |
| 29 private: | 29 private: |
| 30 friend struct DefaultSingletonTraits<ShutdownNotifierFactory>; | 30 friend struct base::DefaultSingletonTraits<ShutdownNotifierFactory>; |
| 31 | 31 |
| 32 ShutdownNotifierFactory() | 32 ShutdownNotifierFactory() |
| 33 : BrowserContextKeyedServiceShutdownNotifierFactory( | 33 : BrowserContextKeyedServiceShutdownNotifierFactory( |
| 34 "PrerenderMessageFilter") { | 34 "PrerenderMessageFilter") { |
| 35 DependsOn(PrerenderLinkManagerFactory::GetInstance()); | 35 DependsOn(PrerenderLinkManagerFactory::GetInstance()); |
| 36 } | 36 } |
| 37 ~ShutdownNotifierFactory() override {} | 37 ~ShutdownNotifierFactory() override {} |
| 38 | 38 |
| 39 DISALLOW_COPY_AND_ASSIGN(ShutdownNotifierFactory); | 39 DISALLOW_COPY_AND_ASSIGN(ShutdownNotifierFactory); |
| 40 }; | 40 }; |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 | 128 |
| 129 void PrerenderMessageFilter::OnChannelClosingInUIThread() { | 129 void PrerenderMessageFilter::OnChannelClosingInUIThread() { |
| 130 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 130 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 131 if (!prerender_link_manager_) | 131 if (!prerender_link_manager_) |
| 132 return; | 132 return; |
| 133 prerender_link_manager_->OnChannelClosing(render_process_id_); | 133 prerender_link_manager_->OnChannelClosing(render_process_id_); |
| 134 } | 134 } |
| 135 | 135 |
| 136 } // namespace prerender | 136 } // namespace prerender |
| 137 | 137 |
| OLD | NEW |