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/pepper/pepper_flash_renderer_host.h" | 5 #include "chrome/renderer/pepper/pepper_flash_renderer_host.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 for (size_t i = 0; i < arraysize(kRejectedHttpRequestHeaders); ++i) | 308 for (size_t i = 0; i < arraysize(kRejectedHttpRequestHeaders); ++i) |
309 rejected_headers[kRejectedHttpRequestHeaders[i]] = | 309 rejected_headers[kRejectedHttpRequestHeaders[i]] = |
310 static_cast<FlashNavigateUsage>(i); | 310 static_cast<FlashNavigateUsage>(i); |
311 } | 311 } |
312 | 312 |
313 net::HttpUtil::HeadersIterator header_iter( | 313 net::HttpUtil::HeadersIterator header_iter( |
314 data.headers.begin(), data.headers.end(), "\n\r"); | 314 data.headers.begin(), data.headers.end(), "\n\r"); |
315 bool rejected = false; | 315 bool rejected = false; |
316 while (header_iter.GetNext()) { | 316 while (header_iter.GetNext()) { |
317 std::string lower_case_header_name = | 317 std::string lower_case_header_name = |
318 base::StringToLowerASCII(header_iter.name()); | 318 base::ToLowerASCII(header_iter.name()); |
319 if (!IsSimpleHeader(lower_case_header_name, header_iter.values())) { | 319 if (!IsSimpleHeader(lower_case_header_name, header_iter.values())) { |
320 rejected = true; | 320 rejected = true; |
321 | 321 |
322 std::map<std::string, FlashNavigateUsage>::const_iterator iter = | 322 std::map<std::string, FlashNavigateUsage>::const_iterator iter = |
323 rejected_headers.find(lower_case_header_name); | 323 rejected_headers.find(lower_case_header_name); |
324 FlashNavigateUsage usage = | 324 FlashNavigateUsage usage = |
325 iter != rejected_headers.end() ? iter->second : REJECT_OTHER_HEADERS; | 325 iter != rejected_headers.end() ? iter->second : REJECT_OTHER_HEADERS; |
326 RecordFlashNavigateUsage(usage); | 326 RecordFlashNavigateUsage(usage); |
327 } | 327 } |
328 } | 328 } |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 rect.point.x, rect.point.y, rect.size.width, rect.size.height))) | 370 rect.point.x, rect.point.y, rect.size.width, rect.size.height))) |
371 return PP_OK; | 371 return PP_OK; |
372 return PP_ERROR_FAILED; | 372 return PP_ERROR_FAILED; |
373 } | 373 } |
374 | 374 |
375 int32_t PepperFlashRendererHost::OnInvokePrinting( | 375 int32_t PepperFlashRendererHost::OnInvokePrinting( |
376 ppapi::host::HostMessageContext* host_context) { | 376 ppapi::host::HostMessageContext* host_context) { |
377 pdf::PepperPDFHost::InvokePrintingForInstance(pp_instance()); | 377 pdf::PepperPDFHost::InvokePrintingForInstance(pp_instance()); |
378 return PP_OK; | 378 return PP_OK; |
379 } | 379 } |
OLD | NEW |