Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/default_plugin/plugin_database_handler.h" | 5 #include "chrome/default_plugin/plugin_database_handler.h" |
| 6 | 6 |
| 7 #ifdef COMPILER_MSVCEXPRESS | |
| 8 #include <atlbase.h> | |
| 9 #include <atlwin.h> // Avoid WinDDK intsafe.h/XINTXX_MIN/MAX conflicts | |
| 10 #endif | |
| 11 | |
| 7 #include "libxml/parser.h" | 12 #include "libxml/parser.h" |
| 8 #include "libxml/xpath.h" | 13 #include "libxml/xpath.h" |
| 9 | 14 |
| 10 #include "base/file_util.h" | 15 #include "base/file_util.h" |
| 11 #include "base/path_service.h" | 16 #include "base/path_service.h" |
| 12 #include "base/string_number_conversions.h" | 17 #include "base/string_number_conversions.h" |
| 13 #include "base/string_split.h" | 18 #include "base/string_split.h" |
| 14 #include "base/string_util.h" | 19 #include "base/string_util.h" |
| 15 #include "base/time.h" | 20 #include "base/time.h" |
| 16 #include "base/utf_string_conversions.h" | 21 #include "base/utf_string_conversions.h" |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 111 return buffer_length; | 116 return buffer_length; |
| 112 } | 117 } |
| 113 | 118 |
| 114 if (plugin_downloads_file_ == INVALID_HANDLE_VALUE) { | 119 if (plugin_downloads_file_ == INVALID_HANDLE_VALUE) { |
| 115 DVLOG(1) << "About to create plugins file " << plugins_file_; | 120 DVLOG(1) << "About to create plugins file " << plugins_file_; |
| 116 plugin_downloads_file_ = CreateFile(plugins_file_.c_str(), | 121 plugin_downloads_file_ = CreateFile(plugins_file_.c_str(), |
| 117 GENERIC_READ | GENERIC_WRITE, | 122 GENERIC_READ | GENERIC_WRITE, |
| 118 FILE_SHARE_READ, NULL, CREATE_ALWAYS, | 123 FILE_SHARE_READ, NULL, CREATE_ALWAYS, |
| 119 FILE_ATTRIBUTE_NORMAL, NULL); | 124 FILE_ATTRIBUTE_NORMAL, NULL); |
| 120 if (plugin_downloads_file_ == INVALID_HANDLE_VALUE) { | 125 if (plugin_downloads_file_ == INVALID_HANDLE_VALUE) { |
| 121 unsigned long error = ::GetLastError(); | 126 DWORD error = ::GetLastError(); |
|
M-A Ruel
2011/03/16 17:48:55
why?
RN
2011/03/17 06:33:25
It was a lint error. WinSDK GetLastError returns a
| |
| 122 if (error == ERROR_SHARING_VIOLATION) { | 127 if (error == ERROR_SHARING_VIOLATION) { |
| 123 // File may have been downloaded by another plugin instance on this | 128 // File may have been downloaded by another plugin instance on this |
| 124 // page. | 129 // page. |
| 125 plugin_downloads_file_ = ::CreateFile( | 130 plugin_downloads_file_ = ::CreateFile( |
| 126 plugins_file_.c_str(), GENERIC_READ, | 131 plugins_file_.c_str(), GENERIC_READ, |
| 127 FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, | 132 FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, |
| 128 FILE_ATTRIBUTE_NORMAL, NULL); | 133 FILE_ATTRIBUTE_NORMAL, NULL); |
| 129 if (plugin_downloads_file_ != INVALID_HANDLE_VALUE) { | 134 if (plugin_downloads_file_ != INVALID_HANDLE_VALUE) { |
| 130 ignore_plugin_db_data_ = true; | 135 ignore_plugin_db_data_ = true; |
| 131 return buffer_length; | 136 return buffer_length; |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 345 | 350 |
| 346 base::SplitString( | 351 base::SplitString( |
| 347 reinterpret_cast<const char*>(plugin_mime_type_vals->content), | 352 reinterpret_cast<const char*>(plugin_mime_type_vals->content), |
| 348 kMimeTypeSeparator, &plugin_detail->mime_types); | 353 kMimeTypeSeparator, &plugin_detail->mime_types); |
| 349 | 354 |
| 350 plugin_detail->language = | 355 plugin_detail->language = |
| 351 reinterpret_cast<const char*>(plugin_lang_val->content); | 356 reinterpret_cast<const char*>(plugin_lang_val->content); |
| 352 | 357 |
| 353 return true; | 358 return true; |
| 354 } | 359 } |
| OLD | NEW |