| Index: mojo/services/network/network_service_delegate.cc
|
| diff --git a/mojo/services/network/network_service_delegate.cc b/mojo/services/network/network_service_delegate.cc
|
| index 76e0b6924b2eba979a933e699ebf103a8c042647..eb3b73be91f3041cdab8c2f80503da028e798682 100644
|
| --- a/mojo/services/network/network_service_delegate.cc
|
| +++ b/mojo/services/network/network_service_delegate.cc
|
| @@ -6,8 +6,12 @@
|
|
|
| #include "base/at_exit.h"
|
| #include "base/base_paths.h"
|
| +#include "base/command_line.h"
|
| +#include "base/bind.h"
|
| +#include "base/threading/thread.h"
|
| #include "base/files/file_path.h"
|
| #include "base/message_loop/message_loop.h"
|
| +#include "base/memory/scoped_ptr.h"
|
| #include "base/path_service.h"
|
| #include "third_party/mojo/src/mojo/public/cpp/application/application_connection.h"
|
|
|
| @@ -20,6 +24,16 @@ void NetworkServiceDelegate::Initialize(mojo::ApplicationImpl* app) {
|
| base::FilePath base_path;
|
| CHECK(PathService::Get(base::DIR_TEMP, &base_path));
|
| base_path = base_path.Append(FILE_PATH_LITERAL("network_service"));
|
| + base::CommandLine command_line(app->args());
|
| + if (command_line.HasSwitch("clear")) {
|
| + scoped_ptr<base::Thread> cache_delete_thread(
|
| + new base::Thread("network cache delete thread"));
|
| + cache_delete_thread->Start();
|
| + mojo::NetworkContext::ClearCache(
|
| + base_path, cache_delete_thread->task_runner(),
|
| + base::Bind(&base::Thread::Stop,
|
| + base::Owned(cache_delete_thread.release())));
|
| + }
|
| context_.reset(new mojo::NetworkContext(base_path));
|
| }
|
|
|
|
|