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

Side by Side Diff: chrome/browser/ui/webui/devtools_ui.cc

Issue 1117703002: Adjust URLFetcher::Create API so that object is returned as scoped_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix another failure missed by my regex Created 5 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
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/ui/webui/devtools_ui.h" 5 #include "chrome/browser/ui/webui/devtools_ui.h"
6 6
7 #include "base/memory/ref_counted_memory.h" 7 #include "base/memory/ref_counted_memory.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 int render_frame_id, 201 int render_frame_id,
202 const content::URLDataSource::GotDataCallback& callback) { 202 const content::URLDataSource::GotDataCallback& callback) {
203 GURL url = GURL(kRemoteFrontendBase + path); 203 GURL url = GURL(kRemoteFrontendBase + path);
204 CHECK_EQ(url.host(), kRemoteFrontendDomain); 204 CHECK_EQ(url.host(), kRemoteFrontendDomain);
205 if (!url.is_valid()) { 205 if (!url.is_valid()) {
206 callback.Run( 206 callback.Run(
207 new base::RefCountedStaticMemory(kHttpNotFound, strlen(kHttpNotFound))); 207 new base::RefCountedStaticMemory(kHttpNotFound, strlen(kHttpNotFound)));
208 return; 208 return;
209 } 209 }
210 net::URLFetcher* fetcher = 210 net::URLFetcher* fetcher =
211 net::URLFetcher::Create(url, net::URLFetcher::GET, this); 211 net::URLFetcher::Create(url, net::URLFetcher::GET, this).release();
Ryan Sleevi 2015/04/30 18:23:45 line 212
212 pending_[fetcher] = callback; 212 pending_[fetcher] = callback;
213 fetcher->SetRequestContext(request_context_.get()); 213 fetcher->SetRequestContext(request_context_.get());
214 fetcher->Start(); 214 fetcher->Start();
215 } 215 }
216 216
217 void DevToolsDataSource::OnURLFetchComplete(const net::URLFetcher* source) { 217 void DevToolsDataSource::OnURLFetchComplete(const net::URLFetcher* source) {
218 DCHECK(source); 218 DCHECK(source);
219 PendingRequestsMap::iterator it = pending_.find(source); 219 PendingRequestsMap::iterator it = pending_.find(source);
220 DCHECK(it != pending_.end()); 220 DCHECK(it != pending_.end());
221 std::string response; 221 std::string response;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 bindings_(web_ui->GetWebContents()) { 255 bindings_(web_ui->GetWebContents()) {
256 web_ui->SetBindings(0); 256 web_ui->SetBindings(0);
257 Profile* profile = Profile::FromWebUI(web_ui); 257 Profile* profile = Profile::FromWebUI(web_ui);
258 content::URLDataSource::Add( 258 content::URLDataSource::Add(
259 profile, 259 profile,
260 new DevToolsDataSource(profile->GetRequestContext())); 260 new DevToolsDataSource(profile->GetRequestContext()));
261 } 261 }
262 262
263 DevToolsUI::~DevToolsUI() { 263 DevToolsUI::~DevToolsUI() {
264 } 264 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698