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

Side by Side Diff: ipc/ipc_channel_win.cc

Issue 10383167: PPAPI/NaCl: Fix leaky NaClIPCAdapter test. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 8 years, 7 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 | « ipc/ipc_channel_posix.cc ('k') | tools/heapcheck/suppressions.txt » ('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 "ipc/ipc_channel_win.h" 5 #include "ipc/ipc_channel_win.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 455
456 Channel::~Channel() { 456 Channel::~Channel() {
457 delete channel_impl_; 457 delete channel_impl_;
458 } 458 }
459 459
460 bool Channel::Connect() { 460 bool Channel::Connect() {
461 return channel_impl_->Connect(); 461 return channel_impl_->Connect();
462 } 462 }
463 463
464 void Channel::Close() { 464 void Channel::Close() {
465 channel_impl_->Close(); 465 if (channel_impl_)
466 channel_impl_->Close();
466 } 467 }
467 468
468 void Channel::set_listener(Listener* listener) { 469 void Channel::set_listener(Listener* listener) {
469 channel_impl_->set_listener(listener); 470 channel_impl_->set_listener(listener);
470 } 471 }
471 472
472 base::ProcessId Channel::peer_pid() const { 473 base::ProcessId Channel::peer_pid() const {
473 return channel_impl_->peer_pid(); 474 return channel_impl_->peer_pid();
474 } 475 }
475 476
(...skipping 20 matching lines...) Expand all
496 int secret; 497 int secret;
497 do { // Guarantee we get a non-zero value. 498 do { // Guarantee we get a non-zero value.
498 secret = base::RandInt(0, std::numeric_limits<int>::max()); 499 secret = base::RandInt(0, std::numeric_limits<int>::max());
499 } while (secret == 0); 500 } while (secret == 0);
500 501
501 id.append(GenerateUniqueRandomChannelID()); 502 id.append(GenerateUniqueRandomChannelID());
502 return id.append(base::StringPrintf("\\%d", secret)); 503 return id.append(base::StringPrintf("\\%d", secret));
503 } 504 }
504 505
505 } // namespace IPC 506 } // namespace IPC
OLDNEW
« no previous file with comments | « ipc/ipc_channel_posix.cc ('k') | tools/heapcheck/suppressions.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698