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

Unified Diff: blimp/client/core/blimp_client_context_impl.cc

Issue 2344893009: Blimp: relocate thread-unsafe member getter in DropConnection code. (Closed)
Patch Set: wez feedback Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « blimp/client/core/blimp_client_context_impl.h ('k') | blimp/client/session/blimp_client_session.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: blimp/client/core/blimp_client_context_impl.cc
diff --git a/blimp/client/core/blimp_client_context_impl.cc b/blimp/client/core/blimp_client_context_impl.cc
index 246d78d4b8f24cfd71c33fbaa06f981d7b87b400..2f207a811b5b58bfdfce2494ee2b281b6eaebb78 100644
--- a/blimp/client/core/blimp_client_context_impl.cc
+++ b/blimp/client/core/blimp_client_context_impl.cc
@@ -38,8 +38,14 @@ namespace blimp {
namespace client {
namespace {
+
const char kDefaultAssignerUrl[] =
"https://blimp-pa.googleapis.com/v1/assignment";
+
+void DropConnectionOnIOThread(ClientNetworkComponents* net_components) {
+ net_components->GetBrowserConnectionHandler()->DropCurrentConnection();
+}
+
} // namespace
// This function is declared in //blimp/client/public/blimp_client_context.h,
@@ -226,6 +232,11 @@ void BlimpClientContextImpl::InitializeSettings() {
settings_feature_->SetRecordWholeDocument(true);
}
+void BlimpClientContextImpl::DropConnection() {
+ io_thread_task_runner_->PostTask(
+ FROM_HERE, base::Bind(&DropConnectionOnIOThread, net_components_.get()));
+}
+
void BlimpClientContextImpl::CreateIdentitySource() {
identity_source_ = base::MakeUnique<IdentitySource>(
delegate_, base::Bind(&BlimpClientContextImpl::OnAuthTokenReceived,
@@ -234,11 +245,7 @@ void BlimpClientContextImpl::CreateIdentitySource() {
void BlimpClientContextImpl::OnImageDecodeError() {
// Currently we just drop the connection on image decoding error.
- io_thread_task_runner_->PostTask(
- FROM_HERE,
- base::Bind(
- &BrowserConnectionHandler::DropCurrentConnection,
- base::Unretained(net_components_->GetBrowserConnectionHandler())));
+ DropConnection();
}
} // namespace client
« no previous file with comments | « blimp/client/core/blimp_client_context_impl.h ('k') | blimp/client/session/blimp_client_session.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698