| 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 #include <iterator> | 8 #include <iterator> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 FROM_HERE, | 97 FROM_HERE, |
| 98 base::Bind(callback_, std::set<std::string>())); | 98 base::Bind(callback_, std::set<std::string>())); |
| 99 return; | 99 return; |
| 100 } | 100 } |
| 101 // Something might be blacklisted, response will come in | 101 // Something might be blacklisted, response will come in |
| 102 // OnCheckExtensionsResult. | 102 // OnCheckExtensionsResult. |
| 103 AddRef(); // Balanced in OnCheckExtensionsResult | 103 AddRef(); // Balanced in OnCheckExtensionsResult |
| 104 } | 104 } |
| 105 | 105 |
| 106 virtual void OnCheckExtensionsResult( | 106 virtual void OnCheckExtensionsResult( |
| 107 const std::set<std::string>& hits) OVERRIDE { | 107 const std::set<std::string>& hits) override { |
| 108 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 108 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 109 callback_message_loop_->PostTask(FROM_HERE, base::Bind(callback_, hits)); | 109 callback_message_loop_->PostTask(FROM_HERE, base::Bind(callback_, hits)); |
| 110 Release(); // Balanced in StartCheck. | 110 Release(); // Balanced in StartCheck. |
| 111 } | 111 } |
| 112 | 112 |
| 113 scoped_refptr<base::MessageLoopProxy> callback_message_loop_; | 113 scoped_refptr<base::MessageLoopProxy> callback_message_loop_; |
| 114 OnResultCallback callback_; | 114 OnResultCallback callback_; |
| 115 | 115 |
| 116 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingClientImpl); | 116 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingClientImpl); |
| 117 }; | 117 }; |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 } | 343 } |
| 344 | 344 |
| 345 void Blacklist::Observe(int type, | 345 void Blacklist::Observe(int type, |
| 346 const content::NotificationSource& source, | 346 const content::NotificationSource& source, |
| 347 const content::NotificationDetails& details) { | 347 const content::NotificationDetails& details) { |
| 348 DCHECK_EQ(chrome::NOTIFICATION_SAFE_BROWSING_UPDATE_COMPLETE, type); | 348 DCHECK_EQ(chrome::NOTIFICATION_SAFE_BROWSING_UPDATE_COMPLETE, type); |
| 349 FOR_EACH_OBSERVER(Observer, observers_, OnBlacklistUpdated()); | 349 FOR_EACH_OBSERVER(Observer, observers_, OnBlacklistUpdated()); |
| 350 } | 350 } |
| 351 | 351 |
| 352 } // namespace extensions | 352 } // namespace extensions |
| OLD | NEW |