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

Side by Side Diff: Source/core/loader/ThreadableLoader.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: Avoid potential race-condition between load and timeout Created 6 years, 7 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 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 }; 77 };
78 78
79 // Useful for doing loader operations from any thread (not threadsafe, 79 // Useful for doing loader operations from any thread (not threadsafe,
80 // just able to run on threads other than the main thread). 80 // just able to run on threads other than the main thread).
81 class ThreadableLoader : public RefCounted<ThreadableLoader> { 81 class ThreadableLoader : public RefCounted<ThreadableLoader> {
82 WTF_MAKE_NONCOPYABLE(ThreadableLoader); 82 WTF_MAKE_NONCOPYABLE(ThreadableLoader);
83 public: 83 public:
84 static void loadResourceSynchronously(ExecutionContext&, const ResourceR equest&, ThreadableLoaderClient&, const ThreadableLoaderOptions&); 84 static void loadResourceSynchronously(ExecutionContext&, const ResourceR equest&, ThreadableLoaderClient&, const ThreadableLoaderOptions&);
85 static PassRefPtr<ThreadableLoader> create(ExecutionContext&, Threadable LoaderClient*, const ResourceRequest&, const ThreadableLoaderOptions&); 85 static PassRefPtr<ThreadableLoader> create(ExecutionContext&, Threadable LoaderClient*, const ResourceRequest&, const ThreadableLoaderOptions&);
86 86
87 // A ThreadableLoader may have a timeout specified. It is possible, in s ome cases, for
88 // the timeout to be overridden after the request is sent (for example, XMLHttpRequests
89 // may override their timeout setting after sending).
90 //
91 // Set a new timeout relative to the time the request started, in millis econds.
92 virtual void overrideTimeout(unsigned long timeoutMilliseconds) = 0;
93
87 virtual void cancel() = 0; 94 virtual void cancel() = 0;
88 95
89 virtual ~ThreadableLoader() { } 96 virtual ~ThreadableLoader() { }
90 97
91 protected: 98 protected:
92 ThreadableLoader() { } 99 ThreadableLoader() { }
93 }; 100 };
94 101
95 } // namespace WebCore 102 } // namespace WebCore
96 103
97 #endif // ThreadableLoader_h 104 #endif // ThreadableLoader_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698