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

Side by Side Diff: chrome/browser/extensions/chrome_url_request_util.cc

Issue 702543005: Instrumenting copying string returned by GetRawDataResource to locate the source of jankiness. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
« 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/extensions/chrome_url_request_util.h" 5 #include "chrome/browser/extensions/chrome_url_request_util.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 FROM_HERE_WITH_EXPLICIT_FUNCTION( 68 FROM_HERE_WITH_EXPLICIT_FUNCTION(
69 "422489 URLRequestResourceBundleJob::GetData")); 69 "422489 URLRequestResourceBundleJob::GetData"));
70 70
71 const ResourceBundle& rb = ResourceBundle::GetSharedInstance(); 71 const ResourceBundle& rb = ResourceBundle::GetSharedInstance();
72 72
73 // TODO(vadimt): Remove ScopedTracker below once crbug.com/422489 is fixed. 73 // TODO(vadimt): Remove ScopedTracker below once crbug.com/422489 is fixed.
74 tracked_objects::ScopedTracker tracking_profile1( 74 tracked_objects::ScopedTracker tracking_profile1(
75 FROM_HERE_WITH_EXPLICIT_FUNCTION( 75 FROM_HERE_WITH_EXPLICIT_FUNCTION(
76 "422489 URLRequestResourceBundleJob::GetData 1")); 76 "422489 URLRequestResourceBundleJob::GetData 1"));
77 77
78 *data = rb.GetRawDataResource(resource_id_).as_string(); 78 const base::StringPiece resource_as_string_piece =
79 rb.GetRawDataResource(resource_id_);
80
81 // TODO(vadimt): Remove ScopedTracker below once crbug.com/422489 is fixed.
82 tracked_objects::ScopedTracker tracking_profile15(
83 FROM_HERE_WITH_EXPLICIT_FUNCTION(
84 "422489 URLRequestResourceBundleJob::GetData 1.5"));
85
86 *data = resource_as_string_piece.as_string();
79 87
80 // TODO(vadimt): Remove ScopedTracker below once crbug.com/422489 is fixed. 88 // TODO(vadimt): Remove ScopedTracker below once crbug.com/422489 is fixed.
81 tracked_objects::ScopedTracker tracking_profile2( 89 tracked_objects::ScopedTracker tracking_profile2(
82 FROM_HERE_WITH_EXPLICIT_FUNCTION( 90 FROM_HERE_WITH_EXPLICIT_FUNCTION(
83 "422489 URLRequestResourceBundleJob::GetData 2")); 91 "422489 URLRequestResourceBundleJob::GetData 2"));
84 92
85 // Add the Content-Length header now that we know the resource length. 93 // Add the Content-Length header now that we know the resource length.
86 response_info_.headers->AddHeader( 94 response_info_.headers->AddHeader(
87 base::StringPrintf("%s: %s", 95 base::StringPrintf("%s: %s",
88 net::HttpRequestHeaders::kContentLength, 96 net::HttpRequestHeaders::kContentLength,
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 resource_id, 213 resource_id,
206 content_security_policy, 214 content_security_policy,
207 send_cors_header); 215 send_cors_header);
208 } 216 }
209 } 217 }
210 return NULL; 218 return NULL;
211 } 219 }
212 220
213 } // namespace chrome_url_request_util 221 } // namespace chrome_url_request_util
214 } // namespace extensions 222 } // namespace extensions
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