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

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

Issue 204983007: Make ThreadableLoader class to use references (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 9 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 AtomicString initiator; 73 AtomicString initiator;
74 ContentSecurityPolicyEnforcement contentSecurityPolicyEnforcement; 74 ContentSecurityPolicyEnforcement contentSecurityPolicyEnforcement;
75 unsigned long timeoutMilliseconds; 75 unsigned long timeoutMilliseconds;
76 }; 76 };
77 77
78 // Useful for doing loader operations from any thread (not threadsafe, 78 // Useful for doing loader operations from any thread (not threadsafe,
79 // just able to run on threads other than the main thread). 79 // just able to run on threads other than the main thread).
80 class ThreadableLoader { 80 class ThreadableLoader {
81 WTF_MAKE_NONCOPYABLE(ThreadableLoader); 81 WTF_MAKE_NONCOPYABLE(ThreadableLoader);
82 public: 82 public:
83 static void loadResourceSynchronously(ExecutionContext*, const ResourceR equest&, ThreadableLoaderClient&, const ThreadableLoaderOptions&); 83 static void loadResourceSynchronously(ExecutionContext&, const ResourceR equest&, ThreadableLoaderClient&, const ThreadableLoaderOptions&);
84 static PassRefPtr<ThreadableLoader> create(ExecutionContext*, Threadable LoaderClient*, const ResourceRequest&, const ThreadableLoaderOptions&); 84 static PassRefPtr<ThreadableLoader> create(ExecutionContext&, Threadable LoaderClient*, const ResourceRequest&, const ThreadableLoaderOptions&);
85
86 static void loadResourceSynchronously(ExecutionContext* context, const R esourceRequest& request, ThreadableLoaderClient& client, const ThreadableLoaderO ptions& options)
Inactive 2014/03/22 15:09:54 Do we really need to add these? Can't we simply fi
maheshkk 2014/03/24 18:17:48 We can fix other callers, I was trying to minimize
87 {
88 ThreadableLoader::loadResourceSynchronously(*context, request, clien t, options);
89 }
90
91 static PassRefPtr<ThreadableLoader> create(ExecutionContext* context, Th readableLoaderClient* client, const ResourceRequest& request, const ThreadableLo aderOptions& options)
92 {
93 return create(*context, client, request, options);
94 }
85 95
86 virtual void cancel() = 0; 96 virtual void cancel() = 0;
87 void ref() { refThreadableLoader(); } 97 void ref() { refThreadableLoader(); }
88 void deref() { derefThreadableLoader(); } 98 void deref() { derefThreadableLoader(); }
89 99
90 protected: 100 protected:
91 ThreadableLoader() { } 101 ThreadableLoader() { }
92 virtual ~ThreadableLoader() { } 102 virtual ~ThreadableLoader() { }
93 virtual void refThreadableLoader() = 0; 103 virtual void refThreadableLoader() = 0;
94 virtual void derefThreadableLoader() = 0; 104 virtual void derefThreadableLoader() = 0;
95 }; 105 };
96 106
97 } // namespace WebCore 107 } // namespace WebCore
98 108
99 #endif // ThreadableLoader_h 109 #endif // ThreadableLoader_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698