OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |