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

Side by Side Diff: chrome/browser/debugger/debugger_io_socket.cc

Issue 39206: NO CODE CHANGE. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 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 | « chrome/browser/debugger/debugger_io_socket.h ('k') | chrome/browser/debugger/debugger_node.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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/debugger/debugger_io_socket.h" 5 #include "chrome/browser/debugger/debugger_io_socket.h"
6 6
7 #include "base/string_util.h" 7 #include "base/string_util.h"
8 #include "base/thread.h" 8 #include "base/thread.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/debugger/debugger_shell.h" 10 #include "chrome/browser/debugger/debugger_shell.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 void DebuggerInputOutputSocket::OutputLater(const std::wstring& out, bool lf) { 85 void DebuggerInputOutputSocket::OutputLater(const std::wstring& out, bool lf) {
86 std::string utf8 = WideToUTF8(out); 86 std::string utf8 = WideToUTF8(out);
87 OutputLater(utf8, lf); 87 OutputLater(utf8, lf);
88 } 88 }
89 89
90 void DebuggerInputOutputSocket::OutputLater(const std::string& out, bool lf) { 90 void DebuggerInputOutputSocket::OutputLater(const std::string& out, bool lf) {
91 io_loop_->PostTask(FROM_HERE, NewRunnableMethod( 91 io_loop_->PostTask(FROM_HERE, NewRunnableMethod(
92 this, &DebuggerInputOutputSocket::OutputToSocket, out, lf)); 92 this, &DebuggerInputOutputSocket::OutputToSocket, out, lf));
93 } 93 }
94 94
95 void DebuggerInputOutputSocket::OutputToSocket(const std::string& out, bool lf) { 95 void DebuggerInputOutputSocket::OutputToSocket(const std::string& out,
96 bool lf) {
96 DCHECK(MessageLoop::current() == io_loop_); 97 DCHECK(MessageLoop::current() == io_loop_);
97 if (connection_) { 98 if (connection_) {
98 if (out.length()) { 99 if (out.length()) {
99 connection_->Send(out, lf); 100 connection_->Send(out, lf);
100 } 101 }
101 } else { 102 } else {
102 logging::LogMessage("CONSOLE", 0).stream() << "V8 debugger: " << out; 103 logging::LogMessage("CONSOLE", 0).stream() << "V8 debugger: " << out;
103 } 104 }
104 } 105 }
105 106
(...skipping 13 matching lines...) Expand all
119 DCHECK(MessageLoop::current() == io_loop_); 120 DCHECK(MessageLoop::current() == io_loop_);
120 if (connection_ == sock) { 121 if (connection_ == sock) {
121 connection_ = NULL; 122 connection_ = NULL;
122 sock->Release(); 123 sock->Release();
123 } else { 124 } else {
124 // TODO(erikkay): assert? 125 // TODO(erikkay): assert?
125 } 126 }
126 } 127 }
127 128
128 129
OLDNEW
« no previous file with comments | « chrome/browser/debugger/debugger_io_socket.h ('k') | chrome/browser/debugger/debugger_node.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698