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

Unified Diff: net/url_request/url_request_simple_job.cc

Issue 654683002: Adding instrumentation to locate the source of jankiness. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_simple_job.cc
diff --git a/net/url_request/url_request_simple_job.cc b/net/url_request/url_request_simple_job.cc
index f266e3b505d05ea37b7e237ce91e8dbc472c0937..a02da27d2611575585fdcdb037cc11ebf3e67eff 100644
--- a/net/url_request/url_request_simple_job.cc
+++ b/net/url_request/url_request_simple_job.cc
@@ -9,6 +9,7 @@
#include "base/bind.h"
#include "base/compiler_specific.h"
#include "base/message_loop/message_loop.h"
+#include "base/profiler/scoped_profile.h"
#include "net/base/io_buffer.h"
#include "net/base/net_errors.h"
#include "net/http/http_request_headers.h"
@@ -60,6 +61,11 @@ void URLRequestSimpleJob::StartAsync() {
return;
if (ranges().size() > 1) {
+ // TODO(vadimt): Remove ScopedProfile below once crbug.com/422489 is fixed.
+ tracked_objects::ScopedProfile tracking_profile(
+ FROM_HERE_WITH_EXPLICIT_FUNCTION(
+ "422489 URLRequestSimpleJob::StartAsync 1"));
+
NotifyDone(URLRequestStatus(URLRequestStatus::FAILED,
ERR_REQUEST_RANGE_NOT_SATISFIABLE));
return;
@@ -68,11 +74,29 @@ void URLRequestSimpleJob::StartAsync() {
if (!ranges().empty() && range_parse_result() == OK)
byte_range_ = ranges().front();
- int result = GetData(&mime_type_, &charset_, &data_,
- base::Bind(&URLRequestSimpleJob::OnGetDataCompleted,
- weak_factory_.GetWeakPtr()));
- if (result != ERR_IO_PENDING)
+ int result;
+ {
+ // TODO(vadimt): Remove ScopedProfile below once crbug.com/422489 is fixed.
+ // Remove the block and assign 'result' in its declaration.
+ tracked_objects::ScopedProfile tracking_profile(
+ FROM_HERE_WITH_EXPLICIT_FUNCTION(
+ "422489 URLRequestSimpleJob::StartAsync 2"));
+
+ result = GetData(&mime_type_,
+ &charset_,
+ &data_,
+ base::Bind(&URLRequestSimpleJob::OnGetDataCompleted,
+ weak_factory_.GetWeakPtr()));
+ }
+
+ if (result != ERR_IO_PENDING) {
+ // TODO(vadimt): Remove ScopedProfile below once crbug.com/422489 is fixed.
+ tracked_objects::ScopedProfile tracking_profile(
+ FROM_HERE_WITH_EXPLICIT_FUNCTION(
+ "422489 URLRequestSimpleJob::StartAsync 3"));
+
OnGetDataCompleted(result);
+ }
}
void URLRequestSimpleJob::OnGetDataCompleted(int result) {
« 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