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

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

Issue 850043008: [DO NOT REVIEW][DO NOT COMMIT] Implement WebDataProducerHandleImpl. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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/blink_platform_impl.cc ('k') | content/child/web_data_producer_handle_impl.h » ('j') | 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/web_data_consumer_handle_impl.h" 5 #include "content/child/web_data_consumer_handle_impl.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "mojo/public/c/system/types.h" 10 #include "mojo/public/c/system/types.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 72
73 handle_watcher_.Start( 73 handle_watcher_.Start(
74 handle_.get(), 74 handle_.get(),
75 MOJO_HANDLE_SIGNAL_READABLE, 75 MOJO_HANDLE_SIGNAL_READABLE,
76 MOJO_DEADLINE_INDEFINITE, 76 MOJO_DEADLINE_INDEFINITE,
77 base::Bind(&WebDataConsumerHandleImpl::OnHandleGotReadable, 77 base::Bind(&WebDataConsumerHandleImpl::OnHandleGotReadable,
78 base::Unretained(this))); 78 base::Unretained(this)));
79 } 79 }
80 80
81 void WebDataConsumerHandleImpl::unregisterClient() { 81 void WebDataConsumerHandleImpl::unregisterClient() {
82 DCHECK(client_);
82 client_ = nullptr; 83 client_ = nullptr;
83 handle_watcher_.Stop(); 84 handle_watcher_.Stop();
84 } 85 }
85 86
86 Result WebDataConsumerHandleImpl::HandleReadResult(MojoResult mojo_result) { 87 Result WebDataConsumerHandleImpl::HandleReadResult(MojoResult mojo_result) {
87 switch (mojo_result) { 88 switch (mojo_result) {
88 case MOJO_RESULT_OK: 89 case MOJO_RESULT_OK:
89 return Ok; 90 return Ok;
90 case MOJO_RESULT_FAILED_PRECONDITION: 91 case MOJO_RESULT_FAILED_PRECONDITION:
91 return Done; 92 return Done;
(...skipping 15 matching lines...) Expand all
107 return UnexpectedError; 108 return UnexpectedError;
108 } 109 }
109 } 110 }
110 111
111 void WebDataConsumerHandleImpl::OnHandleGotReadable(MojoResult) { 112 void WebDataConsumerHandleImpl::OnHandleGotReadable(MojoResult) {
112 DCHECK(client_); 113 DCHECK(client_);
113 client_->didGetReadable(); 114 client_->didGetReadable();
114 } 115 }
115 116
116 } // namespace content 117 } // namespace content
OLDNEW
« no previous file with comments | « content/child/blink_platform_impl.cc ('k') | content/child/web_data_producer_handle_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698