| 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 "webkit/support/webkit_support.h" | 5 #include "webkit/support/webkit_support.h" |
| 6 | 6 |
| 7 #include "base/at_exit.h" | 7 #include "base/at_exit.h" |
| 8 #include "base/base64.h" | 8 #include "base/base64.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| 11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 12 #include "base/debug/debugger.h" | 12 #include "base/debug/debugger.h" |
| 13 #include "base/debug/stack_trace.h" | 13 #include "base/debug/stack_trace.h" |
| 14 #include "base/file_path.h" | 14 #include "base/file_path.h" |
| 15 #include "base/file_util.h" | 15 #include "base/file_util.h" |
| 16 #include "base/files/scoped_temp_dir.h" |
| 16 #include "base/i18n/icu_util.h" | 17 #include "base/i18n/icu_util.h" |
| 17 #include "base/logging.h" | 18 #include "base/logging.h" |
| 18 #include "base/memory/ref_counted.h" | 19 #include "base/memory/ref_counted.h" |
| 19 #include "base/memory/weak_ptr.h" | 20 #include "base/memory/weak_ptr.h" |
| 20 #include "base/message_loop.h" | 21 #include "base/message_loop.h" |
| 21 #include "base/path_service.h" | 22 #include "base/path_service.h" |
| 22 #include "base/process_util.h" | 23 #include "base/process_util.h" |
| 23 #include "base/scoped_temp_dir.h" | |
| 24 #include "base/string_piece.h" | 24 #include "base/string_piece.h" |
| 25 #include "base/string_util.h" | 25 #include "base/string_util.h" |
| 26 #include "base/stringprintf.h" | 26 #include "base/stringprintf.h" |
| 27 #include "base/sys_string_conversions.h" | 27 #include "base/sys_string_conversions.h" |
| 28 #include "base/time.h" | 28 #include "base/time.h" |
| 29 #include "base/utf_string_conversions.h" | 29 #include "base/utf_string_conversions.h" |
| 30 #include "googleurl/src/url_util.h" | 30 #include "googleurl/src/url_util.h" |
| 31 #include "grit/webkit_chromium_resources.h" | 31 #include "grit/webkit_chromium_resources.h" |
| 32 #include "media/base/filter_collection.h" | 32 #include "media/base/filter_collection.h" |
| 33 #include "media/base/media_log.h" | 33 #include "media/base/media_log.h" |
| 34 #include "media/base/message_loop_factory.h" | 34 #include "media/base/message_loop_factory.h" |
| 35 #include "net/base/escape.h" | 35 #include "net/base/escape.h" |
| 36 #include "net/base/net_errors.h" | 36 #include "net/base/net_errors.h" |
| 37 #include "net/base/net_util.h" | 37 #include "net/base/net_util.h" |
| 38 #include "testing/gtest/include/gtest/gtest.h" | 38 #include "testing/gtest/include/gtest/gtest.h" |
| 39 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLError.
h" |
| 39 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCache.h" | 40 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCache.h" |
| 40 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileSystemCallback
s.h" | 41 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileSystemCallback
s.h" |
| 41 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" | 42 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" |
| 42 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginParams.h" | 43 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginParams.h" |
| 43 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageNamespace.h
" | 44 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageNamespace.h
" |
| 44 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 45 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
| 45 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLError.
h" | |
| 46 #if defined(TOOLKIT_GTK) | 46 #if defined(TOOLKIT_GTK) |
| 47 #include "ui/base/keycodes/keyboard_code_conversion_gtk.h" | 47 #include "ui/base/keycodes/keyboard_code_conversion_gtk.h" |
| 48 #endif | 48 #endif |
| 49 #include "ui/gl/gl_context.h" | 49 #include "ui/gl/gl_context.h" |
| 50 #include "ui/gl/gl_implementation.h" | 50 #include "ui/gl/gl_implementation.h" |
| 51 #include "ui/gl/gl_surface.h" | 51 #include "ui/gl/gl_surface.h" |
| 52 #include "webkit/appcache/web_application_cache_host_impl.h" | 52 #include "webkit/appcache/web_application_cache_host_impl.h" |
| 53 #include "webkit/base/file_path_string_conversions.h" | 53 #include "webkit/base/file_path_string_conversions.h" |
| 54 #include "webkit/fileapi/isolated_context.h" | 54 #include "webkit/fileapi/isolated_context.h" |
| 55 #include "webkit/glue/webkit_constants.h" | 55 #include "webkit/glue/webkit_constants.h" |
| (...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 703 return WebURL(); | 703 return WebURL(); |
| 704 | 704 |
| 705 std::string contents_base64; | 705 std::string contents_base64; |
| 706 if (!base::Base64Encode(contents, &contents_base64)) | 706 if (!base::Base64Encode(contents, &contents_base64)) |
| 707 return WebURL(); | 707 return WebURL(); |
| 708 | 708 |
| 709 const char kDataUrlPrefix[] = "data:text/css;charset=utf-8;base64,"; | 709 const char kDataUrlPrefix[] = "data:text/css;charset=utf-8;base64,"; |
| 710 return WebURL(GURL(kDataUrlPrefix + contents_base64)); | 710 return WebURL(GURL(kDataUrlPrefix + contents_base64)); |
| 711 } | 711 } |
| 712 | 712 |
| 713 // A wrapper object for exporting ScopedTempDir to be used | 713 // A wrapper object for exporting base::ScopedTempDir to be used |
| 714 // by webkit layout tests. | 714 // by webkit layout tests. |
| 715 class ScopedTempDirectoryInternal : public ScopedTempDirectory { | 715 class ScopedTempDirectoryInternal : public ScopedTempDirectory { |
| 716 public: | 716 public: |
| 717 virtual bool CreateUniqueTempDir() { | 717 virtual bool CreateUniqueTempDir() { |
| 718 return tempDirectory_.CreateUniqueTempDir(); | 718 return tempDirectory_.CreateUniqueTempDir(); |
| 719 } | 719 } |
| 720 | 720 |
| 721 virtual std::string path() const { | 721 virtual std::string path() const { |
| 722 return tempDirectory_.path().MaybeAsASCII(); | 722 return tempDirectory_.path().MaybeAsASCII(); |
| 723 } | 723 } |
| 724 | 724 |
| 725 private: | 725 private: |
| 726 ScopedTempDir tempDirectory_; | 726 base::ScopedTempDir tempDirectory_; |
| 727 }; | 727 }; |
| 728 | 728 |
| 729 ScopedTempDirectory* CreateScopedTempDirectory() { | 729 ScopedTempDirectory* CreateScopedTempDirectory() { |
| 730 return new ScopedTempDirectoryInternal(); | 730 return new ScopedTempDirectoryInternal(); |
| 731 } | 731 } |
| 732 | 732 |
| 733 int64 GetCurrentTimeInMillisecond() { | 733 int64 GetCurrentTimeInMillisecond() { |
| 734 return base::TimeTicks::Now().ToInternalValue() | 734 return base::TimeTicks::Now().ToInternalValue() |
| 735 / base::Time::kMicrosecondsPerMillisecond; | 735 / base::Time::kMicrosecondsPerMillisecond; |
| 736 } | 736 } |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 869 // Logging | 869 // Logging |
| 870 void EnableWebCoreLogChannels(const std::string& channels) { | 870 void EnableWebCoreLogChannels(const std::string& channels) { |
| 871 webkit_glue::EnableWebCoreLogChannels(channels); | 871 webkit_glue::EnableWebCoreLogChannels(channels); |
| 872 } | 872 } |
| 873 | 873 |
| 874 void SetGamepadData(const WebKit::WebGamepads& pads) { | 874 void SetGamepadData(const WebKit::WebGamepads& pads) { |
| 875 test_environment->webkit_platform_support()->setGamepadData(pads); | 875 test_environment->webkit_platform_support()->setGamepadData(pads); |
| 876 } | 876 } |
| 877 | 877 |
| 878 } // namespace webkit_support | 878 } // namespace webkit_support |
| OLD | NEW |