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

Side by Side Diff: Source/platform/exported/WebURLError.cpp

Issue 138493002: Added field to error structures to signal existence of a stale copy in (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 11 months 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
« no previous file with comments | « no previous file | Source/platform/network/ResourceError.h » ('j') | public/platform/WebURLError.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 46
47 WebURLError& WebURLError::operator=(const ResourceError& error) 47 WebURLError& WebURLError::operator=(const ResourceError& error)
48 { 48 {
49 if (error.isNull()) { 49 if (error.isNull()) {
50 *this = WebURLError(); 50 *this = WebURLError();
51 } else { 51 } else {
52 domain = error.domain(); 52 domain = error.domain();
53 reason = error.errorCode(); 53 reason = error.errorCode();
54 unreachableURL = KURL(ParsedURLString, error.failingURL()); 54 unreachableURL = KURL(ParsedURLString, error.failingURL());
55 isCancellation = error.isCancellation(); 55 isCancellation = error.isCancellation();
56 staleCopyInCache = error.staleCopyInCache();
56 localizedDescription = error.localizedDescription(); 57 localizedDescription = error.localizedDescription();
57 } 58 }
58 return *this; 59 return *this;
59 } 60 }
60 61
61 WebURLError::operator ResourceError() const 62 WebURLError::operator ResourceError() const
62 { 63 {
63 if (!reason) 64 if (!reason)
64 return ResourceError(); 65 return ResourceError();
65 CString spec = unreachableURL.spec(); 66 CString spec = unreachableURL.spec();
66 ResourceError resourceError = ResourceError(domain, reason, String::fromUTF8 (spec.data(), spec.length()), localizedDescription); 67 ResourceError resourceError = ResourceError(domain, reason, String::fromUTF8 (spec.data(), spec.length()), localizedDescription);
67 resourceError.setIsCancellation(isCancellation); 68 resourceError.setIsCancellation(isCancellation);
69 resourceError.setStaleCopyInCache(staleCopyInCache);
68 return resourceError; 70 return resourceError;
69 } 71 }
70 72
71 } // namespace blink 73 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/platform/network/ResourceError.h » ('j') | public/platform/WebURLError.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698