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

Side by Side Diff: ipc/ipc_channel_win.cc

Issue 1954543002: Remove handler from MessagePumpForIO::IOContext. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove_observers
Patch Set: CR thestig #17 Created 4 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
« no previous file with comments | « ipc/ipc_channel_win.h ('k') | mojo/edk/system/channel_win.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 "ipc/ipc_channel_win.h" 5 #include "ipc/ipc_channel_win.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 10 matching lines...) Expand all
21 #include "base/threading/thread_checker.h" 21 #include "base/threading/thread_checker.h"
22 #include "base/win/scoped_handle.h" 22 #include "base/win/scoped_handle.h"
23 #include "ipc/attachment_broker.h" 23 #include "ipc/attachment_broker.h"
24 #include "ipc/ipc_listener.h" 24 #include "ipc/ipc_listener.h"
25 #include "ipc/ipc_logging.h" 25 #include "ipc/ipc_logging.h"
26 #include "ipc/ipc_message_attachment_set.h" 26 #include "ipc/ipc_message_attachment_set.h"
27 #include "ipc/ipc_message_utils.h" 27 #include "ipc/ipc_message_utils.h"
28 28
29 namespace IPC { 29 namespace IPC {
30 30
31 ChannelWin::State::State(ChannelWin* channel) : is_pending(false) { 31 ChannelWin::State::State() = default;
32 memset(&context.overlapped, 0, sizeof(context.overlapped));
33 context.handler = channel;
34 }
35 32
36 ChannelWin::State::~State() { 33 ChannelWin::State::~State() {
37 static_assert(offsetof(ChannelWin::State, context) == 0, 34 static_assert(offsetof(ChannelWin::State, context) == 0,
38 "ChannelWin::State should have context as its first data" 35 "ChannelWin::State should have context as its first data"
39 "member."); 36 "member.");
40 } 37 }
41 38
42 ChannelWin::ChannelWin(const IPC::ChannelHandle& channel_handle, 39 ChannelWin::ChannelWin(const IPC::ChannelHandle& channel_handle,
43 Mode mode, 40 Mode mode,
44 Listener* listener) 41 Listener* listener)
45 : ChannelReader(listener), 42 : ChannelReader(listener),
46 input_state_(this),
47 output_state_(this),
48 peer_pid_(base::kNullProcessId), 43 peer_pid_(base::kNullProcessId),
49 waiting_connect_(mode & MODE_SERVER_FLAG), 44 waiting_connect_(mode & MODE_SERVER_FLAG),
50 processing_incoming_(false), 45 processing_incoming_(false),
51 validate_client_(false), 46 validate_client_(false),
52 client_secret_(0), 47 client_secret_(0),
53 weak_factory_(this) { 48 weak_factory_(this) {
54 CreatePipe(channel_handle, mode); 49 CreatePipe(channel_handle, mode);
55 } 50 }
56 51
57 ChannelWin::~ChannelWin() { 52 ChannelWin::~ChannelWin() {
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after
606 int secret; 601 int secret;
607 do { // Guarantee we get a non-zero value. 602 do { // Guarantee we get a non-zero value.
608 secret = base::RandInt(0, std::numeric_limits<int>::max()); 603 secret = base::RandInt(0, std::numeric_limits<int>::max());
609 } while (secret == 0); 604 } while (secret == 0);
610 605
611 id.append(GenerateUniqueRandomChannelID()); 606 id.append(GenerateUniqueRandomChannelID());
612 return id.append(base::StringPrintf("\\%d", secret)); 607 return id.append(base::StringPrintf("\\%d", secret));
613 } 608 }
614 609
615 } // namespace IPC 610 } // namespace IPC
OLDNEW
« no previous file with comments | « ipc/ipc_channel_win.h ('k') | mojo/edk/system/channel_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698