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

Side by Side Diff: chrome/browser/password_manager/native_backend_gnome_x.cc

Issue 951883002: [Password Manager Cleanup] Replaces NULL -> nullptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addresses Vaclav's comments. Created 5 years, 10 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
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 "chrome/browser/password_manager/native_backend_gnome_x.h" 5 #include "chrome/browser/password_manager/native_backend_gnome_x.h"
6 6
7 #include <dlfcn.h> 7 #include <dlfcn.h>
8 #include <gnome-keyring.h> 8 #include <gnome-keyring.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 30 matching lines...) Expand all
41 #undef GNOME_KEYRING_DEFINE_POINTER 41 #undef GNOME_KEYRING_DEFINE_POINTER
42 42
43 bool GnomeKeyringLoader::keyring_loaded = false; 43 bool GnomeKeyringLoader::keyring_loaded = false;
44 44
45 #if defined(DLOPEN_GNOME_KEYRING) 45 #if defined(DLOPEN_GNOME_KEYRING)
46 46
47 #define GNOME_KEYRING_FUNCTION_INFO(name) \ 47 #define GNOME_KEYRING_FUNCTION_INFO(name) \
48 {"gnome_keyring_"#name, reinterpret_cast<void**>(&gnome_keyring_##name)}, 48 {"gnome_keyring_"#name, reinterpret_cast<void**>(&gnome_keyring_##name)},
49 const GnomeKeyringLoader::FunctionInfo GnomeKeyringLoader::functions[] = { 49 const GnomeKeyringLoader::FunctionInfo GnomeKeyringLoader::functions[] = {
50 GNOME_KEYRING_FOR_EACH_FUNC(GNOME_KEYRING_FUNCTION_INFO) 50 GNOME_KEYRING_FOR_EACH_FUNC(GNOME_KEYRING_FUNCTION_INFO)
51 {NULL, NULL} 51 {nullptr, nullptr}
52 }; 52 };
53 #undef GNOME_KEYRING_FUNCTION_INFO 53 #undef GNOME_KEYRING_FUNCTION_INFO
54 54
55 /* Load the library and initialize the function pointers. */ 55 /* Load the library and initialize the function pointers. */
56 bool GnomeKeyringLoader::LoadGnomeKeyring() { 56 bool GnomeKeyringLoader::LoadGnomeKeyring() {
57 if (keyring_loaded) 57 if (keyring_loaded)
58 return true; 58 return true;
59 59
60 void* handle = dlopen("libgnome-keyring.so.0", RTLD_NOW | RTLD_GLOBAL); 60 void* handle = dlopen("libgnome-keyring.so.0", RTLD_NOW | RTLD_GLOBAL);
61 if (!handle) { 61 if (!handle) {
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 // |lookup_form| is used to filter out results -- only credentials with signon 168 // |lookup_form| is used to filter out results -- only credentials with signon
169 // realms passing the PSL matching against |lookup_form->signon_realm| will be 169 // realms passing the PSL matching against |lookup_form->signon_realm| will be
170 // kept. PSL matched results get their signon_realm, origin, and action 170 // kept. PSL matched results get their signon_realm, origin, and action
171 // rewritten to those of |lookup_form_|, with the original signon_realm saved 171 // rewritten to those of |lookup_form_|, with the original signon_realm saved
172 // into the result's original_signon_realm data member. 172 // into the result's original_signon_realm data member.
173 void ConvertFormList(GList* found, 173 void ConvertFormList(GList* found,
174 const PasswordForm* lookup_form, 174 const PasswordForm* lookup_form,
175 ScopedVector<autofill::PasswordForm>* forms) { 175 ScopedVector<autofill::PasswordForm>* forms) {
176 password_manager::PSLDomainMatchMetric psl_domain_match_metric = 176 password_manager::PSLDomainMatchMetric psl_domain_match_metric =
177 password_manager::PSL_DOMAIN_MATCH_NONE; 177 password_manager::PSL_DOMAIN_MATCH_NONE;
178 for (GList* element = g_list_first(found); element != NULL; 178 for (GList* element = g_list_first(found); element;
179 element = g_list_next(element)) { 179 element = g_list_next(element)) {
180 GnomeKeyringFound* data = static_cast<GnomeKeyringFound*>(element->data); 180 GnomeKeyringFound* data = static_cast<GnomeKeyringFound*>(element->data);
181 GnomeKeyringAttributeList* attrs = data->attributes; 181 GnomeKeyringAttributeList* attrs = data->attributes;
182 182
183 scoped_ptr<PasswordForm> form(FormFromAttributes(attrs)); 183 scoped_ptr<PasswordForm> form(FormFromAttributes(attrs));
184 if (form) { 184 if (form) {
185 if (lookup_form && form->signon_realm != lookup_form->signon_realm) { 185 if (lookup_form && form->signon_realm != lookup_form->signon_realm) {
186 // This is not an exact match, we try PSL matching. 186 // This is not an exact match, we try PSL matching.
187 if (lookup_form->scheme != PasswordForm::SCHEME_HTML || 187 if (lookup_form->scheme != PasswordForm::SCHEME_HTML ||
188 form->scheme != PasswordForm::SCHEME_HTML || 188 form->scheme != PasswordForm::SCHEME_HTML ||
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 { "type", GNOME_KEYRING_ATTRIBUTE_TYPE_UINT32 }, 242 { "type", GNOME_KEYRING_ATTRIBUTE_TYPE_UINT32 },
243 { "times_used", GNOME_KEYRING_ATTRIBUTE_TYPE_UINT32 }, 243 { "times_used", GNOME_KEYRING_ATTRIBUTE_TYPE_UINT32 },
244 { "date_synced", GNOME_KEYRING_ATTRIBUTE_TYPE_STRING }, 244 { "date_synced", GNOME_KEYRING_ATTRIBUTE_TYPE_STRING },
245 { "display_name", GNOME_KEYRING_ATTRIBUTE_TYPE_STRING }, 245 { "display_name", GNOME_KEYRING_ATTRIBUTE_TYPE_STRING },
246 { "avatar_url", GNOME_KEYRING_ATTRIBUTE_TYPE_STRING }, 246 { "avatar_url", GNOME_KEYRING_ATTRIBUTE_TYPE_STRING },
247 { "federation_url", GNOME_KEYRING_ATTRIBUTE_TYPE_STRING }, 247 { "federation_url", GNOME_KEYRING_ATTRIBUTE_TYPE_STRING },
248 { "skip_zero_click", GNOME_KEYRING_ATTRIBUTE_TYPE_UINT32 }, 248 { "skip_zero_click", GNOME_KEYRING_ATTRIBUTE_TYPE_UINT32 },
249 { "generation_upload_status", GNOME_KEYRING_ATTRIBUTE_TYPE_UINT32 }, 249 { "generation_upload_status", GNOME_KEYRING_ATTRIBUTE_TYPE_UINT32 },
250 // This field is always "chrome" so that we can search for it. 250 // This field is always "chrome" so that we can search for it.
251 { "application", GNOME_KEYRING_ATTRIBUTE_TYPE_STRING }, 251 { "application", GNOME_KEYRING_ATTRIBUTE_TYPE_STRING },
252 { NULL } 252 { nullptr }
253 } 253 }
254 }; 254 };
255 255
256 // Sadly, PasswordStore goes to great lengths to switch from the originally 256 // Sadly, PasswordStore goes to great lengths to switch from the originally
257 // calling thread to the DB thread, and to provide an asynchronous API to 257 // calling thread to the DB thread, and to provide an asynchronous API to
258 // callers while using a synchronous (virtual) API provided by subclasses like 258 // callers while using a synchronous (virtual) API provided by subclasses like
259 // PasswordStoreX -- but GNOME Keyring really wants to be on the GLib main 259 // PasswordStoreX -- but GNOME Keyring really wants to be on the GLib main
260 // thread, which is the UI thread to us. So we end up having to switch threads 260 // thread, which is the UI thread to us. So we end up having to switch threads
261 // again, possibly back to the very same thread (in case the UI thread is the 261 // again, possibly back to the very same thread (in case the UI thread is the
262 // caller, e.g. in the password management UI), and *block* the DB thread 262 // caller, e.g. in the password management UI), and *block* the DB thread
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 void GKRMethod::AddLogin(const PasswordForm& form, const char* app_string) { 334 void GKRMethod::AddLogin(const PasswordForm& form, const char* app_string) {
335 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 335 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
336 int64 date_created = form.date_created.ToInternalValue(); 336 int64 date_created = form.date_created.ToInternalValue();
337 // If we are asked to save a password with 0 date, use the current time. 337 // If we are asked to save a password with 0 date, use the current time.
338 // We don't want to actually save passwords as though on January 1, 1601. 338 // We don't want to actually save passwords as though on January 1, 1601.
339 if (!date_created) 339 if (!date_created)
340 date_created = base::Time::Now().ToInternalValue(); 340 date_created = base::Time::Now().ToInternalValue();
341 int64 date_synced = form.date_synced.ToInternalValue(); 341 int64 date_synced = form.date_synced.ToInternalValue();
342 gnome_keyring_store_password( 342 gnome_keyring_store_password(
343 &kGnomeSchema, 343 &kGnomeSchema,
344 NULL, // Default keyring. 344 nullptr, // Default keyring.
345 form.origin.spec().c_str(), // Display name. 345 form.origin.spec().c_str(), // Display name.
346 UTF16ToUTF8(form.password_value).c_str(), 346 UTF16ToUTF8(form.password_value).c_str(),
347 OnOperationDone, 347 OnOperationDone,
348 this, // data 348 this, // data
349 NULL, // destroy_data 349 nullptr, // destroy_data
350 "origin_url", form.origin.spec().c_str(), 350 "origin_url", form.origin.spec().c_str(),
351 "action_url", form.action.spec().c_str(), 351 "action_url", form.action.spec().c_str(),
352 "username_element", UTF16ToUTF8(form.username_element).c_str(), 352 "username_element", UTF16ToUTF8(form.username_element).c_str(),
353 "username_value", UTF16ToUTF8(form.username_value).c_str(), 353 "username_value", UTF16ToUTF8(form.username_value).c_str(),
354 "password_element", UTF16ToUTF8(form.password_element).c_str(), 354 "password_element", UTF16ToUTF8(form.password_element).c_str(),
355 "submit_element", UTF16ToUTF8(form.submit_element).c_str(), 355 "submit_element", UTF16ToUTF8(form.submit_element).c_str(),
356 "signon_realm", form.signon_realm.c_str(), 356 "signon_realm", form.signon_realm.c_str(),
357 "ssl_valid", form.ssl_valid, 357 "ssl_valid", form.ssl_valid,
358 "preferred", form.preferred, 358 "preferred", form.preferred,
359 "date_created", base::Int64ToString(date_created).c_str(), 359 "date_created", base::Int64ToString(date_created).c_str(),
360 "blacklisted_by_user", form.blacklisted_by_user, 360 "blacklisted_by_user", form.blacklisted_by_user,
361 "type", form.type, 361 "type", form.type,
362 "times_used", form.times_used, 362 "times_used", form.times_used,
363 "scheme", form.scheme, 363 "scheme", form.scheme,
364 "date_synced", base::Int64ToString(date_synced).c_str(), 364 "date_synced", base::Int64ToString(date_synced).c_str(),
365 "display_name", UTF16ToUTF8(form.display_name).c_str(), 365 "display_name", UTF16ToUTF8(form.display_name).c_str(),
366 "avatar_url", form.avatar_url.spec().c_str(), 366 "avatar_url", form.avatar_url.spec().c_str(),
367 "federation_url", form.federation_url.spec().c_str(), 367 "federation_url", form.federation_url.spec().c_str(),
368 "skip_zero_click", form.skip_zero_click, 368 "skip_zero_click", form.skip_zero_click,
369 "generation_upload_status", form.generation_upload_status, 369 "generation_upload_status", form.generation_upload_status,
370 "application", app_string, 370 "application", app_string,
371 NULL); 371 nullptr);
372 } 372 }
373 373
374 void GKRMethod::AddLoginSearch(const PasswordForm& form, 374 void GKRMethod::AddLoginSearch(const PasswordForm& form,
375 const char* app_string) { 375 const char* app_string) {
376 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 376 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
377 lookup_form_.reset(NULL); 377 lookup_form_.reset(nullptr);
378 // Search GNOME Keyring for matching passwords to update. 378 // Search GNOME Keyring for matching passwords to update.
379 ScopedAttributeList attrs(gnome_keyring_attribute_list_new()); 379 ScopedAttributeList attrs(gnome_keyring_attribute_list_new());
380 AppendString(&attrs, "origin_url", form.origin.spec()); 380 AppendString(&attrs, "origin_url", form.origin.spec());
381 AppendString(&attrs, "username_element", UTF16ToUTF8(form.username_element)); 381 AppendString(&attrs, "username_element", UTF16ToUTF8(form.username_element));
382 AppendString(&attrs, "username_value", UTF16ToUTF8(form.username_value)); 382 AppendString(&attrs, "username_value", UTF16ToUTF8(form.username_value));
383 AppendString(&attrs, "password_element", UTF16ToUTF8(form.password_element)); 383 AppendString(&attrs, "password_element", UTF16ToUTF8(form.password_element));
384 AppendString(&attrs, "submit_element", UTF16ToUTF8(form.submit_element)); 384 AppendString(&attrs, "submit_element", UTF16ToUTF8(form.submit_element));
385 AppendString(&attrs, "signon_realm", form.signon_realm); 385 AppendString(&attrs, "signon_realm", form.signon_realm);
386 AppendString(&attrs, "application", app_string); 386 AppendString(&attrs, "application", app_string);
387 gnome_keyring_find_items(GNOME_KEYRING_ITEM_GENERIC_SECRET, 387 gnome_keyring_find_items(GNOME_KEYRING_ITEM_GENERIC_SECRET,
388 attrs.get(), 388 attrs.get(),
389 OnOperationGetList, 389 OnOperationGetList,
390 /*data=*/this, 390 /*data=*/this,
391 /*destroy_data=*/NULL); 391 /*destroy_data=*/nullptr);
392 } 392 }
393 393
394 void GKRMethod::UpdateLoginSearch(const PasswordForm& form, 394 void GKRMethod::UpdateLoginSearch(const PasswordForm& form,
395 const char* app_string) { 395 const char* app_string) {
396 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 396 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
397 lookup_form_.reset(NULL); 397 lookup_form_.reset(nullptr);
398 // Search GNOME Keyring for matching passwords to update. 398 // Search GNOME Keyring for matching passwords to update.
399 ScopedAttributeList attrs(gnome_keyring_attribute_list_new()); 399 ScopedAttributeList attrs(gnome_keyring_attribute_list_new());
400 AppendString(&attrs, "origin_url", form.origin.spec()); 400 AppendString(&attrs, "origin_url", form.origin.spec());
401 AppendString(&attrs, "username_element", UTF16ToUTF8(form.username_element)); 401 AppendString(&attrs, "username_element", UTF16ToUTF8(form.username_element));
402 AppendString(&attrs, "username_value", UTF16ToUTF8(form.username_value)); 402 AppendString(&attrs, "username_value", UTF16ToUTF8(form.username_value));
403 AppendString(&attrs, "password_element", UTF16ToUTF8(form.password_element)); 403 AppendString(&attrs, "password_element", UTF16ToUTF8(form.password_element));
404 AppendString(&attrs, "signon_realm", form.signon_realm); 404 AppendString(&attrs, "signon_realm", form.signon_realm);
405 AppendString(&attrs, "application", app_string); 405 AppendString(&attrs, "application", app_string);
406 gnome_keyring_find_items(GNOME_KEYRING_ITEM_GENERIC_SECRET, 406 gnome_keyring_find_items(GNOME_KEYRING_ITEM_GENERIC_SECRET,
407 attrs.get(), 407 attrs.get(),
408 OnOperationGetList, 408 OnOperationGetList,
409 /*data=*/this, 409 /*data=*/this,
410 /*destroy_data=*/NULL); 410 /*destroy_data=*/nullptr);
411 } 411 }
412 412
413 void GKRMethod::RemoveLogin(const PasswordForm& form, const char* app_string) { 413 void GKRMethod::RemoveLogin(const PasswordForm& form, const char* app_string) {
414 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 414 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
415 // We find forms using the same fields as LoginDatabase::RemoveLogin(). 415 // We find forms using the same fields as LoginDatabase::RemoveLogin().
416 gnome_keyring_delete_password( 416 gnome_keyring_delete_password(
417 &kGnomeSchema, 417 &kGnomeSchema,
418 OnOperationDone, 418 OnOperationDone,
419 this, // data 419 this, // data
420 NULL, // destroy_data 420 nullptr, // destroy_data
421 "origin_url", form.origin.spec().c_str(), 421 "origin_url", form.origin.spec().c_str(),
422 "username_element", UTF16ToUTF8(form.username_element).c_str(), 422 "username_element", UTF16ToUTF8(form.username_element).c_str(),
423 "username_value", UTF16ToUTF8(form.username_value).c_str(), 423 "username_value", UTF16ToUTF8(form.username_value).c_str(),
424 "password_element", UTF16ToUTF8(form.password_element).c_str(), 424 "password_element", UTF16ToUTF8(form.password_element).c_str(),
425 "submit_element", UTF16ToUTF8(form.submit_element).c_str(), 425 "submit_element", UTF16ToUTF8(form.submit_element).c_str(),
426 "signon_realm", form.signon_realm.c_str(), 426 "signon_realm", form.signon_realm.c_str(),
427 "application", app_string, 427 "application", app_string,
428 NULL); 428 nullptr);
429 } 429 }
430 430
431 void GKRMethod::GetLogins(const PasswordForm& form, const char* app_string) { 431 void GKRMethod::GetLogins(const PasswordForm& form, const char* app_string) {
432 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 432 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
433 lookup_form_.reset(new PasswordForm(form)); 433 lookup_form_.reset(new PasswordForm(form));
434 // Search GNOME Keyring for matching passwords. 434 // Search GNOME Keyring for matching passwords.
435 ScopedAttributeList attrs(gnome_keyring_attribute_list_new()); 435 ScopedAttributeList attrs(gnome_keyring_attribute_list_new());
436 if (!password_manager::ShouldPSLDomainMatchingApply( 436 if (!password_manager::ShouldPSLDomainMatchingApply(
437 password_manager::GetRegistryControlledDomain( 437 password_manager::GetRegistryControlledDomain(
438 GURL(form.signon_realm)))) { 438 GURL(form.signon_realm)))) {
439 AppendString(&attrs, "signon_realm", form.signon_realm); 439 AppendString(&attrs, "signon_realm", form.signon_realm);
440 } 440 }
441 AppendString(&attrs, "application", app_string); 441 AppendString(&attrs, "application", app_string);
442 gnome_keyring_find_items(GNOME_KEYRING_ITEM_GENERIC_SECRET, 442 gnome_keyring_find_items(GNOME_KEYRING_ITEM_GENERIC_SECRET,
443 attrs.get(), 443 attrs.get(),
444 OnOperationGetList, 444 OnOperationGetList,
445 /*data=*/this, 445 /*data=*/this,
446 /*destroy_data=*/NULL); 446 /*destroy_data=*/nullptr);
447 } 447 }
448 448
449 void GKRMethod::GetLoginsList(uint32_t blacklisted_by_user, 449 void GKRMethod::GetLoginsList(uint32_t blacklisted_by_user,
450 const char* app_string) { 450 const char* app_string) {
451 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 451 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
452 lookup_form_.reset(NULL); 452 lookup_form_.reset(nullptr);
453 // Search GNOME Keyring for matching passwords. 453 // Search GNOME Keyring for matching passwords.
454 ScopedAttributeList attrs(gnome_keyring_attribute_list_new()); 454 ScopedAttributeList attrs(gnome_keyring_attribute_list_new());
455 AppendUint32(&attrs, "blacklisted_by_user", blacklisted_by_user); 455 AppendUint32(&attrs, "blacklisted_by_user", blacklisted_by_user);
456 AppendString(&attrs, "application", app_string); 456 AppendString(&attrs, "application", app_string);
457 gnome_keyring_find_items(GNOME_KEYRING_ITEM_GENERIC_SECRET, 457 gnome_keyring_find_items(GNOME_KEYRING_ITEM_GENERIC_SECRET,
458 attrs.get(), 458 attrs.get(),
459 OnOperationGetList, 459 OnOperationGetList,
460 /*data=*/this, 460 /*data=*/this,
461 /*destroy_data=*/NULL); 461 /*destroy_data=*/nullptr);
462 } 462 }
463 463
464 void GKRMethod::GetAllLogins(const char* app_string) { 464 void GKRMethod::GetAllLogins(const char* app_string) {
465 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 465 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
466 lookup_form_.reset(NULL); 466 lookup_form_.reset(nullptr);
467 // We need to search for something, otherwise we get no results - so 467 // We need to search for something, otherwise we get no results - so
468 // we search for the fixed application string. 468 // we search for the fixed application string.
469 ScopedAttributeList attrs(gnome_keyring_attribute_list_new()); 469 ScopedAttributeList attrs(gnome_keyring_attribute_list_new());
470 AppendString(&attrs, "application", app_string); 470 AppendString(&attrs, "application", app_string);
471 gnome_keyring_find_items(GNOME_KEYRING_ITEM_GENERIC_SECRET, 471 gnome_keyring_find_items(GNOME_KEYRING_ITEM_GENERIC_SECRET,
472 attrs.get(), 472 attrs.get(),
473 OnOperationGetList, 473 OnOperationGetList,
474 /*data=*/this, 474 /*data=*/this,
475 /*destroy_data=*/NULL); 475 /*destroy_data=*/nullptr);
476 } 476 }
477 477
478 GnomeKeyringResult GKRMethod::WaitResult() { 478 GnomeKeyringResult GKRMethod::WaitResult() {
479 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); 479 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
480 event_.Wait(); 480 event_.Wait();
481 return result_; 481 return result_;
482 } 482 }
483 483
484 GnomeKeyringResult GKRMethod::WaitResult( 484 GnomeKeyringResult GKRMethod::WaitResult(
485 ScopedVector<autofill::PasswordForm>* forms) { 485 ScopedVector<autofill::PasswordForm>* forms) {
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 } 525 }
526 526
527 // static 527 // static
528 void GKRMethod::OnOperationGetList(GnomeKeyringResult result, GList* list, 528 void GKRMethod::OnOperationGetList(GnomeKeyringResult result, GList* list,
529 gpointer data) { 529 gpointer data) {
530 GKRMethod* method = static_cast<GKRMethod*>(data); 530 GKRMethod* method = static_cast<GKRMethod*>(data);
531 method->result_ = result; 531 method->result_ = result;
532 method->forms_.clear(); 532 method->forms_.clear();
533 // |list| will be freed after this callback returns, so convert it now. 533 // |list| will be freed after this callback returns, so convert it now.
534 ConvertFormList(list, method->lookup_form_.get(), &method->forms_); 534 ConvertFormList(list, method->lookup_form_.get(), &method->forms_);
535 method->lookup_form_.reset(NULL); 535 method->lookup_form_.reset();
536 method->event_.Signal(); 536 method->event_.Signal();
537 } 537 }
538 538
539 } // namespace 539 } // namespace
540 540
541 NativeBackendGnome::NativeBackendGnome(LocalProfileId id) 541 NativeBackendGnome::NativeBackendGnome(LocalProfileId id)
542 : profile_id_(id) { 542 : profile_id_(id) {
543 app_string_ = GetProfileSpecificAppString(); 543 app_string_ = GetProfileSpecificAppString();
544 } 544 }
545 545
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
806 } 806 }
807 return ok; 807 return ok;
808 } 808 }
809 809
810 std::string NativeBackendGnome::GetProfileSpecificAppString() const { 810 std::string NativeBackendGnome::GetProfileSpecificAppString() const {
811 // Originally, the application string was always just "chrome" and used only 811 // Originally, the application string was always just "chrome" and used only
812 // so that we had *something* to search for since GNOME Keyring won't search 812 // so that we had *something* to search for since GNOME Keyring won't search
813 // for nothing. Now we use it to distinguish passwords for different profiles. 813 // for nothing. Now we use it to distinguish passwords for different profiles.
814 return base::StringPrintf("%s-%d", kGnomeKeyringAppString, profile_id_); 814 return base::StringPrintf("%s-%d", kGnomeKeyringAppString, profile_id_);
815 } 815 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698