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

Side by Side Diff: chrome/browser/extensions/api/socket/socket_api.cc

Issue 10828012: Coverity: Initialize member variables. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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 | « chrome/browser/extensions/api/cookies/cookies_api.cc ('k') | 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/extensions/api/socket/socket_api.h" 5 #include "chrome/browser/extensions/api/socket/socket_api.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "chrome/browser/browser_process.h" 8 #include "chrome/browser/browser_process.h"
9 #include "chrome/browser/extensions/api/dns/host_resolver_wrapper.h" 9 #include "chrome/browser/extensions/api/dns/host_resolver_wrapper.h"
10 #include "chrome/browser/extensions/api/socket/socket.h" 10 #include "chrome/browser/extensions/api/socket/socket.h"
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 136
137 bool SocketDestroyFunction::Prepare() { 137 bool SocketDestroyFunction::Prepare() {
138 EXTENSION_FUNCTION_VALIDATE(args_->GetInteger(0, &socket_id_)); 138 EXTENSION_FUNCTION_VALIDATE(args_->GetInteger(0, &socket_id_));
139 return true; 139 return true;
140 } 140 }
141 141
142 void SocketDestroyFunction::Work() { 142 void SocketDestroyFunction::Work() {
143 manager_->Remove(socket_id_); 143 manager_->Remove(socket_id_);
144 } 144 }
145 145
146 SocketConnectFunction::SocketConnectFunction() { 146 SocketConnectFunction::SocketConnectFunction()
147 : socket_id_(0),
148 port_(0) {
147 } 149 }
148 150
149 SocketConnectFunction::~SocketConnectFunction() { 151 SocketConnectFunction::~SocketConnectFunction() {
150 } 152 }
151 153
152 bool SocketConnectFunction::Prepare() { 154 bool SocketConnectFunction::Prepare() {
153 EXTENSION_FUNCTION_VALIDATE(args_->GetInteger(0, &socket_id_)); 155 EXTENSION_FUNCTION_VALIDATE(args_->GetInteger(0, &socket_id_));
154 EXTENSION_FUNCTION_VALIDATE(args_->GetString(1, &hostname_)); 156 EXTENSION_FUNCTION_VALIDATE(args_->GetString(1, &hostname_));
155 EXTENSION_FUNCTION_VALIDATE(args_->GetInteger(2, &port_)); 157 EXTENSION_FUNCTION_VALIDATE(args_->GetInteger(2, &port_));
156 return true; 158 return true;
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 bool result = false; 443 bool result = false;
442 Socket* socket = manager_->Get(params_->socket_id); 444 Socket* socket = manager_->Get(params_->socket_id);
443 if (socket) 445 if (socket)
444 result = socket->SetNoDelay(params_->no_delay); 446 result = socket->SetNoDelay(params_->no_delay);
445 else 447 else
446 error_ = kSocketNotFoundError; 448 error_ = kSocketNotFoundError;
447 SetResult(Value::CreateBooleanValue(result)); 449 SetResult(Value::CreateBooleanValue(result));
448 } 450 }
449 451
450 } // namespace extensions 452 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/cookies/cookies_api.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698