OLD | NEW |
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/renderer/chrome_render_view_observer.h" | 5 #include "chrome/renderer/chrome_render_view_observer.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 if (cmd == kJavaScriptStressTestSetStressRunType) { | 320 if (cmd == kJavaScriptStressTestSetStressRunType) { |
321 v8::Testing::SetStressRunType(static_cast<v8::Testing::StressType>(param)); | 321 v8::Testing::SetStressRunType(static_cast<v8::Testing::StressType>(param)); |
322 } else if (cmd == kJavaScriptStressTestPrepareStressRun) { | 322 } else if (cmd == kJavaScriptStressTestPrepareStressRun) { |
323 v8::Testing::PrepareStressRun(param); | 323 v8::Testing::PrepareStressRun(param); |
324 } | 324 } |
325 } | 325 } |
326 | 326 |
327 void ChromeRenderViewObserver::OnDownloadFavicon(int id, | 327 void ChromeRenderViewObserver::OnDownloadFavicon(int id, |
328 const GURL& image_url, | 328 const GURL& image_url, |
329 int image_size) { | 329 int image_size) { |
| 330 // I don't have much of an opinion on whether IconMsg_DownloadFavicon decodes |
| 331 // just a single frame for an .ico file or attempts to decode frames for all |
| 332 // ui::GetSupportedScaleFactors() / gfx::Screen::GetScaleFactorsInUse(). I |
| 333 // expect other people to have opinions though. Check with oshima@, he might |
| 334 // have an opinion about this. Please ping me if you want to discuss or if |
| 335 // something I wrote is confusing. |
330 bool data_image_failed = false; | 336 bool data_image_failed = false; |
331 if (image_url.SchemeIs("data")) { | 337 if (image_url.SchemeIs("data")) { |
332 SkBitmap data_image = ImageFromDataUrl(image_url); | 338 SkBitmap data_image = ImageFromDataUrl(image_url); |
333 data_image_failed = data_image.empty(); | 339 data_image_failed = data_image.empty(); |
334 if (!data_image_failed) { | 340 if (!data_image_failed) { |
335 Send(new IconHostMsg_DidDownloadFavicon( | 341 Send(new IconHostMsg_DidDownloadFavicon( |
336 routing_id(), id, image_url, false, data_image)); | 342 routing_id(), id, image_url, false, data_image)); |
337 } | 343 } |
338 } | 344 } |
339 | 345 |
(...skipping 743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1083 reinterpret_cast<const unsigned char*>(&data[0]); | 1089 reinterpret_cast<const unsigned char*>(&data[0]); |
1084 | 1090 |
1085 return decoder.Decode(src_data, data.size()); | 1091 return decoder.Decode(src_data, data.size()); |
1086 } | 1092 } |
1087 return SkBitmap(); | 1093 return SkBitmap(); |
1088 } | 1094 } |
1089 | 1095 |
1090 bool ChromeRenderViewObserver::IsStrictSecurityHost(const std::string& host) { | 1096 bool ChromeRenderViewObserver::IsStrictSecurityHost(const std::string& host) { |
1091 return (strict_security_hosts_.find(host) != strict_security_hosts_.end()); | 1097 return (strict_security_hosts_.find(host) != strict_security_hosts_.end()); |
1092 } | 1098 } |
OLD | NEW |