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/WorkerLoaderClientBridgeSyncHelper.cpp

Issue 705003002: Change the return type of WTF::bind() to |OwnPtr<Function>| (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 6 years, 1 month 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) 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 { 50 {
51 ASSERT(isMainThread()); 51 ASSERT(isMainThread());
52 for (size_t i = 0; i < m_receivedData.size(); ++i) 52 for (size_t i = 0; i < m_receivedData.size(); ++i)
53 delete m_receivedData[i]; 53 delete m_receivedData[i];
54 } 54 }
55 55
56 void WorkerLoaderClientBridgeSyncHelper::run() 56 void WorkerLoaderClientBridgeSyncHelper::run()
57 { 57 {
58 // This must be called only after m_event is signalled. 58 // This must be called only after m_event is signalled.
59 ASSERT(m_done); 59 ASSERT(m_done);
60 for (size_t i = 0; i < m_clientTasks.size(); ++i) 60 m_clientTasks.applyEach(&Closure::operator());
61 m_clientTasks[i]();
62 } 61 }
63 62
64 void WorkerLoaderClientBridgeSyncHelper::didSendData(unsigned long long bytesSen t, unsigned long long totalBytesToBeSent) 63 void WorkerLoaderClientBridgeSyncHelper::didSendData(unsigned long long bytesSen t, unsigned long long totalBytesToBeSent)
65 { 64 {
66 ASSERT(isMainThread()); 65 ASSERT(isMainThread());
67 m_clientTasks.append(bind(&ThreadableLoaderClient::didSendData, &m_client, b ytesSent, totalBytesToBeSent)); 66 m_clientTasks.append(bind(&ThreadableLoaderClient::didSendData, &m_client, b ytesSent, totalBytesToBeSent));
68 } 67 }
69 68
70 static void didReceiveResponseAdapter(ThreadableLoaderClient* client, unsigned l ong identifier, PassOwnPtr<CrossThreadResourceResponseData> responseData, PassOw nPtr<WebDataConsumerHandle> handle) 69 static void didReceiveResponseAdapter(ThreadableLoaderClient* client, unsigned l ong identifier, PassOwnPtr<CrossThreadResourceResponseData> responseData, PassOw nPtr<WebDataConsumerHandle> handle)
71 { 70 {
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 136
138 WorkerLoaderClientBridgeSyncHelper::WorkerLoaderClientBridgeSyncHelper(Threadabl eLoaderClient& client, PassOwnPtr<blink::WebWaitableEvent> event) 137 WorkerLoaderClientBridgeSyncHelper::WorkerLoaderClientBridgeSyncHelper(Threadabl eLoaderClient& client, PassOwnPtr<blink::WebWaitableEvent> event)
139 : m_done(false) 138 : m_done(false)
140 , m_client(client) 139 , m_client(client)
141 , m_event(event) 140 , m_event(event)
142 { 141 {
143 ASSERT(m_event); 142 ASSERT(m_event);
144 } 143 }
145 144
146 } // namespace blink 145 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698