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

Side by Side Diff: chrome/service/cloud_print/cloud_print_connector.cc

Issue 10874054: Add WARN_UNUSED_RESULT to scoped_refptr::release. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Don't assign NULL to pointer to scoped_refptr. Created 8 years, 4 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
« no previous file with comments | « chrome/browser/ui/webui/tracing_ui.cc ('k') | gpu/command_buffer/service/context_group.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 "chrome/service/cloud_print/cloud_print_connector.h" 5 #include "chrome/service/cloud_print/cloud_print_connector.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/md5.h" 9 #include "base/md5.h"
10 #include "base/rand_util.h" 10 #include "base/rand_util.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 return false; // No memory. 47 return false; // No memory.
48 } 48 }
49 if (print_system_settings_.get()) { 49 if (print_system_settings_.get()) {
50 bool delete_on_enum_fail = false; 50 bool delete_on_enum_fail = false;
51 print_system_settings_->GetBoolean(kDeleteOnEnumFail, 51 print_system_settings_->GetBoolean(kDeleteOnEnumFail,
52 &delete_on_enum_fail); 52 &delete_on_enum_fail);
53 delete_on_enum_fail_ = delete_on_enum_fail; 53 delete_on_enum_fail_ = delete_on_enum_fail;
54 } 54 }
55 cloud_print::PrintSystem::PrintSystemResult result = print_system_->Init(); 55 cloud_print::PrintSystem::PrintSystemResult result = print_system_->Init();
56 if (!result.succeeded()) { 56 if (!result.succeeded()) {
57 print_system_.release(); 57 print_system_ = NULL;
58 // We could not initialize the print system. We need to notify the server. 58 // We could not initialize the print system. We need to notify the server.
59 ReportUserMessage(kPrintSystemFailedMessageId, result.message()); 59 ReportUserMessage(kPrintSystemFailedMessageId, result.message());
60 return false; 60 return false;
61 } 61 }
62 return true; 62 return true;
63 } 63 }
64 64
65 bool CloudPrintConnector::Start() { 65 bool CloudPrintConnector::Start() {
66 VLOG(1) << "CP_CONNECTOR: Starting connector" 66 VLOG(1) << "CP_CONNECTOR: Starting connector"
67 << ", proxy id: " << proxy_id_; 67 << ", proxy id: " << proxy_id_;
(...skipping 11 matching lines...) Expand all
79 AddPendingAvailableTask(); 79 AddPendingAvailableTask();
80 return true; 80 return true;
81 } 81 }
82 82
83 void CloudPrintConnector::Stop() { 83 void CloudPrintConnector::Stop() {
84 VLOG(1) << "CP_CONNECTOR: Stopping connector" 84 VLOG(1) << "CP_CONNECTOR: Stopping connector"
85 << ", proxy id: " << proxy_id_; 85 << ", proxy id: " << proxy_id_;
86 DCHECK(IsRunning()); 86 DCHECK(IsRunning());
87 // Do uninitialization here. 87 // Do uninitialization here.
88 pending_tasks_.clear(); 88 pending_tasks_.clear();
89 print_server_watcher_.release(); 89 print_server_watcher_ = NULL;
90 request_ = NULL; 90 request_ = NULL;
91 } 91 }
92 92
93 bool CloudPrintConnector::IsRunning() { 93 bool CloudPrintConnector::IsRunning() {
94 return print_server_watcher_.get() != NULL; 94 return print_server_watcher_.get() != NULL;
95 } 95 }
96 96
97 void CloudPrintConnector::GetPrinterIds(std::list<std::string>* printer_ids) { 97 void CloudPrintConnector::GetPrinterIds(std::list<std::string>* printer_ids) {
98 DCHECK(printer_ids); 98 DCHECK(printer_ids);
99 printer_ids->clear(); 99 printer_ids->clear();
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after
581 kCloudPrintAPIMaxRetryCount, 581 kCloudPrintAPIMaxRetryCount,
582 mime_type, 582 mime_type,
583 post_data, 583 post_data,
584 &CloudPrintConnector::HandleRegisterPrinterResponse); 584 &CloudPrintConnector::HandleRegisterPrinterResponse);
585 } 585 }
586 586
587 bool CloudPrintConnector::IsSamePrinter(const std::string& name1, 587 bool CloudPrintConnector::IsSamePrinter(const std::string& name1,
588 const std::string& name2) const { 588 const std::string& name2) const {
589 return (0 == base::strcasecmp(name1.c_str(), name2.c_str())); 589 return (0 == base::strcasecmp(name1.c_str(), name2.c_str()));
590 } 590 }
591
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/tracing_ui.cc ('k') | gpu/command_buffer/service/context_group.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698