| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "webkit/glue/webkit_glue.h" | 5 #include "webkit/glue/webkit_glue.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "third_party/WebKit/public/platform/WebFileInfo.h" | 8 #include "third_party/WebKit/public/platform/WebFileInfo.h" |
| 9 #include "v8/include/v8.h" | |
| 10 | 9 |
| 11 namespace webkit_glue { | 10 namespace webkit_glue { |
| 12 | 11 |
| 13 void SetJavaScriptFlags(const std::string& str) { | |
| 14 v8::V8::SetFlagsFromString(str.data(), static_cast<int>(str.size())); | |
| 15 } | |
| 16 | |
| 17 void FileInfoToWebFileInfo( | 12 void FileInfoToWebFileInfo( |
| 18 const base::File::Info& file_info, | 13 const base::File::Info& file_info, |
| 19 blink::WebFileInfo* web_file_info) { | 14 blink::WebFileInfo* web_file_info) { |
| 20 DCHECK(web_file_info); | 15 DCHECK(web_file_info); |
| 21 // WebKit now expects NaN as uninitialized/null Date. | 16 // WebKit now expects NaN as uninitialized/null Date. |
| 22 if (file_info.last_modified.is_null()) | 17 if (file_info.last_modified.is_null()) |
| 23 web_file_info->modificationTime = std::numeric_limits<double>::quiet_NaN(); | 18 web_file_info->modificationTime = std::numeric_limits<double>::quiet_NaN(); |
| 24 else | 19 else |
| 25 web_file_info->modificationTime = file_info.last_modified.ToDoubleT(); | 20 web_file_info->modificationTime = file_info.last_modified.ToDoubleT(); |
| 26 web_file_info->length = file_info.size; | 21 web_file_info->length = file_info.size; |
| 27 if (file_info.is_directory) | 22 if (file_info.is_directory) |
| 28 web_file_info->type = blink::WebFileInfo::TypeDirectory; | 23 web_file_info->type = blink::WebFileInfo::TypeDirectory; |
| 29 else | 24 else |
| 30 web_file_info->type = blink::WebFileInfo::TypeFile; | 25 web_file_info->type = blink::WebFileInfo::TypeFile; |
| 31 } | 26 } |
| 32 | 27 |
| 33 COMPILE_ASSERT(std::numeric_limits<double>::has_quiet_NaN, has_quiet_NaN); | 28 COMPILE_ASSERT(std::numeric_limits<double>::has_quiet_NaN, has_quiet_NaN); |
| 34 | 29 |
| 35 } // namespace webkit_glue | 30 } // namespace webkit_glue |
| OLD | NEW |