| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/extensions/blacklist.h" | 5 #include "chrome/browser/extensions/blacklist.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 callback_message_loop_->PostTask( | 92 callback_message_loop_->PostTask( |
| 93 FROM_HERE, | 93 FROM_HERE, |
| 94 base::Bind(callback_, std::set<std::string>())); | 94 base::Bind(callback_, std::set<std::string>())); |
| 95 return; | 95 return; |
| 96 } | 96 } |
| 97 // Something might be blacklisted, response will come in | 97 // Something might be blacklisted, response will come in |
| 98 // OnCheckExtensionsResult. | 98 // OnCheckExtensionsResult. |
| 99 AddRef(); // Balanced in OnCheckExtensionsResult | 99 AddRef(); // Balanced in OnCheckExtensionsResult |
| 100 } | 100 } |
| 101 | 101 |
| 102 void OnCheckExtensionsResult(const std::set<std::string>& hits) { | 102 virtual void OnCheckExtensionsResult( |
| 103 const std::set<std::string>& hits) OVERRIDE { |
| 103 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 104 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 104 callback_message_loop_->PostTask(FROM_HERE, base::Bind(callback_, hits)); | 105 callback_message_loop_->PostTask(FROM_HERE, base::Bind(callback_, hits)); |
| 105 Release(); // Balanced in StartCheck. | 106 Release(); // Balanced in StartCheck. |
| 106 } | 107 } |
| 107 | 108 |
| 108 scoped_refptr<base::MessageLoopProxy> callback_message_loop_; | 109 scoped_refptr<base::MessageLoopProxy> callback_message_loop_; |
| 109 OnResultCallback callback_; | 110 OnResultCallback callback_; |
| 110 | 111 |
| 111 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingClientImpl); | 112 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingClientImpl); |
| 112 }; | 113 }; |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 } | 258 } |
| 258 | 259 |
| 259 void Blacklist::Observe(int type, | 260 void Blacklist::Observe(int type, |
| 260 const content::NotificationSource& source, | 261 const content::NotificationSource& source, |
| 261 const content::NotificationDetails& details) { | 262 const content::NotificationDetails& details) { |
| 262 DCHECK_EQ(chrome::NOTIFICATION_SAFE_BROWSING_UPDATE_COMPLETE, type); | 263 DCHECK_EQ(chrome::NOTIFICATION_SAFE_BROWSING_UPDATE_COMPLETE, type); |
| 263 FOR_EACH_OBSERVER(Observer, observers_, OnBlacklistUpdated()); | 264 FOR_EACH_OBSERVER(Observer, observers_, OnBlacklistUpdated()); |
| 264 } | 265 } |
| 265 | 266 |
| 266 } // namespace extensions | 267 } // namespace extensions |
| OLD | NEW |