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

Side by Side Diff: net/socket/ssl_client_socket_mac.cc

Issue 8491043: Allow linker initialization of lazy instance (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: willchan comments + rebase 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 | Annotate | Revision Log
« no previous file with comments | « net/socket/nss_ssl_util.cc ('k') | net/socket/ssl_client_socket_win.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 "net/socket/ssl_client_socket_mac.h" 5 #include "net/socket/ssl_client_socket_mac.h"
6 6
7 #include <CoreServices/CoreServices.h> 7 #include <CoreServices/CoreServices.h>
8 #include <netdb.h> 8 #include <netdb.h>
9 #include <sys/socket.h> 9 #include <sys/socket.h>
10 #include <sys/types.h> 10 #include <sys/types.h>
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
479 private: 479 private:
480 friend struct base::DefaultLazyInstanceTraits<EnabledCipherSuites>; 480 friend struct base::DefaultLazyInstanceTraits<EnabledCipherSuites>;
481 EnabledCipherSuites(); 481 EnabledCipherSuites();
482 ~EnabledCipherSuites() {} 482 ~EnabledCipherSuites() {}
483 483
484 std::vector<SSLCipherSuite> ciphers_; 484 std::vector<SSLCipherSuite> ciphers_;
485 485
486 DISALLOW_COPY_AND_ASSIGN(EnabledCipherSuites); 486 DISALLOW_COPY_AND_ASSIGN(EnabledCipherSuites);
487 }; 487 };
488 488
489 static base::LazyInstance<EnabledCipherSuites> g_enabled_cipher_suites( 489 static base::LazyInstance<EnabledCipherSuites> g_enabled_cipher_suites =
490 base::LINKER_INITIALIZED); 490 LAZY_INSTANCE_INITIALIZER;
491 491
492 EnabledCipherSuites::EnabledCipherSuites() { 492 EnabledCipherSuites::EnabledCipherSuites() {
493 SSLContextRef ssl_context; 493 SSLContextRef ssl_context;
494 OSStatus status = SSLNewContext(false, &ssl_context); 494 OSStatus status = SSLNewContext(false, &ssl_context);
495 if (status != noErr) 495 if (status != noErr)
496 return; 496 return;
497 497
498 size_t num_supported_ciphers; 498 size_t num_supported_ciphers;
499 status = SSLGetNumberSupportedCiphers(ssl_context, &num_supported_ciphers); 499 status = SSLGetNumberSupportedCiphers(ssl_context, &num_supported_ciphers);
500 if (status != noErr) { 500 if (status != noErr) {
(...skipping 926 matching lines...) Expand 10 before | Expand all | Expand 10 after
1427 if (rv < 0 && rv != ERR_IO_PENDING) { 1427 if (rv < 0 && rv != ERR_IO_PENDING) {
1428 us->write_io_buf_ = NULL; 1428 us->write_io_buf_ = NULL;
1429 return OSStatusFromNetError(rv); 1429 return OSStatusFromNetError(rv);
1430 } 1430 }
1431 1431
1432 // always lie to our caller 1432 // always lie to our caller
1433 return noErr; 1433 return noErr;
1434 } 1434 }
1435 1435
1436 } // namespace net 1436 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/nss_ssl_util.cc ('k') | net/socket/ssl_client_socket_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698