Skip to content

Commit

Permalink
[Cronet] Don't InitializeOnNetworkThread until main_context_getter_ i…
Browse files Browse the repository at this point in the history
…s created.

BUG=583085

Review URL: https://codereview.chromium.org/1732753005

Cr-Commit-Position: refs/heads/master@{#379559}
  • Loading branch information
mef authored and Commit bot committed Mar 7, 2016
1 parent ded5afe commit 99df23c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions ios/crnet/crnet_environment.mm
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <utility>

#include "base/at_exit.h"
#include "base/atomicops.h"
#include "base/command_line.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
Expand Down Expand Up @@ -286,13 +287,14 @@ bool IsRequestSupported(NSURLRequest* request) override {
proxy_config_service_ = net::ProxyService::CreateSystemProxyConfigService(
network_io_thread_->task_runner(), nullptr);

net::SetURLRequestContextForNSSHttpIO(main_context_.get());
main_context_getter_ = new CrNetURLRequestContextGetter(
main_context_.get(), network_io_thread_->task_runner());
base::subtle::MemoryBarrier();
PostToNetworkThread(FROM_HERE,
base::Bind(&CrNetEnvironment::InitializeOnNetworkThread,
base::Unretained(this)));

net::SetURLRequestContextForNSSHttpIO(main_context_.get());
main_context_getter_ = new CrNetURLRequestContextGetter(
main_context_.get(), network_io_thread_->task_runner());
SetRequestFilterBlock(nil);
}

Expand Down

0 comments on commit 99df23c

Please sign in to comment.