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

Side by Side Diff: chrome/browser/ui/webui/options2/chromeos/bluetooth_options_handler2.cc

Issue 9702076: bluetooth: guard adapter_ in destructor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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 | « no previous file | no next file » | 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 "chrome/browser/ui/webui/options2/chromeos/bluetooth_options_handler2.h " 5 #include "chrome/browser/ui/webui/options2/chromeos/bluetooth_options_handler2.h "
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 52
53 BluetoothOptionsHandler::BluetoothOptionsHandler() : weak_ptr_factory_(this) { 53 BluetoothOptionsHandler::BluetoothOptionsHandler() : weak_ptr_factory_(this) {
54 } 54 }
55 55
56 BluetoothOptionsHandler::~BluetoothOptionsHandler() { 56 BluetoothOptionsHandler::~BluetoothOptionsHandler() {
57 if (!CommandLine::ForCurrentProcess() 57 if (!CommandLine::ForCurrentProcess()
58 ->HasSwitch(switches::kEnableBluetooth)) { 58 ->HasSwitch(switches::kEnableBluetooth)) {
59 return; 59 return;
60 } 60 }
61 61
62 adapter_->RemoveObserver(this); 62 if (adapter_.get())
James Hawkins 2012/03/15 17:19:07 Optional nit: You can leave off the .get().
63 adapter_->RemoveObserver(this);
63 } 64 }
64 65
65 void BluetoothOptionsHandler::GetLocalizedValues( 66 void BluetoothOptionsHandler::GetLocalizedValues(
66 DictionaryValue* localized_strings) { 67 DictionaryValue* localized_strings) {
67 DCHECK(localized_strings); 68 DCHECK(localized_strings);
68 localized_strings->SetString("bluetooth", 69 localized_strings->SetString("bluetooth",
69 l10n_util::GetStringUTF16(IDS_OPTIONS_SETTINGS_SECTION_TITLE_BLUETOOTH)); 70 l10n_util::GetStringUTF16(IDS_OPTIONS_SETTINGS_SECTION_TITLE_BLUETOOTH));
70 localized_strings->SetString("disableBluetooth", 71 localized_strings->SetString("disableBluetooth",
71 l10n_util::GetStringUTF16(IDS_OPTIONS_SETTINGS_BLUETOOTH_DISABLE)); 72 l10n_util::GetStringUTF16(IDS_OPTIONS_SETTINGS_BLUETOOTH_DISABLE));
72 localized_strings->SetString("enableBluetooth", 73 localized_strings->SetString("enableBluetooth",
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 void BluetoothOptionsHandler::ErrorCallback() { 407 void BluetoothOptionsHandler::ErrorCallback() {
407 // TODO(keybuk): we don't get any form of error response from dbus:: 408 // TODO(keybuk): we don't get any form of error response from dbus::
408 // yet, other than an error occurred. I'm going to fix that, then this 409 // yet, other than an error occurred. I'm going to fix that, then this
409 // gets replaced by genuine error information from the method which we 410 // gets replaced by genuine error information from the method which we
410 // can act on, rather than a debug log statement. 411 // can act on, rather than a debug log statement.
411 DVLOG(1) << "Failed."; 412 DVLOG(1) << "Failed.";
412 } 413 }
413 414
414 } // namespace options2 415 } // namespace options2
415 } // namespace chromeos 416 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698