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

Side by Side Diff: chrome/common/mac/cfbundle_blocker.mm

Issue 8477018: Pull back some CHECK calls which were removed. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: comment tweak Created 9 years, 1 month 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
« no previous file with comments | « chrome/common/important_file_writer.cc ('k') | chrome/common/multi_process_lock_linux.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/common/mac/cfbundle_blocker.h" 5 #include "chrome/common/mac/cfbundle_blocker.h"
6 6
7 #include <CoreFoundation/CoreFoundation.h> 7 #include <CoreFoundation/CoreFoundation.h>
8 #import <Foundation/Foundation.h> 8 #import <Foundation/Foundation.h>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 base::mac::CFToNSCast(kCFBundleVersionKey)]; 168 base::mac::CFToNSCast(kCFBundleVersionKey)];
169 if (![version isKindOfClass:[NSString class]]) { 169 if (![version isKindOfClass:[NSString class]]) {
170 // Deal with pranksters. 170 // Deal with pranksters.
171 version = nil; 171 version = nil;
172 } 172 }
173 173
174 if (IsBundlePathBlocked(path) && !IsBundleAllowed(bundle_id, version)) { 174 if (IsBundlePathBlocked(path) && !IsBundleAllowed(bundle_id, version)) {
175 NSString* bundle_id_print = bundle_id ? bundle_id : @"(nil)"; 175 NSString* bundle_id_print = bundle_id ? bundle_id : @"(nil)";
176 NSString* version_print = version ? version : @"(nil)"; 176 NSString* version_print = version ? version : @"(nil)";
177 177
178 DLOG(INFO) << "Blocking attempt to load bundle " 178 // Provide a hint for the user (or module developer) to figure out
179 << [bundle_id_print UTF8String] 179 // that the bundle was blocked.
180 << " version " 180 LOG(INFO) << "Blocking attempt to load bundle "
181 << [version_print UTF8String] 181 << [bundle_id_print UTF8String]
182 << " at " 182 << " version "
183 << [path fileSystemRepresentation]; 183 << [version_print UTF8String]
184 << " at "
185 << [path fileSystemRepresentation];
184 186
185 if (error) { 187 if (error) {
186 base::mac::ScopedCFTypeRef<CFStringRef> app_bundle_id( 188 base::mac::ScopedCFTypeRef<CFStringRef> app_bundle_id(
187 base::SysUTF8ToCFStringRef(base::mac::BaseBundleID())); 189 base::SysUTF8ToCFStringRef(base::mac::BaseBundleID()));
188 190
189 // 0xb10c10ad = "block load" 191 // 0xb10c10ad = "block load"
190 const CFIndex kBundleLoadBlocked = 0xb10c10ad; 192 const CFIndex kBundleLoadBlocked = 0xb10c10ad;
191 193
192 NSMutableDictionary* error_dict = 194 NSMutableDictionary* error_dict =
193 [NSMutableDictionary dictionaryWithCapacity:4]; 195 [NSMutableDictionary dictionaryWithCapacity:4];
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 } 323 }
322 } 324 }
323 325
324 // Nothing matched. 326 // Nothing matched.
325 return false; 327 return false;
326 } 328 }
327 329
328 } // namespace mac 330 } // namespace mac
329 } // namespace common 331 } // namespace common
330 } // namespace chrome 332 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/common/important_file_writer.cc ('k') | chrome/common/multi_process_lock_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698