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

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

Issue 887463003: Turn WorkerLoaderProxy into a threadsafe, ref-counted object. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Clarify WorkerLoaderProxyProvider's obligations on shutdown Created 5 years, 10 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 | « Source/core/fetch/MemoryCache.cpp ('k') | Source/core/loader/WorkerLoaderClientBridge.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2014 Google Inc. All rights reserved. 2 * Copyright (C) 2014 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 27 matching lines...) Expand all
38 namespace blink { 38 namespace blink {
39 39
40 class ThreadableLoaderClientWrapper; 40 class ThreadableLoaderClientWrapper;
41 class WorkerLoaderProxy; 41 class WorkerLoaderProxy;
42 42
43 // This bridge is created and destroyed on the worker thread, but is 43 // This bridge is created and destroyed on the worker thread, but is
44 // passed to and used on the main thread. Each did* method relays the given 44 // passed to and used on the main thread. Each did* method relays the given
45 // data to the client wrapper on the worker context thread. 45 // data to the client wrapper on the worker context thread.
46 class WorkerLoaderClientBridge : public ThreadableLoaderClient { 46 class WorkerLoaderClientBridge : public ThreadableLoaderClient {
47 public: 47 public:
48 static PassOwnPtr<ThreadableLoaderClient> create(PassRefPtr<ThreadableLoader ClientWrapper>, WorkerLoaderProxy&); 48 static PassOwnPtr<ThreadableLoaderClient> create(PassRefPtr<ThreadableLoader ClientWrapper>, PassRefPtr<WorkerLoaderProxy>);
49 virtual ~WorkerLoaderClientBridge(); 49 virtual ~WorkerLoaderClientBridge();
50 50
51 virtual void didSendData(unsigned long long bytesSent, unsigned long long to talBytesToBeSent) override; 51 virtual void didSendData(unsigned long long bytesSent, unsigned long long to talBytesToBeSent) override;
52 virtual void didReceiveResponse(unsigned long identifier, const ResourceResp onse&, PassOwnPtr<WebDataConsumerHandle>) override; 52 virtual void didReceiveResponse(unsigned long identifier, const ResourceResp onse&, PassOwnPtr<WebDataConsumerHandle>) override;
53 virtual void didReceiveData(const char*, unsigned dataLength) override; 53 virtual void didReceiveData(const char*, unsigned dataLength) override;
54 virtual void didDownloadData(int dataLength) override; 54 virtual void didDownloadData(int dataLength) override;
55 virtual void didReceiveCachedMetadata(const char*, int dataLength) override; 55 virtual void didReceiveCachedMetadata(const char*, int dataLength) override;
56 virtual void didFinishLoading(unsigned long identifier, double finishTime) o verride; 56 virtual void didFinishLoading(unsigned long identifier, double finishTime) o verride;
57 virtual void didFail(const ResourceError&) override; 57 virtual void didFail(const ResourceError&) override;
58 virtual void didFailAccessControlCheck(const ResourceError&) override; 58 virtual void didFailAccessControlCheck(const ResourceError&) override;
59 virtual void didFailRedirectCheck() override; 59 virtual void didFailRedirectCheck() override;
60 60
61 private: 61 private:
62 WorkerLoaderClientBridge(PassRefPtr<ThreadableLoaderClientWrapper>, WorkerLo aderProxy&); 62 WorkerLoaderClientBridge(PassRefPtr<ThreadableLoaderClientWrapper>, PassRefP tr<WorkerLoaderProxy>);
63 63
64 // Used on the worker context thread, while its refcounting is done on 64 // Used on the worker context thread, while its refcounting is done on
65 // either thread. 65 // either thread.
66 RefPtr<ThreadableLoaderClientWrapper> m_workerClientWrapper; 66 RefPtr<ThreadableLoaderClientWrapper> m_workerClientWrapper;
67 67
68 WorkerLoaderProxy& m_loaderProxy; 68 RefPtr<WorkerLoaderProxy> m_loaderProxy;
69 }; 69 };
70 70
71 } // namespace blink 71 } // namespace blink
72 72
73 #endif // WorkerLoaderClientBridge_h 73 #endif // WorkerLoaderClientBridge_h
OLDNEW
« no previous file with comments | « Source/core/fetch/MemoryCache.cpp ('k') | Source/core/loader/WorkerLoaderClientBridge.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698