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 "net/http/http_auth_gssapi_posix.h" | 5 #include "net/http/http_auth_gssapi_posix.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/base64.h" | 10 #include "base/base64.h" |
11 #include "base/file_path.h" | 11 #include "base/file_path.h" |
12 #include "base/format_macros.h" | 12 #include "base/format_macros.h" |
13 #include "base/logging.h" | 13 #include "base/logging.h" |
14 #include "base/string_util.h" | 14 #include "base/string_util.h" |
15 #include "base/stringprintf.h" | 15 #include "base/stringprintf.h" |
| 16 #include "base/thread_restrictions.h" |
16 #include "net/base/net_errors.h" | 17 #include "net/base/net_errors.h" |
17 #include "net/base/net_util.h" | 18 #include "net/base/net_util.h" |
18 | 19 |
19 // These are defined for the GSSAPI library: | 20 // These are defined for the GSSAPI library: |
20 // Paraphrasing the comments from gssapi.h: | 21 // Paraphrasing the comments from gssapi.h: |
21 // "The implementation must reserve static storage for a | 22 // "The implementation must reserve static storage for a |
22 // gss_OID_desc object for each constant. That constant | 23 // gss_OID_desc object for each constant. That constant |
23 // should be initialized to point to that gss_OID_desc." | 24 // should be initialized to point to that gss_OID_desc." |
24 namespace { | 25 namespace { |
25 | 26 |
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
439 "libgssapi.so.1" // Heimdal - Suse9, CITI - FC, MDK, Suse10 | 440 "libgssapi.so.1" // Heimdal - Suse9, CITI - FC, MDK, Suse10 |
440 #endif | 441 #endif |
441 }; | 442 }; |
442 library_names = kDefaultLibraryNames; | 443 library_names = kDefaultLibraryNames; |
443 num_lib_names = arraysize(kDefaultLibraryNames); | 444 num_lib_names = arraysize(kDefaultLibraryNames); |
444 } | 445 } |
445 | 446 |
446 for (size_t i = 0; i < num_lib_names; ++i) { | 447 for (size_t i = 0; i < num_lib_names; ++i) { |
447 const char* library_name = library_names[i]; | 448 const char* library_name = library_names[i]; |
448 FilePath file_path(library_name); | 449 FilePath file_path(library_name); |
| 450 |
| 451 // TODO(asanka): Move library loading to a separate thread. |
| 452 // http://crbug.com/66702 |
| 453 base::ThreadRestrictions::ScopedAllowIO allow_io_temporarily; |
449 base::NativeLibrary lib = base::LoadNativeLibrary(file_path); | 454 base::NativeLibrary lib = base::LoadNativeLibrary(file_path); |
450 if (lib) { | 455 if (lib) { |
451 // Only return this library if we can bind the functions we need. | 456 // Only return this library if we can bind the functions we need. |
452 if (BindMethods(lib)) | 457 if (BindMethods(lib)) |
453 return lib; | 458 return lib; |
454 base::UnloadNativeLibrary(lib); | 459 base::UnloadNativeLibrary(lib); |
455 } | 460 } |
456 } | 461 } |
457 LOG(WARNING) << "Unable to find a compatible GSSAPI library"; | 462 LOG(WARNING) << "Unable to find a compatible GSSAPI library"; |
458 return NULL; | 463 return NULL; |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
875 if (rv != OK) { | 880 if (rv != OK) { |
876 LOG(ERROR) << "Problem initializing context. \n" | 881 LOG(ERROR) << "Problem initializing context. \n" |
877 << DisplayExtendedStatus(library_, major_status, minor_status) | 882 << DisplayExtendedStatus(library_, major_status, minor_status) |
878 << '\n' | 883 << '\n' |
879 << DescribeContext(library_, scoped_sec_context_.get()); | 884 << DescribeContext(library_, scoped_sec_context_.get()); |
880 } | 885 } |
881 return rv; | 886 return rv; |
882 } | 887 } |
883 | 888 |
884 } // namespace net | 889 } // namespace net |
OLD | NEW |