Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(398)

Side by Side Diff: webkit/support/webkit_support.cc

Issue 11366024: DRT should handle relative path arguments. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
(...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 WebURL CreateURLForPathOrURL(const std::string& path_or_url_in_nativemb) { 629 WebURL CreateURLForPathOrURL(const std::string& path_or_url_in_nativemb) {
630 // NativeMB to UTF-8 630 // NativeMB to UTF-8
631 std::wstring wide_path_or_url 631 std::wstring wide_path_or_url
632 = base::SysNativeMBToWide(path_or_url_in_nativemb); 632 = base::SysNativeMBToWide(path_or_url_in_nativemb);
633 std::string path_or_url_in_utf8 = WideToUTF8(wide_path_or_url); 633 std::string path_or_url_in_utf8 = WideToUTF8(wide_path_or_url);
634 634
635 GURL url(path_or_url_in_utf8); 635 GURL url(path_or_url_in_utf8);
636 if (url.is_valid() && url.has_scheme()) 636 if (url.is_valid() && url.has_scheme())
637 return WebURL(url); 637 return WebURL(url);
638 #if defined(OS_WIN) 638 #if defined(OS_WIN)
639 return net::FilePathToFileURL(FilePath(wide_path_or_url)); 639 FilePath path(wide_path_or_url);
640 #else 640 #else
641 return net::FilePathToFileURL(FilePath(path_or_url_in_nativemb)); 641 FilePath path(path_or_url_in_nativemb);
642 #endif 642 #endif
643 file_util::AbsolutePath(&path);
644 return net::FilePathToFileURL(path);
643 } 645 }
644 646
645 WebURL RewriteLayoutTestsURL(const std::string& utf8_url) { 647 WebURL RewriteLayoutTestsURL(const std::string& utf8_url) {
646 const char kPrefix[] = "file:///tmp/LayoutTests/"; 648 const char kPrefix[] = "file:///tmp/LayoutTests/";
647 const int kPrefixLen = arraysize(kPrefix) - 1; 649 const int kPrefixLen = arraysize(kPrefix) - 1;
648 650
649 if (utf8_url.compare(0, kPrefixLen, kPrefix, kPrefixLen)) 651 if (utf8_url.compare(0, kPrefixLen, kPrefix, kPrefixLen))
650 return WebURL(GURL(utf8_url)); 652 return WebURL(GURL(utf8_url));
651 653
652 FilePath replacePath = 654 FilePath replacePath =
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
866 // Logging 868 // Logging
867 void EnableWebCoreLogChannels(const std::string& channels) { 869 void EnableWebCoreLogChannels(const std::string& channels) {
868 webkit_glue::EnableWebCoreLogChannels(channels); 870 webkit_glue::EnableWebCoreLogChannels(channels);
869 } 871 }
870 872
871 void SetGamepadData(const WebKit::WebGamepads& pads) { 873 void SetGamepadData(const WebKit::WebGamepads& pads) {
872 test_environment->webkit_platform_support()->setGamepadData(pads); 874 test_environment->webkit_platform_support()->setGamepadData(pads);
873 } 875 }
874 876
875 } // namespace webkit_support 877 } // namespace webkit_support
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698