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

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

Issue 5717008: Use make_scoped_refptr for RefCounted parameter to NewRunnableMethod(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 years 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 | « no previous file | 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/devtools_http_protocol_handler.h" 5 #include "chrome/browser/debugger/devtools_http_protocol_handler.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop_proxy.h" 9 #include "base/message_loop_proxy.h"
10 #include "base/string_number_conversions.h" 10 #include "base/string_number_conversions.h"
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 it2 != it->second.end(); ++it2) { 149 it2 != it->second.end(); ++it2) {
150 net::URLRequest* request = *it2; 150 net::URLRequest* request = *it2;
151 request->Cancel(); 151 request->Cancel();
152 request_to_socket_io_.erase(request); 152 request_to_socket_io_.erase(request);
153 request_to_buffer_io_.erase(request); 153 request_to_buffer_io_.erase(request);
154 delete request; 154 delete request;
155 } 155 }
156 socket_to_requests_io_.erase(socket); 156 socket_to_requests_io_.erase(socket);
157 } 157 }
158 158
159 // This can't use make_scoped_refptr because |socket| is already deleted
160 // when this runs -- http://crbug.com/59930
161 BrowserThread::PostTask( 159 BrowserThread::PostTask(
162 BrowserThread::UI, 160 BrowserThread::UI,
163 FROM_HERE, 161 FROM_HERE,
164 NewRunnableMethod( 162 NewRunnableMethod(
165 this, 163 this,
166 &DevToolsHttpProtocolHandler::OnCloseUI, 164 &DevToolsHttpProtocolHandler::OnCloseUI,
167 socket)); 165 make_scoped_refptr(socket)));
168 } 166 }
169 167
170 void DevToolsHttpProtocolHandler::OnHttpRequestUI( 168 void DevToolsHttpProtocolHandler::OnHttpRequestUI(
171 HttpListenSocket* socket, 169 HttpListenSocket* socket,
172 const HttpServerRequestInfo& info) { 170 const HttpServerRequestInfo& info) {
173 std::string response = "<html><body>"; 171 std::string response = "<html><body>";
174 for (BrowserList::const_iterator it = BrowserList::begin(), 172 for (BrowserList::const_iterator it = BrowserList::begin(),
175 end = BrowserList::end(); it != end; ++it) { 173 end = BrowserList::end(); it != end; ++it) {
176 TabStripModel* model = (*it)->tabstrip_model(); 174 TabStripModel* model = (*it)->tabstrip_model();
177 for (int i = 0, size = model->count(); i < size; ++i) { 175 for (int i = 0, size = model->count(); i < size; ++i) {
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 TabStripModel* model = (*it)->tabstrip_model(); 410 TabStripModel* model = (*it)->tabstrip_model();
413 for (int i = 0, size = model->count(); i < size; ++i) { 411 for (int i = 0, size = model->count(); i < size; ++i) {
414 NavigationController& controller = 412 NavigationController& controller =
415 model->GetTabContentsAt(i)->controller(); 413 model->GetTabContentsAt(i)->controller();
416 if (controller.session_id().id() == session_id) 414 if (controller.session_id().id() == session_id)
417 return controller.tab_contents(); 415 return controller.tab_contents();
418 } 416 }
419 } 417 }
420 return NULL; 418 return NULL;
421 } 419 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698