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

Unified Diff: content/child/threaded_data_provider.h

Issue 689713004: Threaded data provider: Support main thread data notifications (Chrome side) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/child/resource_dispatcher.cc ('k') | content/child/threaded_data_provider.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/threaded_data_provider.h
diff --git a/content/child/threaded_data_provider.h b/content/child/threaded_data_provider.h
index 0605ac134b275759e2dbd5ac92686c944eea109c..fcd70089e6972759c003aba6829a029310457dbb 100644
--- a/content/child/threaded_data_provider.h
+++ b/content/child/threaded_data_provider.h
@@ -14,6 +14,8 @@
#include "ipc/ipc_channel.h"
#include "ipc/message_filter.h"
+struct ResourceMsg_RequestCompleteData;
+
namespace blink {
class WebThreadedDataReceiver;
}
@@ -23,6 +25,7 @@ class SyncChannel;
}
namespace content {
+class ResourceDispatcher;
class WebThreadImpl;
class ThreadedDataProvider {
@@ -33,8 +36,9 @@ class ThreadedDataProvider {
linked_ptr<base::SharedMemory> shm_buffer,
int shm_size,
scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_);
- virtual ~ThreadedDataProvider();
+ // Any destruction of this class has to bounce via the background thread to
+ // ensure all data is flushed; call Stop() to start this process.
void Stop();
void OnReceivedDataOnBackgroundThread(int data_offset,
int data_length,
@@ -45,11 +49,28 @@ class ThreadedDataProvider {
int encoded_data_length);
void OnResourceMessageFilterAddedMainThread();
+ void OnRequestCompleteForegroundThread(
+ base::WeakPtr<ResourceDispatcher> resource_dispatcher,
+ const ResourceMsg_RequestCompleteData& request_complete_data,
+ const base::TimeTicks& renderer_completion_time);
private:
+ ~ThreadedDataProvider();
+ void DestructOnMainThread();
+
void StopOnBackgroundThread();
void OnResourceMessageFilterAddedBackgroundThread();
- void ForwardAndACKData(const char* data, int data_length);
+ void OnRequestCompleteBackgroundThread(
+ base::WeakPtr<ResourceDispatcher> resource_dispatcher,
+ const ResourceMsg_RequestCompleteData& request_complete_data,
+ const base::TimeTicks& renderer_completion_time);
+ void ForwardAndACKData(const char* data,
+ int data_length,
+ int encoded_data_length);
+ void DataNotifyForegroundThread(
+ scoped_ptr<std::vector<char> > data_copy,
+ int data_length,
+ int encoded_data_length);
scoped_refptr<IPC::MessageFilter> filter_;
int request_id_;
@@ -66,6 +87,7 @@ class ThreadedDataProvider {
struct QueuedSharedMemoryData {
const char* data;
int length;
+ int encoded_length;
};
std::vector<QueuedSharedMemoryData> queued_data_;
« no previous file with comments | « content/child/resource_dispatcher.cc ('k') | content/child/threaded_data_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698