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

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

Issue 5012005: Modify GetErrorDescription to give a -1004 on NETWORK_ACCESS_DENIED (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 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 | webkit/tools/layout_tests/test_expectations.txt » ('j') | 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) 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
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
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
OLDNEW
« no previous file with comments | « no previous file | webkit/tools/layout_tests/test_expectations.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698