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

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

Issue 1264453002: Split the constructor of ThreadableLoader into two methods (ctor and start()) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Addressed #7. Rebased Created 5 years, 4 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 // just able to run on threads other than the main thread). 117 // just able to run on threads other than the main thread).
118 class CORE_EXPORT ThreadableLoader : public RefCounted<ThreadableLoader> { 118 class CORE_EXPORT ThreadableLoader : public RefCounted<ThreadableLoader> {
119 WTF_MAKE_NONCOPYABLE(ThreadableLoader); 119 WTF_MAKE_NONCOPYABLE(ThreadableLoader);
120 public: 120 public:
121 // ThreadableLoaderOptions argument configures this ThreadableLoader's 121 // ThreadableLoaderOptions argument configures this ThreadableLoader's
122 // behavior. 122 // behavior.
123 // 123 //
124 // ResourceLoaderOptions argument will be passed to the FetchRequest 124 // ResourceLoaderOptions argument will be passed to the FetchRequest
125 // that this ThreadableLoader creates. It can be altered e.g. when 125 // that this ThreadableLoader creates. It can be altered e.g. when
126 // redirect happens. 126 // redirect happens.
127
127 static void loadResourceSynchronously(ExecutionContext&, const ResourceR equest&, ThreadableLoaderClient&, const ThreadableLoaderOptions&, const Resource LoaderOptions&); 128 static void loadResourceSynchronously(ExecutionContext&, const ResourceR equest&, ThreadableLoaderClient&, const ThreadableLoaderOptions&, const Resource LoaderOptions&);
128 static PassRefPtr<ThreadableLoader> create(ExecutionContext&, Threadable LoaderClient*, const ResourceRequest&, const ThreadableLoaderOptions&, const Res ourceLoaderOptions&); 129 // create() must always followed by start() call.
hiroshige 2015/08/10 15:00:05 Please mention that create() never returns null.
tyoshino (SeeGerritForStatus) 2016/01/29 12:36:52 Done.
tyoshino (SeeGerritForStatus) 2016/01/29 12:37:56 This reply had to be published before.
130 // |ThreadableLoaderClient| methods are never called before start() call .
131 static PassRefPtr<ThreadableLoader> create(ExecutionContext&, Threadable LoaderClient*, const ThreadableLoaderOptions&, const ResourceLoaderOptions&);
132
133 // The methods on the |ThreadableLoaderClient| may be called
134 // synchronous to start() call.
135 virtual void start(const ResourceRequest&) = 0;
129 136
130 // A ThreadableLoader may have a timeout specified. It is possible, in s ome cases, for 137 // A ThreadableLoader may have a timeout specified. It is possible, in s ome cases, for
131 // the timeout to be overridden after the request is sent (for example, XMLHttpRequests 138 // the timeout to be overridden after the request is sent (for example, XMLHttpRequests
132 // may override their timeout setting after sending). 139 // may override their timeout setting after sending).
133 // 140 //
134 // Set a new timeout relative to the time the request started, in millis econds. 141 // Set a new timeout relative to the time the request started, in millis econds.
135 virtual void overrideTimeout(unsigned long timeoutMilliseconds) = 0; 142 virtual void overrideTimeout(unsigned long timeoutMilliseconds) = 0;
136 143
137 virtual void cancel() = 0; 144 virtual void cancel() = 0;
138 145
139 virtual ~ThreadableLoader() { } 146 virtual ~ThreadableLoader() { }
140 147
141 protected: 148 protected:
142 ThreadableLoader() { } 149 ThreadableLoader() { }
143 }; 150 };
144 151
145 } // namespace blink 152 } // namespace blink
146 153
147 #endif // ThreadableLoader_h 154 #endif // ThreadableLoader_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698