Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright 2009, Google Inc. | 2 * Copyright 2009, Google Inc. |
| 3 * All rights reserved. | 3 * All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 30 */ | 30 */ |
| 31 | 31 |
| 32 #include <iostream> | 32 #include <iostream> |
| 33 #include <fstream> | 33 #include <fstream> |
| 34 | 34 |
| 35 #include "plugin/cross/config.h" | 35 #include "plugin/cross/config.h" |
| 36 #include "base/logging.h" | 36 #include "base/logging.h" |
| 37 | 37 |
| 38 namespace o3d { | |
| 39 | |
| 38 // Checks the driver GUID against the blacklist file. Returns true if there's a | 40 // Checks the driver GUID against the blacklist file. Returns true if there's a |
| 39 // match [this driver is blacklisted] or if an IO error occurred. Check the | 41 // match [this driver is blacklisted] or if an IO error occurred. Check the |
| 40 // state of input_file to determine which it was. | 42 // state of input_file to determine which it was. |
| 41 // | 43 // |
| 42 // Note that this function always returns false if the guid is 0, since it will | 44 // Note that this function always returns false if the guid is 0, since it will |
| 43 // be zero if we had a failure in reading it, and the user will already have | 45 // be zero if we had a failure in reading it, and the user will already have |
| 44 // been warned. | 46 // been warned. |
| 45 bool IsDriverBlacklisted(std::ifstream *input_file, unsigned int guid) { | 47 bool IsDriverBlacklisted(std::ifstream *input_file, unsigned int guid) { |
| 46 if (!guid) { | 48 if (!guid) { |
| 47 return false; | 49 return false; |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 61 } | 63 } |
| 62 *input_file >> std::ws; // Skip whitespace here, to catch EOF cleanly. | 64 *input_file >> std::ws; // Skip whitespace here, to catch EOF cleanly. |
| 63 } | 65 } |
| 64 if (input_file->fail()) { | 66 if (input_file->fail()) { |
| 65 LOG(ERROR) << "Failed to read the blacklisted driver file completely."; | 67 LOG(ERROR) << "Failed to read the blacklisted driver file completely."; |
| 66 return true; | 68 return true; |
| 67 } | 69 } |
| 68 CHECK(input_file->eof()); | 70 CHECK(input_file->eof()); |
| 69 return false; | 71 return false; |
| 70 } | 72 } |
| 73 } // namesapce o3d | |
|
vangelis
2009/07/09 02:14:11
typo: namespace
| |
| OLD | NEW |