Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(163)

Side by Side Diff: chrome/browser/extensions/requirements_checker.cc

Issue 216513002: Replace DCHECK(BrowserThread::CurrentlyOn) with DCHECK_CURRENTLY_ON in extensions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/extensions/requirements_checker.h" 5 #include "chrome/browser/extensions/requirements_checker.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/browser/gpu/gpu_feature_checker.h" 9 #include "chrome/browser/gpu/gpu_feature_checker.h"
10 #include "content/public/browser/browser_thread.h" 10 #include "content/public/browser/browser_thread.h"
(...skipping 12 matching lines...) Expand all
23 23
24 RequirementsChecker::RequirementsChecker() 24 RequirementsChecker::RequirementsChecker()
25 : pending_requirement_checks_(0) { 25 : pending_requirement_checks_(0) {
26 } 26 }
27 27
28 RequirementsChecker::~RequirementsChecker() { 28 RequirementsChecker::~RequirementsChecker() {
29 } 29 }
30 30
31 void RequirementsChecker::Check(scoped_refptr<const Extension> extension, 31 void RequirementsChecker::Check(scoped_refptr<const Extension> extension,
32 base::Callback<void(std::vector<std::string> errors)> callback) { 32 base::Callback<void(std::vector<std::string> errors)> callback) {
33 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); 33 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
34 34
35 callback_ = callback; 35 callback_ = callback;
36 const RequirementsInfo& requirements = 36 const RequirementsInfo& requirements =
37 RequirementsInfo::GetRequirements(extension.get()); 37 RequirementsInfo::GetRequirements(extension.get());
38 38
39 if (requirements.npapi) { 39 if (requirements.npapi) {
40 #if defined(OS_CHROMEOS) 40 #if defined(OS_CHROMEOS)
41 errors_.push_back( 41 errors_.push_back(
42 l10n_util::GetStringUTF8(IDS_EXTENSION_NPAPI_NOT_SUPPORTED)); 42 l10n_util::GetStringUTF8(IDS_EXTENSION_NPAPI_NOT_SUPPORTED));
43 #endif // defined(OS_CHROMEOS) 43 #endif // defined(OS_CHROMEOS)
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 if (--pending_requirement_checks_ == 0) { 107 if (--pending_requirement_checks_ == 0) {
108 content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, 108 content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE,
109 base::Bind(callback_, errors_)); 109 base::Bind(callback_, errors_));
110 // Reset the callback so any ref-counted bound parameters will get released. 110 // Reset the callback so any ref-counted bound parameters will get released.
111 callback_.Reset(); 111 callback_.Reset();
112 errors_.clear(); 112 errors_.clear();
113 } 113 }
114 } 114 }
115 115
116 } // namespace extensions 116 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/image_loader.cc ('k') | chrome/browser/extensions/signin/gaia_auth_extension_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698