Chromium Code Reviews| 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 // NSURLErrorCancelled | |
|
wtc
2010/11/17 22:08:30
Nit: I'd prefer that you put these comments after
| |
| 467 code = -999; | 468 code = -999; |
| 468 break; | 469 break; |
| 469 case net::ERR_UNSAFE_PORT: | 470 case net::ERR_UNSAFE_PORT: |
| 470 // Our unsafe port checking happens at the network stack level, but we | 471 // Our unsafe port checking happens at the network stack level, but we |
| 471 // make this translation here to match the behavior of stock WebKit. | 472 // make this translation here to match the behavior of stock WebKit. |
| 472 domain = "WebKitErrorDomain"; | 473 domain = "WebKitErrorDomain"; |
| 473 code = 103; | 474 code = 103; |
| 474 break; | 475 break; |
| 475 case net::ERR_ADDRESS_INVALID: | 476 case net::ERR_ADDRESS_INVALID: |
| 476 case net::ERR_ADDRESS_UNREACHABLE: | 477 case net::ERR_ADDRESS_UNREACHABLE: |
| 478 case net::ERR_NETWORK_ACCESS_DENIED: | |
| 479 // NSURLErrorCannotConnectToHost | |
| 477 code = -1004; | 480 code = -1004; |
| 478 break; | 481 break; |
| 479 } | 482 } |
| 480 } else | 483 } else |
| 481 DLOG(WARNING) << "Unknown error domain"; | 484 DLOG(WARNING) << "Unknown error domain"; |
| 482 | 485 |
| 483 return base::StringPrintf("<NSError domain %s, code %d, failing URL \"%s\">", | 486 return base::StringPrintf("<NSError domain %s, code %d, failing URL \"%s\">", |
| 484 domain.c_str(), code, error.unreachableURL.spec().data()); | 487 domain.c_str(), code, error.unreachableURL.spec().data()); |
| 485 } | 488 } |
| 486 | 489 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 550 callbacks->didFail(WebKit::WebFileErrorSecurity); | 553 callbacks->didFail(WebKit::WebFileErrorSecurity); |
| 551 } else { | 554 } else { |
| 552 callbacks->didOpenFileSystem( | 555 callbacks->didOpenFileSystem( |
| 553 "TestShellFileSystem", | 556 "TestShellFileSystem", |
| 554 webkit_glue::FilePathToWebString( | 557 webkit_glue::FilePathToWebString( |
| 555 test_environment->webkit_client()->file_system_root())); | 558 test_environment->webkit_client()->file_system_root())); |
| 556 } | 559 } |
| 557 } | 560 } |
| 558 | 561 |
| 559 } // namespace webkit_support | 562 } // namespace webkit_support |
| OLD | NEW |