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

Side by Side Diff: net/cert/cert_database_mac.cc

Issue 141683005: Removes MessageLoop::Type checks in favor of IsCurrent on MessageLoops. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: base:: Created 6 years, 11 months 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/base/dns_reloader.cc ('k') | net/socket_stream/socket_stream.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/cert/cert_database.h" 5 #include "net/cert/cert_database.h"
6 6
7 #include <Security/Security.h> 7 #include <Security/Security.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/mac/mac_logging.h" 10 #include "base/mac/mac_logging.h"
(...skipping 13 matching lines...) Expand all
24 class CertDatabase::Notifier { 24 class CertDatabase::Notifier {
25 public: 25 public:
26 // Creates a new Notifier that will forward Keychain events to |cert_db|. 26 // Creates a new Notifier that will forward Keychain events to |cert_db|.
27 // |message_loop| must refer to a thread with an associated CFRunLoop - a 27 // |message_loop| must refer to a thread with an associated CFRunLoop - a
28 // TYPE_UI thread. Events will be dispatched from this message loop. 28 // TYPE_UI thread. Events will be dispatched from this message loop.
29 Notifier(CertDatabase* cert_db, base::MessageLoop* message_loop) 29 Notifier(CertDatabase* cert_db, base::MessageLoop* message_loop)
30 : cert_db_(cert_db), 30 : cert_db_(cert_db),
31 registered_(false), 31 registered_(false),
32 called_shutdown_(false) { 32 called_shutdown_(false) {
33 // Ensure an associated CFRunLoop. 33 // Ensure an associated CFRunLoop.
34 DCHECK(message_loop->IsType(base::MessageLoop::TYPE_UI)); 34 DCHECK(base::MessageLoopForUI::IsCurrent());
35 task_runner_ = message_loop->message_loop_proxy(); 35 task_runner_ = message_loop->message_loop_proxy();
36 task_runner_->PostTask(FROM_HERE, 36 task_runner_->PostTask(FROM_HERE,
37 base::Bind(&Notifier::Init, 37 base::Bind(&Notifier::Init,
38 base::Unretained(this))); 38 base::Unretained(this)));
39 } 39 }
40 40
41 // Should be called from the |task_runner_|'s thread. Use Shutdown() 41 // Should be called from the |task_runner_|'s thread. Use Shutdown()
42 // to shutdown on arbitrary threads. 42 // to shutdown on arbitrary threads.
43 ~Notifier() { 43 ~Notifier() {
44 DCHECK(called_shutdown_); 44 DCHECK(called_shutdown_);
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 case errSecDuplicateItem: 163 case errSecDuplicateItem:
164 return OK; 164 return OK;
165 default: 165 default:
166 OSSTATUS_LOG(ERROR, err) << "CertDatabase failed to add cert to keychain"; 166 OSSTATUS_LOG(ERROR, err) << "CertDatabase failed to add cert to keychain";
167 // TODO(snej): Map the error code more intelligently. 167 // TODO(snej): Map the error code more intelligently.
168 return ERR_ADD_USER_CERT_FAILED; 168 return ERR_ADD_USER_CERT_FAILED;
169 } 169 }
170 } 170 }
171 171
172 } // namespace net 172 } // namespace net
OLDNEW
« no previous file with comments | « net/base/dns_reloader.cc ('k') | net/socket_stream/socket_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698