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

Side by Side Diff: Source/core/loader/DocumentThreadableLoader.h

Issue 273993002: Allow XHR timeout attribute to be overridden after send(), per spec (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Reset m_requestStartedSeconds in a few extra places +fix bitrot Created 6 years, 6 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2013, Intel Corporation 3 * Copyright (C) 2013, Intel Corporation
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 class SecurityOrigin; 51 class SecurityOrigin;
52 class ThreadableLoaderClient; 52 class ThreadableLoaderClient;
53 53
54 class DocumentThreadableLoader FINAL : public ThreadableLoader, private Resource Owner<RawResource> { 54 class DocumentThreadableLoader FINAL : public ThreadableLoader, private Resource Owner<RawResource> {
55 WTF_MAKE_FAST_ALLOCATED; 55 WTF_MAKE_FAST_ALLOCATED;
56 public: 56 public:
57 static void loadResourceSynchronously(Document&, const ResourceRequest&, ThreadableLoaderClient&, const ThreadableLoaderOptions&); 57 static void loadResourceSynchronously(Document&, const ResourceRequest&, ThreadableLoaderClient&, const ThreadableLoaderOptions&);
58 static PassRefPtr<DocumentThreadableLoader> create(Document&, Threadable LoaderClient*, const ResourceRequest&, const ThreadableLoaderOptions&); 58 static PassRefPtr<DocumentThreadableLoader> create(Document&, Threadable LoaderClient*, const ResourceRequest&, const ThreadableLoaderOptions&);
59 virtual ~DocumentThreadableLoader(); 59 virtual ~DocumentThreadableLoader();
60 60
61 virtual void overrideTimeout(unsigned long timeout) OVERRIDE;
62
61 virtual void cancel() OVERRIDE; 63 virtual void cancel() OVERRIDE;
62 void setDefersLoading(bool); 64 void setDefersLoading(bool);
63 65
64 private: 66 private:
65 enum BlockingBehavior { 67 enum BlockingBehavior {
66 LoadSynchronously, 68 LoadSynchronously,
67 LoadAsynchronously 69 LoadAsynchronously
68 }; 70 };
69 71
70 DocumentThreadableLoader(Document&, ThreadableLoaderClient*, BlockingBeh avior, const ResourceRequest&, const ThreadableLoaderOptions&); 72 DocumentThreadableLoader(Document&, ThreadableLoaderClient*, BlockingBeh avior, const ResourceRequest&, const ThreadableLoaderOptions&);
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 106
105 ThreadableLoaderClient* m_client; 107 ThreadableLoaderClient* m_client;
106 Document& m_document; 108 Document& m_document;
107 ThreadableLoaderOptions m_options; 109 ThreadableLoaderOptions m_options;
108 bool m_sameOriginRequest; 110 bool m_sameOriginRequest;
109 bool m_simpleRequest; 111 bool m_simpleRequest;
110 bool m_async; 112 bool m_async;
111 OwnPtr<ResourceRequest> m_actualRequest; // non-null during Access Contr ol preflight checks 113 OwnPtr<ResourceRequest> m_actualRequest; // non-null during Access Contr ol preflight checks
112 HTTPHeaderMap m_simpleRequestHeaders; // stores simple request headers i n case of a cross-origin redirect. 114 HTTPHeaderMap m_simpleRequestHeaders; // stores simple request headers i n case of a cross-origin redirect.
113 Timer<DocumentThreadableLoader> m_timeoutTimer; 115 Timer<DocumentThreadableLoader> m_timeoutTimer;
116 double m_requestStartedSeconds; // Time an asynchronous fetch request is started
114 }; 117 };
115 118
116 } // namespace WebCore 119 } // namespace WebCore
117 120
118 #endif // DocumentThreadableLoader_h 121 #endif // DocumentThreadableLoader_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698