OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "app/gfx/gl/gl_implementation.h" | 7 #include "app/gfx/gl/gl_implementation.h" |
8 #include "base/at_exit.h" | 8 #include "base/at_exit.h" |
9 #include "base/base64.h" | 9 #include "base/base64.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 } | 457 } |
458 | 458 |
459 std::string MakeURLErrorDescription(const WebKit::WebURLError& error) { | 459 std::string MakeURLErrorDescription(const WebKit::WebURLError& error) { |
460 std::string domain = error.domain.utf8(); | 460 std::string domain = error.domain.utf8(); |
461 int code = error.reason; | 461 int code = error.reason; |
462 | 462 |
463 if (domain == net::kErrorDomain) { | 463 if (domain == net::kErrorDomain) { |
464 domain = "NSURLErrorDomain"; | 464 domain = "NSURLErrorDomain"; |
465 switch (error.reason) { | 465 switch (error.reason) { |
466 case net::ERR_ABORTED: | 466 case net::ERR_ABORTED: |
467 code = -999; | 467 code = -999; // NSURLErrorCancelled |
468 break; | 468 break; |
469 case net::ERR_UNSAFE_PORT: | 469 case net::ERR_UNSAFE_PORT: |
470 // Our unsafe port checking happens at the network stack level, but we | 470 // Our unsafe port checking happens at the network stack level, but we |
471 // make this translation here to match the behavior of stock WebKit. | 471 // make this translation here to match the behavior of stock WebKit. |
472 domain = "WebKitErrorDomain"; | 472 domain = "WebKitErrorDomain"; |
473 code = 103; | 473 code = 103; |
474 break; | 474 break; |
475 case net::ERR_ADDRESS_INVALID: | 475 case net::ERR_ADDRESS_INVALID: |
476 case net::ERR_ADDRESS_UNREACHABLE: | 476 case net::ERR_ADDRESS_UNREACHABLE: |
477 code = -1004; | 477 case net::ERR_NETWORK_ACCESS_DENIED: |
| 478 code = -1004; // NSURLErrorCannotConnectToHost |
478 break; | 479 break; |
479 } | 480 } |
480 } else | 481 } else |
481 DLOG(WARNING) << "Unknown error domain"; | 482 DLOG(WARNING) << "Unknown error domain"; |
482 | 483 |
483 return base::StringPrintf("<NSError domain %s, code %d, failing URL \"%s\">", | 484 return base::StringPrintf("<NSError domain %s, code %d, failing URL \"%s\">", |
484 domain.c_str(), code, error.unreachableURL.spec().data()); | 485 domain.c_str(), code, error.unreachableURL.spec().data()); |
485 } | 486 } |
486 | 487 |
487 WebKit::WebURLError CreateCancelledError(const WebKit::WebURLRequest& request) { | 488 WebKit::WebURLError CreateCancelledError(const WebKit::WebURLRequest& request) { |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
550 callbacks->didFail(WebKit::WebFileErrorSecurity); | 551 callbacks->didFail(WebKit::WebFileErrorSecurity); |
551 } else { | 552 } else { |
552 callbacks->didOpenFileSystem( | 553 callbacks->didOpenFileSystem( |
553 "TestShellFileSystem", | 554 "TestShellFileSystem", |
554 webkit_glue::FilePathToWebString( | 555 webkit_glue::FilePathToWebString( |
555 test_environment->webkit_client()->file_system_root())); | 556 test_environment->webkit_client()->file_system_root())); |
556 } | 557 } |
557 } | 558 } |
558 | 559 |
559 } // namespace webkit_support | 560 } // namespace webkit_support |
OLD | NEW |