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

Side by Side Diff: content/child/threaded_data_provider.cc

Issue 567873003: Refactoring the weak_ptr_factory order in src/content/child (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated patch as per comments Created 6 years, 3 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 | « content/child/threaded_data_provider.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/child/threaded_data_provider.h" 5 #include "content/child/threaded_data_provider.h"
6 6
7 #include "content/child/child_process.h" 7 #include "content/child/child_process.h"
8 #include "content/child/child_thread.h" 8 #include "content/child/child_thread.h"
9 #include "content/child/resource_dispatcher.h" 9 #include "content/child/resource_dispatcher.h"
10 #include "content/child/thread_safe_sender.h" 10 #include "content/child/thread_safe_sender.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 } 117 }
118 118
119 } // anonymous namespace 119 } // anonymous namespace
120 120
121 ThreadedDataProvider::ThreadedDataProvider( 121 ThreadedDataProvider::ThreadedDataProvider(
122 int request_id, blink::WebThreadedDataReceiver* threaded_data_receiver, 122 int request_id, blink::WebThreadedDataReceiver* threaded_data_receiver,
123 linked_ptr<base::SharedMemory> shm_buffer, int shm_size) 123 linked_ptr<base::SharedMemory> shm_buffer, int shm_size)
124 : request_id_(request_id), 124 : request_id_(request_id),
125 shm_buffer_(shm_buffer), 125 shm_buffer_(shm_buffer),
126 shm_size_(shm_size), 126 shm_size_(shm_size),
127 main_thread_weak_factory_(this),
128 background_thread_( 127 background_thread_(
129 static_cast<WebThreadImpl&>( 128 static_cast<WebThreadImpl&>(
130 *threaded_data_receiver->backgroundThread())), 129 *threaded_data_receiver->backgroundThread())),
131 ipc_channel_(ChildThread::current()->channel()), 130 ipc_channel_(ChildThread::current()->channel()),
132 threaded_data_receiver_(threaded_data_receiver), 131 threaded_data_receiver_(threaded_data_receiver),
133 resource_filter_active_(false), 132 resource_filter_active_(false),
134 main_thread_message_loop_(ChildThread::current()->message_loop()) { 133 main_thread_message_loop_(ChildThread::current()->message_loop()),
134 main_thread_weak_factory_(this) {
135 DCHECK(ChildThread::current()); 135 DCHECK(ChildThread::current());
136 DCHECK(ipc_channel_); 136 DCHECK(ipc_channel_);
137 DCHECK(threaded_data_receiver_); 137 DCHECK(threaded_data_receiver_);
138 DCHECK(main_thread_message_loop_); 138 DCHECK(main_thread_message_loop_);
139 139
140 background_thread_weak_factory_.reset( 140 background_thread_weak_factory_.reset(
141 new base::WeakPtrFactory<ThreadedDataProvider>(this)); 141 new base::WeakPtrFactory<ThreadedDataProvider>(this));
142 142
143 filter_ = new DataProviderMessageFilter( 143 filter_ = new DataProviderMessageFilter(
144 ChildProcess::current()->io_message_loop_proxy(), 144 ChildProcess::current()->io_message_loop_proxy(),
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 280
281 // TODO(oysteine): SiteIsolationPolicy needs to be be checked 281 // TODO(oysteine): SiteIsolationPolicy needs to be be checked
282 // here before we pass the data to the data provider 282 // here before we pass the data to the data provider
283 // (or earlier on the I/O thread), otherwise once SiteIsolationPolicy does 283 // (or earlier on the I/O thread), otherwise once SiteIsolationPolicy does
284 // actual blocking as opposed to just UMA logging this will bypass it. 284 // actual blocking as opposed to just UMA logging this will bypass it.
285 threaded_data_receiver_->acceptData(data, data_length); 285 threaded_data_receiver_->acceptData(data, data_length);
286 ipc_channel_->Send(new ResourceHostMsg_DataReceived_ACK(request_id_)); 286 ipc_channel_->Send(new ResourceHostMsg_DataReceived_ACK(request_id_));
287 } 287 }
288 288
289 } // namespace content 289 } // namespace content
OLDNEW
« no previous file with comments | « content/child/threaded_data_provider.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698