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

Side by Side Diff: content/browser/webui/url_data_manager_backend.cc

Issue 289063002: Put the URL on the stack in URLRequestChromeJob::CompleteRead. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | « 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) 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 "content/browser/webui/url_data_manager_backend.h" 5 #include "content/browser/webui/url_data_manager_backend.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
11 #include "base/command_line.h" 11 #include "base/command_line.h"
12 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
13 #include "base/debug/alias.h"
13 #include "base/debug/trace_event.h" 14 #include "base/debug/trace_event.h"
14 #include "base/lazy_instance.h" 15 #include "base/lazy_instance.h"
15 #include "base/memory/ref_counted.h" 16 #include "base/memory/ref_counted.h"
16 #include "base/memory/ref_counted_memory.h" 17 #include "base/memory/ref_counted_memory.h"
17 #include "base/memory/weak_ptr.h" 18 #include "base/memory/weak_ptr.h"
18 #include "base/message_loop/message_loop.h" 19 #include "base/message_loop/message_loop.h"
19 #include "base/strings/string_util.h" 20 #include "base/strings/string_util.h"
20 #include "base/strings/stringprintf.h" 21 #include "base/strings/stringprintf.h"
21 #include "content/browser/appcache/view_appcache_internals_job.h" 22 #include "content/browser/appcache/view_appcache_internals_job.h"
22 #include "content/browser/fileapi/chrome_blob_storage_context.h" 23 #include "content/browser/fileapi/chrome_blob_storage_context.h"
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 return false; // Tell the caller we're still waiting for data. 335 return false; // Tell the caller we're still waiting for data.
335 } 336 }
336 337
337 // Otherwise, the data is available. 338 // Otherwise, the data is available.
338 CompleteRead(buf, buf_size, bytes_read); 339 CompleteRead(buf, buf_size, bytes_read);
339 return true; 340 return true;
340 } 341 }
341 342
342 void URLRequestChromeJob::CompleteRead(net::IOBuffer* buf, int buf_size, 343 void URLRequestChromeJob::CompleteRead(net::IOBuffer* buf, int buf_size,
343 int* bytes_read) { 344 int* bytes_read) {
345 // http://crbug.com/373841
346 char url_buf[128];
347 base::strlcpy(url_buf, request_->url().spec().c_str(), arraysize(url_buf));
348 base::debug::Alias(url_buf);
349
344 int remaining = static_cast<int>(data_->size()) - data_offset_; 350 int remaining = static_cast<int>(data_->size()) - data_offset_;
345 if (buf_size > remaining) 351 if (buf_size > remaining)
346 buf_size = remaining; 352 buf_size = remaining;
347 if (buf_size > 0) { 353 if (buf_size > 0) {
348 memcpy(buf->data(), data_->front() + data_offset_, buf_size); 354 memcpy(buf->data(), data_->front() + data_offset_, buf_size);
349 data_offset_ += buf_size; 355 data_offset_ += buf_size;
350 } 356 }
351 *bytes_read = buf_size; 357 *bytes_read = buf_size;
352 } 358 }
353 359
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
726 732
727 } // namespace 733 } // namespace
728 734
729 net::URLRequestJobFactory::ProtocolHandler* 735 net::URLRequestJobFactory::ProtocolHandler*
730 CreateDevToolsProtocolHandler(content::ResourceContext* resource_context, 736 CreateDevToolsProtocolHandler(content::ResourceContext* resource_context,
731 bool is_incognito) { 737 bool is_incognito) {
732 return new DevToolsJobFactory(resource_context, is_incognito); 738 return new DevToolsJobFactory(resource_context, is_incognito);
733 } 739 }
734 740
735 } // namespace content 741 } // namespace content
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